Repository navigation
Fix image plotting in Cairo backends - #6602
Merged
Merged
Conversation
Call cairo.ImageSurface.create_for_data with an array that both py2cairo and cairocffi knows how to get a pointer too and size of
Member
Author
|
More testing. Cairocffi works correctly with GTK3 if py2/3cairo is installed but not otherwise. This is probably just a concequense of the fact that gtk/pygobject is build against py2/3cairo so it can't function without. The gtk2 backend however breaks if Cairocffi is installed |
Member
Author
|
The issue with cairocffi and GKT2 is not new and can be reproduced on 1.5.x Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 438, in expose_event
self._render_figure(self._pixmap, w, h)
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 426, in _render_figure
self.figure.draw (self._renderer)
File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 62, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/figure.py", line 1159, in draw
func(*args)
File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 62, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2319, in draw
a.draw(renderer)
File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 62, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/image.py", line 394, in draw
renderer.draw_image(gc, l, b, im)
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_cairo.py", line 181, in draw_image
ctx.set_source_surface (surface, x, y)
TypeError: must be cairo.Surface, not ImageSurface |
Member
|
Can I close #6562 then? |
Member
|
@QuLogic Can you do the 2.x into master merge? |
Member
|
Neither commit message indicates it should be closed, so that did nothing. But I ask because there are some items unchecked here... |
Member
|
oh, yes, close this. We decided that those platforms are not a) already broken on 1.5 and b) old c) otherwise non-functional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP solution to #6562
Call cairo.ImageSurface.create_for_data with an array that both py2cairo and cairocffi knows how to get a pointer too and size of.
This seems to correctly resolve the issue for the
Cairobackend but not the GTK(3)Cairo backends.Current status