diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2007-08-23 22:34:31 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2007-08-23 22:34:31 (GMT) |
commit | a953c6011f2fba7441758469118a886a33458e50 (patch) | |
tree | e03ef703b692e483ccfba632950dfdab547cfbdd /libdocument | |
parent | c2d5e8f188bcedd3752b829d3ebcfea78efc520d (diff) |
Use CAIRO_FORMAT_RGB24 instead of CAIRO_FORMAT_ARGB32 when creating page
2007-08-24 Carlos Garcia Campos <carlosgc@gnome.org>
* backend/djvu/djvu-document.c: (djvu_document_render):
* backend/tiff/tiff-document.c: (tiff_document_render):
* backend/pdf/ev-poppler.cc: (pdf_document_render):
* libdocument/ev-document-misc.c:
(ev_document_misc_surface_from_pixbuf),
(ev_document_misc_surface_rotate_and_scale):
Use CAIRO_FORMAT_RGB24 instead of CAIRO_FORMAT_ARGB32 when
creating page surfaces. Fixes bug #453123. Thank you very much to
Jeff Muizelaar <jeff@infidigm.net>.
svn path=/trunk/; revision=2637
Diffstat (limited to 'libdocument')
-rw-r--r-- | libdocument/ev-document-misc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c index 3dc4bab..3e85c7d 100644 --- a/libdocument/ev-document-misc.c +++ b/libdocument/ev-document-misc.c @@ -152,7 +152,7 @@ ev_document_misc_surface_from_pixbuf (GdkPixbuf *pixbuf) cairo_surface_t *surface; cairo_t *cr; - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf)); cr = cairo_create (surface); @@ -239,6 +239,8 @@ ev_document_misc_surface_rotate_and_scale (cairo_surface_t *surface, cairo_surface_t *new_surface; cairo_t *cr; gint width, height; + gboolean has_alpha; + cairo_format_t surface_format; gint new_width = dest_width; gint new_height = dest_height; @@ -256,8 +258,13 @@ ev_document_misc_surface_rotate_and_scale (cairo_surface_t *surface, new_height = dest_width; } + surface_format = cairo_image_surface_get_format (surface); + has_alpha = (surface_format == CAIRO_FORMAT_ARGB32); + new_surface = cairo_surface_create_similar (surface, - CAIRO_CONTENT_COLOR_ALPHA, + has_alpha ? + CAIRO_CONTENT_COLOR_ALPHA : + CAIRO_CONTENT_COLOR, new_width, new_height); cr = cairo_create (new_surface); |