]> www.fi.muni.cz Git - evince.git/commitdiff
Use the new cairo function cairo_format_stride_for_width when available.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Thu, 31 Jan 2008 11:23:08 +0000 (11:23 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Thu, 31 Jan 2008 11:23:08 +0000 (11:23 +0000)
2008-01-31  Carlos Garcia Campos  <carlosgc@gnome.org>
* configure.ac:
* backend/djvu/djvu-document.c: (djvu_document_render):
* backend/tiff/tiff-document.c: (tiff_document_render):
Use the new cairo function cairo_format_stride_for_width when
available. Fixes bug #482720.

svn path=/trunk/; revision=2884

ChangeLog
backend/djvu/djvu-document.c
backend/tiff/tiff-document.c
configure.ac

index 7cd5683b638b819ff2b44ace200a3f0527031301..9869dd42b0eb9c9f35d039d3bd651990138f24c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-01-31  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * configure.ac:
+       * backend/djvu/djvu-document.c: (djvu_document_render):
+       * backend/tiff/tiff-document.c: (tiff_document_render):
+
+       Use the new cairo function cairo_format_stride_for_width when
+       available. Fixes bug #482720.
+
 2008-01-31  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * libdocument/ev-document-factory.c: (get_mime_type_from_uri),
index f27d66f4bdbd0e60c73e1bcd97076fadc9c83859..6e1c5f3c378287d4eb9524acb4d6a9643f0e9c16 100644 (file)
@@ -261,8 +261,11 @@ djvu_document_render (EvDocument      *document,
                default:
                        rotation = DDJVU_ROTATE_0;
        }
-
+#ifdef HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH
+       rowstride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, page_width);
+#else
        rowstride = page_width * 4;
+#endif
        pixels = (gchar *) g_malloc (page_height * rowstride);
        surface = cairo_image_surface_create_for_data ((guchar *)pixels,
                                                       CAIRO_FORMAT_RGB24,
index d8bee9e529c0654d105011669dee450f59cf64c9..86170e270b7f290d728cf9ba237086d52977ca8f 100644 (file)
@@ -246,11 +246,15 @@ tiff_document_render (EvDocument      *document,
        if (width <= 0 || height <= 0)
                return NULL;                
 
+#ifdef HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH
+       rowstride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width);
+#else
        rowstride = width * 4;
        if (rowstride / 4 != width)
                /* overflow */
                return NULL;                
-        
+#endif
+       
        bytes = height * rowstride;
        if (bytes / rowstride != height)
                /* overflow */
index e2c9065b9792671f22034906b8d63c1735d44f80..3ba95e4bcfafddbb9354f5cd10af8103d93dff02 100644 (file)
@@ -66,6 +66,12 @@ PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_RE
 BACKEND_LIBTOOL_FLAGS="-module -avoid-version"
 AC_SUBST(BACKEND_LIBTOOL_FLAGS)
 
+dnl ===== Check special functions
+evince_save_LIBS=$LIBS
+LIBS="$LIBS $BACKEND_LIBS"
+AC_CHECK_FUNCS(cairo_format_stride_for_width)
+LIBS=$evince_save_LIBS
+
 AC_ARG_WITH(keyring,
         AC_HELP_STRING([--without-keyring],[disable the use of gnome-keyring]),
        [case "${withval}" in