[cairo-commit] 5 commits - configure.ac src/cairo-gl-surface.c src/cairo-image-surface.c src/cairoint.h src/cairo-png.c src/cairo-surface.c

Benjamin Otte company at kemper.freedesktop.org
Mon Jan 25 13:17:30 PST 2010


 configure.ac              |   10 ++++++++--
 src/cairo-gl-surface.c    |    6 ++----
 src/cairo-image-surface.c |   10 ++--------
 src/cairo-png.c           |   16 ++++++----------
 src/cairo-surface.c       |    1 +
 src/cairoint.h            |    1 +
 6 files changed, 20 insertions(+), 24 deletions(-)

New commits:
commit 17ddb1598b3df374b6275d907441f34318b4257f
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jan 25 20:17:12 2010 +0100

    docs: appease make check

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 244a707..338f496 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -1277,8 +1277,8 @@ _cairo_gl_set_component_alpha_mask_operand (cairo_gl_context_t *ctx,
 }
 
 /**
- * implements component-alpha CAIRO_OPERATOR_SOURCE using two passes of
- * the simpler operations CAIRO_OPERATOR_DEST_OUT and CAIRO_OPERATOR_ADD.
+ * implements component-alpha %CAIRO_OPERATOR_SOURCE using two passes of
+ * the simpler operations %CAIRO_OPERATOR_DEST_OUT and %CAIRO_OPERATOR_ADD.
  *
  * From http://anholt.livejournal.com/32058.html:
  *
commit bac513a85dc8ef2915b2e60d034cf3dbc82a8e0c
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jan 25 20:05:56 2010 +0100

    build: Fix pthread detection
    
    THe pthread.h detection code didn't pass -lpthread or -pthread to Cairo.

diff --git a/configure.ac b/configure.ac
index b4f5aa7..97b0ecf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,10 +38,14 @@ AC_ARG_ENABLE(pthread,
 
 have_pthread=no
 if test "x$use_pthread" != "xno"; then
-  pthread_REQUIRES="pthread-stubs"
+  pthread_REQUIRES="pthread"
   PKG_CHECK_MODULES(pthread, $pthread_REQUIRES,
 		    [use_pthread=yes; have_pthread=yes],
-		    [AC_CHECK_HEADERS([pthread.h], [use_pthread=yes; have_pthread=yes], [use_pthread="no (requires $pthread_REQUIRES)"])])
+		    [AC_CHECK_HEADERS([pthread.h], [use_pthread=yes;
+                                                    pthread_CFLAGS="-pthread"
+                                                    pthread_LIBS="-pthread"
+                                                    have_pthread=yes
+                                                   ], [use_pthread="no (requires $pthread_REQUIRES)"])])
   if test "x$have_pthread" = "xyes"; then
     AC_DEFINE([CAIRO_HAS_PTHREAD], 1, [Define to 1 if we have pthread support])
   fi
@@ -50,6 +54,8 @@ AM_CONDITIONAL(HAVE_PTHREAD, test "x$have_pthread" = "xyes")
 if test "x$have_pthread" = xno -a "x$use_pthread" = xyes; then
   AC_MSG_ERROR([pthread requested but not found])
 fi
+CAIRO_CFLAGS="$CAIRO_CFLAGS $pthread_CFLAGS"
+CAIRO_LIBS="$CAIRO_LIBS $pthread_LIBS"
 
 dnl ===========================================================================
 
commit 582604f7b6b5b2ab6e681245bc7cde64d4995307
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jan 25 19:22:33 2010 +0100

    [png] Simplify coercion code
    
    Call _cairo_image_surface_coerce() unconditionally to ensure coercion to
    one of the standard formats happens even when it's a format we support.

diff --git a/src/cairo-png.c b/src/cairo-png.c
index f89e03f..ecb27d8 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -172,14 +172,11 @@ write_png (cairo_surface_t	*surface,
     /* Handle the various fallback formats (e.g. low bit-depth XServers)
      * by coercing them to a simpler format using pixman.
      */
-    if (image->format == CAIRO_FORMAT_INVALID) {
-	clone = _cairo_image_surface_coerce (image,
-					     _cairo_format_from_content (image->base.content));
-	status = clone->base.status;
-	if (unlikely (status))
-	    goto BAIL1;
-    } else
-	clone = image;
+    clone = _cairo_image_surface_coerce (image,
+                                         _cairo_format_from_content (image->base.content));
+    status = clone->base.status;
+    if (unlikely (status))
+        goto BAIL1;
 
     rows = _cairo_malloc_ab (clone->height, sizeof (png_byte*));
     if (unlikely (rows == NULL)) {
@@ -279,8 +276,7 @@ BAIL4:
 BAIL3:
     free (rows);
 BAIL2:
-    if (clone != image)
-	cairo_surface_destroy (&clone->base);
+    cairo_surface_destroy (&clone->base);
 BAIL1:
     _cairo_surface_release_source_image (surface, image, image_extra);
 
commit 002e02715cac9a285fd97e1bb6b068ceebfae3d8
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jan 25 19:42:54 2010 +0100

    Remove useless pixman version checks
    
    We require pixman >= 0.15.16 in configure.ac, so checks for older
    versions aren't required anymore.

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 220ec0f..244a707 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -245,10 +245,8 @@ _cairo_gl_get_image_format_and_type (pixman_format_code_t pixman_format,
     case PIXMAN_g1:
     case PIXMAN_yuy2:
     case PIXMAN_yv12:
-#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,15,16)
     case PIXMAN_x2r10g10b10:
     case PIXMAN_a2r10g10b10:
-#endif
     default:
 	return FALSE;
     }
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index a29191d..d4bff51 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -97,18 +97,12 @@ _cairo_format_from_pixman_format (pixman_format_code_t pixman_format)
     case PIXMAN_a1r1g1b1: case PIXMAN_a1b1g1r1: case PIXMAN_c4:
     case PIXMAN_g4:       case PIXMAN_g1:
     case PIXMAN_yuy2:     case PIXMAN_yv12:
-#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,11,9)
-    case PIXMAN_x2b10g10r10:
-    case PIXMAN_a2b10g10r10:
-#endif
-#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,14,1)
     case PIXMAN_b8g8r8x8:
     case PIXMAN_b8g8r8a8:
-#endif
-#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,15,16)
+    case PIXMAN_x2b10g10r10:
+    case PIXMAN_a2b10g10r10:
     case PIXMAN_x2r10g10b10:
     case PIXMAN_a2r10g10b10:
-#endif
     default:
 	return CAIRO_FORMAT_INVALID;
     }
commit 5a690ad4acb3687c45c201b3ce92cd3e41bf3b30
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Jan 15 13:44:04 2010 +0100

    Give cairo_surface_mark_dirty() the slim hidden treatment
    
    Fixes test suite failure

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index f4410f0..4ab25b6 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1037,6 +1037,7 @@ cairo_surface_mark_dirty (cairo_surface_t *surface)
 {
     cairo_surface_mark_dirty_rectangle (surface, 0, 0, -1, -1);
 }
+slim_hidden_def (cairo_surface_mark_dirty);
 
 /**
  * cairo_surface_mark_dirty_rectangle:
diff --git a/src/cairoint.h b/src/cairoint.h
index 9cd5cfa..16c9a44 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2722,6 +2722,7 @@ slim_hidden_proto (cairo_surface_get_font_options);
 slim_hidden_proto (cairo_surface_get_mime_data);
 slim_hidden_proto (cairo_surface_get_type);
 slim_hidden_proto (cairo_surface_has_show_text_glyphs);
+slim_hidden_proto (cairo_surface_mark_dirty);
 slim_hidden_proto (cairo_surface_mark_dirty_rectangle);
 slim_hidden_proto_no_warn (cairo_surface_reference);
 slim_hidden_proto (cairo_surface_set_device_offset);


More information about the cairo-commit mailing list