Explain counterintuitive gdk pixbuf conversion

This commit is contained in:
Benedikt Heine 2017-09-18 19:14:44 +02:00
parent a6dea0cc35
commit d7ec8bf165

View File

@ -301,6 +301,13 @@ static cairo_status_t read_from_buf(void *closure, unsigned char *data, unsigned
static cairo_surface_t *gdk_pixbuf_to_cairo_surface(GdkPixbuf *pixbuf) static cairo_surface_t *gdk_pixbuf_to_cairo_surface(GdkPixbuf *pixbuf)
{ {
/*
* Export the gdk pixbuf into buffer as a png and import the png buffer
* via cairo again as a cairo_surface_t.
* It looks counterintuitive, as there is gdk_cairo_set_source_pixbuf,
* which does the job faster. But this would require gtk3 as a dependency
* for a single function call. See discussion in #334 and #376.
*/
cairo_surface_t *icon_surface = NULL; cairo_surface_t *icon_surface = NULL;
GByteArray *buffer; GByteArray *buffer;
char *bufstr; char *bufstr;