Add -lz to CAIRO_LIBS when compiling the PDF backend.

Don't use compressBound, since it's only available in zlib 1.2 and newer.
This commit is contained in:
Kristian Høgsberg 2005-01-06 23:20:07 +00:00
parent f4a51d9154
commit a850136805
4 changed files with 26 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2005-01-07 Kristian Høgsberg <krh@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.
2005-01-07 Carl Worth <cworth@cworth.org>
* TODO: Add Owen's new equation to fix clipping:

View file

@ -121,10 +121,14 @@ if test "x$use_pdf" != "xyes"; then
AM_CONDITIONAL(CAIRO_HAS_PDF_SURFACE, false)
else
PDF_SURFACE_FEATURE=CAIRO_HAS_PDF_SURFACE
PDF_LIBS=-lz
AM_CONDITIONAL(CAIRO_HAS_PDF_SURFACE, true)
fi
CAIRO_LIBS="$CAIRO_LIBS $PDF_LIBS"
AC_SUBST(PDF_SURFACE_FEATURE)
AC_SUBST(PDF_LIBS)
dnl ===========================================================================

View file

@ -475,6 +475,12 @@ _cairo_pdf_surface_set_repeat (void *abstract_surface,
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 @@ emit_image_data (cairo_pdf_document_t *document,
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);

View file

@ -475,6 +475,12 @@ _cairo_pdf_surface_set_repeat (void *abstract_surface,
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 @@ emit_image_data (cairo_pdf_document_t *document,
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);