[cairo-commit] 2 commits - configure.in Makefile.am src/cairo-image-surface.c src/cairo-pattern.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 7 06:08:24 PDT 2008


 Makefile.am               |    2 ++
 configure.in              |   16 +++++++---------
 src/cairo-image-surface.c |   18 ++++++++++++++----
 src/cairo-pattern.c       |    9 +++++++--
 4 files changed, 30 insertions(+), 15 deletions(-)

New commits:
commit afdf3917ee86a7d8ae17f556db96478682674a76
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Aug 6 09:19:02 2008 +0100

    [configure.in] Slight massage for recent Ubuntu autotools.
    
    Fix up a couple of minor complaints about possibly undefined macros,
    cached conditional values and suggested improvements.

diff --git a/Makefile.am b/Makefile.am
index 0458998..936d649 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,8 @@ if CAIRO_HAS_PNG_FUNCTIONS
 SUBDIRS += boilerplate test perf
 endif
 
+ACLOCAL_AMFLAGS=-I m4
+
 
 .PHONY: doc test retest recheck check-valgrind
 # We have some generated header files, so we really need to build the
diff --git a/configure.in b/configure.in
index 3e6a00e..68a9d65 100644
--- a/configure.in
+++ b/configure.in
@@ -14,6 +14,7 @@ AC_INIT([cairo],
       [http://bugs.freedesktop.org/enter_bug.cgi?product=cairo])
 AC_CONFIG_SRCDIR(src/cairo.h)
 AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_MACRO_DIR([m4])
 
 dnl automake 1.8 requires autoconf 2.58
 dnl automake 1.7 requires autoconf 2.54
@@ -26,23 +27,23 @@ dnl ===========================================================================
 # libtool shared library version
 
 # Increment if the interface has additions, changes, removals.
-LT_CURRENT=20
+m4_define(LT_CURRENT, 20)
 
 # Increment any time the source changes; set to
 # 0 if you increment CURRENT
-LT_REVISION=0
+m4_define(LT_REVISION, 0)
 
 # Increment if any interfaces have been added; set to 0
 # if any interfaces have been removed. removal has
 # precedence over adding, so set to 0 if both happened.
-LT_AGE=18
+m4_define(LT_AGE, 18)
 
 dnl ===========================================================================
 
-VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
+VERSION_INFO=LT_CURRENT():LT_REVISION():LT_AGE()
 AC_SUBST(VERSION_INFO)
 
-LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
+LT_CURRENT_MINUS_AGE=m4_eval(LT_CURRENT() - LT_AGE())
 AC_SUBST(LT_CURRENT_MINUS_AGE)
 
 CAIRO_VERSION_MAJOR=cairo_version_major()
@@ -61,6 +62,7 @@ dnl ===========================================================================
 
 AC_PROG_CC
 AC_PROG_CPP
+AC_PROG_CXX dnl required for BeOS (and cannot be a conditional dependency)
 AC_LIBTOOL_WIN32_DLL
 AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE!
 AC_STDC_HEADERS
@@ -459,10 +461,6 @@ CAIRO_BACKEND_ENABLE(beos, BeOS/Zeta, beos, BEOS_SURFACE, no, [
   esac
 ])
 
-if test "x$use_beos" = "xyes"; then
-  AC_PROG_CXX
-fi
-
 dnl ===========================================================================
 
 CAIRO_BACKEND_ENABLE(png, PNG, png, PNG_FUNCTIONS, yes, [
commit 7c1078b830ac7b88a56dd2afa5dc48234e3b6e84
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Aug 6 09:23:18 2008 +0100

    Check return from pixman_image_set_filter().
    
    Adding warn_unused_result to pixman detected a couple of instances where
    we abused the knowledge that the code currently can not fail, but in
    deference to its independent existence we should be more cautious.

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index d25cb96..806a76f 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -792,8 +792,9 @@ _cairo_image_surface_set_matrix (cairo_image_surface_t	*surface,
     return CAIRO_STATUS_SUCCESS;
 }
 
-static void
-_cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
+static cairo_status_t
+_cairo_image_surface_set_filter (cairo_image_surface_t *surface,
+				 cairo_filter_t filter)
 {
     pixman_filter_t pixman_filter;
 
@@ -823,7 +824,14 @@ _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t
 	pixman_filter = PIXMAN_FILTER_BEST;
     }
 
-    pixman_image_set_filter (surface->pixman_image, pixman_filter, NULL, 0);
+    if (! pixman_image_set_filter (surface->pixman_image,
+				   pixman_filter,
+				   NULL, 0))
+    {
+	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    }
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static cairo_status_t
@@ -851,7 +859,9 @@ _cairo_image_surface_set_attributes (cairo_image_surface_t      *surface,
 	break;
     }
 
-    _cairo_image_surface_set_filter (surface, attributes->filter);
+    status = _cairo_image_surface_set_filter (surface, attributes->filter);
+    if (status)
+	return status;
 
     return CAIRO_STATUS_SUCCESS;
 }
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index e861d88..0c84a8e 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1318,6 +1318,13 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
 	}
     }
 
+    if (! pixman_image_set_filter (pixman_image, PIXMAN_FILTER_BILINEAR,
+				   NULL, 0))
+    {
+	pixman_image_unref (pixman_image);
+	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    }
+
     image = (cairo_image_surface_t *)
 	cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
     if (image->base.status) {
@@ -1325,8 +1332,6 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
 	return image->base.status;
     }
 
-    pixman_image_set_filter (pixman_image, PIXMAN_FILTER_BILINEAR, NULL, 0);
-
     _cairo_matrix_to_pixman_matrix (&pattern->base.matrix, &pixman_transform);
     if (!pixman_image_set_transform (pixman_image, &pixman_transform)) {
 	cairo_surface_destroy (&image->base);


More information about the cairo-commit mailing list