evince r2884 - in trunk: . backend/djvu backend/tiff



Author: carlosgc
Date: Thu Jan 31 11:23:08 2008
New Revision: 2884
URL: http://svn.gnome.org/viewvc/evince?rev=2884&view=rev

Log:
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.


Modified:
   trunk/ChangeLog
   trunk/backend/djvu/djvu-document.c
   trunk/backend/tiff/tiff-document.c
   trunk/configure.ac

Modified: trunk/backend/djvu/djvu-document.c
==============================================================================
--- trunk/backend/djvu/djvu-document.c	(original)
+++ trunk/backend/djvu/djvu-document.c	Thu Jan 31 11:23:08 2008
@@ -261,8 +261,11 @@
 	        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,

Modified: trunk/backend/tiff/tiff-document.c
==============================================================================
--- trunk/backend/tiff/tiff-document.c	(original)
+++ trunk/backend/tiff/tiff-document.c	Thu Jan 31 11:23:08 2008
@@ -246,11 +246,15 @@
 	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 */

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Jan 31 11:23:08 2008
@@ -66,6 +66,12 @@
 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]