Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary clip from Cairo backend; squashed commit #1538

Merged
merged 1 commit into from Dec 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 1 addition & 10 deletions lib/matplotlib/backends/backend_cairo.py
Expand Up @@ -157,24 +157,15 @@ def draw_image(self, gc, x, y, im):
# bbox - not currently used
if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())

clippath, clippath_trans = gc.get_clip_path()

im.flipud_out()

rows, cols, buf = im.color_conv (BYTE_FORMAT)
surface = cairo.ImageSurface.create_for_data (
buf, cairo.FORMAT_ARGB32, cols, rows, cols*4)
# function does not pass a 'gc' so use renderer.ctx
ctx = self.gc.ctx
ctx.save()
if clippath is not None:
ctx.new_path()
RendererCairo.convert_path(ctx, clippath, clippath_trans)
ctx.clip()
ctx = gc.ctx
y = self.height - y - rows
ctx.set_source_surface (surface, x, y)
ctx.paint()
ctx.restore()

im.flipud_out()

Expand Down