8000 More code using new transformation framework. Lots of dead code · matplotlib/matplotlib@4cd25ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 4cd25ce

Browse files
committed
More code using new transformation framework. Lots of dead code
removed from backend_agg.cpp/h svn path=/branches/transforms/; revision=3855
1 parent 9f35186 commit 4cd25ce

File tree

8 files changed

+320
-1083
lines changed

8 files changed

+320
-1083
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def close_group(self, s):
3939
def _get_cached_native_path(self, path):
4040
native_path = self._native_paths.get(path)
4141
if native_path is None:
42-
import matplotlib.patches
43-
print "CACHE MISS", path
42+
# print "CACHE MISS", path
4443
native_path = self.convert_to_native_path(path)
4544
self._native_paths[path] = native_path
4645
return native_path

lib/matplotlib/backends/backend_agg.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,9 @@ def __init__(self, width, height, dpi):
121121
debug=False)
122122
if __debug__: verbose.report('RendererAgg.__init__ _RendererAgg done',
123123
'debug-annoying')
124-
# self.draw_polygon = self._renderer.draw_polygon
125-
self.draw_rectangle = self._renderer.draw_rectangle
126-
# MGDTODO -- remove these lines
127-
# self.draw_lines = self._renderer.draw_lines
128-
# self.draw_markers = self._renderer.draw_markers
129-
self.draw_image = self._renderer.draw_image
130124

125+
self.convert_to_native_path = self._renderer.convert_to_native_path
126+
self.draw_image = self._renderer.draw_image
131127
self.copy_from_bbox = self._renderer.copy_from_bbox
132128
self.restore_region = self._renderer.restore_region
133129
self.mathtext_parser = MathTextParser('Agg')
@@ -137,12 +133,9 @@ def __init__(self, width, height, dpi):
137133
if __debug__: verbose.report('RendererAgg.__init__ done',
138134
'debug-annoying')
139135

140-
def convert_to_native_path(self, path):
141-
return self._renderer.convert_to_native_path(path.vertices, path.codes)
142-
143-
def _draw_native_path(self, gc, native_path, transform, rgbFace):
144-
return self._renderer.draw_path(gc, native_path, transform.to_values(), rgbFace)
145-
136+
def _draw_native_path(self, gc, path, transform, rgbFace):
137+
return self._renderer.draw_path(gc, path, transform.get_matrix(), rgbFace)
138+
146139
def draw_arc(self, gcEdge, rgbFace, x, y, width, height, angle1, angle2, rotation):
147140
"""
148141
Draw an arc centered at x,y with width and height and angles
@@ -175,8 +168,8 @@ def draw_lines(self, gc, x, y, transform):
175168
def _draw_native_markers(self, gc, native_marker_path, marker_trans, path, trans, rgbFace=None):
176169
return self._renderer.draw_markers(
177170
gc,
178-
native_marker_path, marker_trans.to_values(),
179-
path.vertices, path.codes, trans.to_values(),
171+
native_marker_path, marker_trans.get_matrix(),
172+
path.vertices, path.codes, trans.get_matrix(),
180173
rgbFace)
181174

182175
def draw_polygon(self, *args):

0 commit comments

Comments
 (0)
0