gdk_pixbuf_get_from_source: only reuse surfaces with matching format

Otherwise the conversion functions will return rubbish.

https://bugzilla.gnome.org/show_bug.cgi?id=707445
This commit is contained in:
Claudio Saavedra 2013-09-06 18:44:57 +03:00
parent fc7d26860a
commit 0735aa1c2e

View File

@ -248,7 +248,8 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
8,
width, height);
if (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE)
if (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE &&
cairo_image_surface_get_format (surface) == gdk_cairo_format_for_content (content))
surface = cairo_surface_reference (surface);
else
{