[cairo-commit] cairo/src cairo_pdf_surface.c,1.2,1.3

Kristian Hogsberg commit at pdx.freedesktop.org
Thu Jan 6 23:20:09 PST 2005


Committed by: krh

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv16506/src

Modified Files:
	cairo_pdf_surface.c 
Log Message:
2005-01-07  Kristian Høgsberg  <krh at redhat.com>

        * configure.in: Add -lz to CAIRO_LIBS when compiling the PDF
        backend.

        * src/cairo_pdf_surface.c (emit_image_data): Don't use
        compressBound, since it's only available in zlib 1.2 and newer.



Index: cairo_pdf_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_pdf_surface.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo_pdf_surface.c	6 Jan 2005 01:46:31 -0000	1.2
+++ cairo_pdf_surface.c	7 Jan 2005 07:20:07 -0000	1.3
@@ -475,6 +475,12 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
+static unsigned long
+compress_bound (unsigned long source_size)
+{
+    return source_size + (source_size >> 12) + (source_size >> 14) + 11;
+}
+
 static unsigned int
 emit_image_data (cairo_pdf_document_t *document,
 		 cairo_image_surface_t *image)
@@ -492,7 +498,7 @@
     if (rgb == NULL)
 	return 0;
 
-    compressed_size = compressBound (rgb_size);
+    compressed_size = compress_bound (rgb_size);
     compressed = malloc (compressed_size);
     if (rgb == NULL) {
 	free (rgb);




More information about the cairo-commit mailing list