]> www.fi.muni.cz Git - evince.git/commitdiff
Use CAIRO_FORMAT_RGB24 instead of CAIRO_FORMAT_ARGB32 when creating page
authorCarlos Garcia Campos <carlosgc@gnome.org>
Thu, 23 Aug 2007 22:34:31 +0000 (22:34 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Thu, 23 Aug 2007 22:34:31 +0000 (22:34 +0000)
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

ChangeLog
backend/djvu/djvu-document.c
backend/pdf/ev-poppler.cc
backend/tiff/tiff-document.c
libdocument/ev-document-misc.c

index b860ab53d92fe7767fe11d4a6a21093a098da8d0..789cb0e0b6c3576f03ffc4e7a64be547521929d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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>.
+       
 2007-08-17  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-page-cache.c: (ev_page_cache_new),
index 046228dcfdab3062f5c51c50aa4b494a9d1e6efa..4a7aecc0b1d5f23760dbdc136d86d2c5137893db 100644 (file)
@@ -260,7 +260,7 @@ djvu_document_render (EvDocument      *document,
        rowstride = page_width * 4;
        pixels = (gchar *) g_malloc (page_height * rowstride);
        surface = cairo_image_surface_create_for_data (pixels,
-                                                      CAIRO_FORMAT_ARGB32,
+                                                      CAIRO_FORMAT_RGB24,
                                                       page_width,
                                                       page_height,
                                                       rowstride);
index 38a01fd49679f8fe81d2383a82347fb38133dbd7..8af07fd4fdb8f3a4a63c8850a7f74323334ecffd 100644 (file)
@@ -500,7 +500,7 @@ pdf_document_render (EvDocument      *document,
 #ifdef HAVE_POPPLER_PAGE_RENDER
        cairo_t *cr;
        
-       surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+       surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
                                              width, height);
        memset (cairo_image_surface_get_data (surface), 0xff,
                cairo_image_surface_get_height (surface) *
index 59748d721a276fc05c8370a7bbf61138b6e479d6..c6f4db2b76bde686c78d463af0bfb55b35de7047 100644 (file)
@@ -259,7 +259,7 @@ tiff_document_render (EvDocument      *document,
                return NULL;
        
        surface = cairo_image_surface_create_for_data (pixels,
-                                                      CAIRO_FORMAT_ARGB32,
+                                                      CAIRO_FORMAT_RGB24,
                                                       width, height,
                                                       rowstride);
        cairo_surface_set_user_data (surface, &key,
index 3dc4babef53a14198acedf20422c1586f5f4a4ba..3e85c7dd2c7ce6099bd4e942ab1ce0c593a1c9c7 100644 (file)
@@ -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);