[cairo-commit] Branch '1.10' - 12 commits - configure.ac doc/public src/cairo.c src/cairo-debug.c src/cairo.h src/cairo-image-surface.c src/cairoint.h src/cairo-recording-surface.c src/cairo-xml-surface.c src/Makefile.sources test/linear-gradient-large.c test/nil-surface.c test/subsurface-outside-target.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Sep 24 03:25:39 PDT 2010


 configure.ac                     |    8 +++----
 doc/public/cairo-docs.xml        |    1 
 doc/public/cairo-sections.txt    |    7 ++++++
 src/Makefile.sources             |    7 +++---
 src/cairo-debug.c                |    2 +
 src/cairo-image-surface.c        |   42 +++++++++++++++++++++++++++++++--------
 src/cairo-recording-surface.c    |   30 ++++++++++++++++++++++-----
 src/cairo-xml-surface.c          |    2 -
 src/cairo.c                      |    2 -
 src/cairo.h                      |    2 -
 src/cairoint.h                   |    3 ++
 test/linear-gradient-large.c     |    1 
 test/nil-surface.c               |    3 +-
 test/subsurface-outside-target.c |    1 
 14 files changed, 86 insertions(+), 25 deletions(-)

New commits:
commit 75e2b7c7b52be6663fac05925b9b4cc5f3b42f9f
Author: Tim Janik <timj at gtk.org>
Date:   Thu Sep 23 13:55:11 2010 +0200

    cairo: docu fix for cairo_set_source_surface

diff --git a/src/cairo.c b/src/cairo.c
index dd0bdfa..157f898 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -989,7 +989,7 @@ cairo_set_source_rgba (cairo_t *cr,
  * The @x and @y parameters give the user-space coordinate at which
  * the surface origin should appear. (The surface origin is its
  * upper-left corner before any transformation has been applied.) The
- * @x and @y patterns are negated and then set as translation values
+ * @x and @y parameters are negated and then set as translation values
  * in the pattern matrix.
  *
  * Other than the initial translation pattern matrix, as described
commit 4cf5260e99e3e7588e45ee179c57b75588b95987
Author: Kouhei Sutou <kou at cozmixng.org>
Date:   Sun Sep 12 10:36:27 2010 +0900

    xml: fix a typo to correct the indentation after <path></path>
    
    Signed-off-by: Kouhei Sutou <kou at cozmixng.org>

diff --git a/src/cairo-xml-surface.c b/src/cairo-xml-surface.c
index 55b5b8e..b323d03 100644
--- a/src/cairo-xml-surface.c
+++ b/src/cairo-xml-surface.c
@@ -428,7 +428,7 @@ _cairo_xml_emit_path (cairo_xml_t *xml,
 					_cairo_xml_close_path,
 					xml);
     assert (status == CAIRO_STATUS_SUCCESS);
-    _cairo_xml_printf_start (xml, "</path>");
+    _cairo_xml_printf_end (xml, "</path>");
 }
 
 static void
commit 0f070bd5ff9ad17b90852e8a7ba102c6b4b050f6
Author: Tomáš Chvátal <scarabeus at gentoo.org>
Date:   Sat Sep 11 22:55:23 2010 +0200

    Fix posix calls in configure.ac test code.
    
    Fixes https://bugs.gentoo.org/show_bug.cgi?id=336779
    
    Signed-off-by: Tomáš Chvátal <scarabeus at gentoo.org>

diff --git a/configure.ac b/configure.ac
index 7dc4b13..2c14ae2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,7 +99,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(xcb, XCB, no, [
 ])
 
 CAIRO_ENABLE_FUNCTIONS(xlib_xcb, Xlib/XCB, no, [
-  if test "x$use_xcb" == "xyes" -a "x$use_xlib" == "xyes"; then
+  if test "x$use_xcb" = "xyes" -a "x$use_xlib" = "xyes"; then
     xlib_xcb_REQUIRES="x11-xcb"
     PKG_CHECK_MODULES(xlib_xcb, $xlib_xcb_REQUIRES, ,
 		      [use_xlib_xcb="no (requires $xlib_xcb_REQUIRES http://xcb.freedesktop.org)"])
@@ -110,7 +110,7 @@ CAIRO_ENABLE_FUNCTIONS(xlib_xcb, Xlib/XCB, no, [
 AM_CONDITIONAL(BUILD_XLIB_XCB, test "x$use_xlib_xcb" = "xyes")
 
 CAIRO_ENABLE_FUNCTIONS(xcb_shm, XCB/SHM, auto, [
-  if test "x$use_xcb" == "xyes"; then
+  if test "x$use_xcb" = "xyes"; then
       xcb_shm_REQUIRES="xcb-shm"
       PKG_CHECK_MODULES(xcb_shm, $xcb_shm_REQUIRES, ,
 			[AC_MSG_RESULT(no)
@@ -232,7 +232,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(drm, DRM, no, [
 ])
 
 CAIRO_ENABLE_FUNCTIONS(drm_xr, DRM Xr (DDX), no, [
-  if test "x$use_drm" == "xyes"; then
+  if test "x$use_drm" = "xyes"; then
       drm_xr_REQUIRES="xorg-server >= 1.6 xproto xextproto >= 7.0.99.1 renderproto x11"
       PKG_CHECK_MODULES(drm_xr, $drm_xr_REQUIRES, ,
 			[AC_MSG_RESULT(no)
@@ -262,7 +262,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(gallium, Gallium3D, no, [
 ])
 
 CAIRO_ENABLE_FUNCTIONS(xcb_drm, XCB/DRM, no, [
-  if test "x$use_xcb" == "xyes" -a "x$use_drm" == "xyes"; then
+  if test "x$use_xcb" = "xyes" -a "x$use_drm" = "xyes"; then
       xcb_drm_REQUIRES="xcb-dri2"
       PKG_CHECK_MODULES(xcb_drm, $xcb_drm_REQUIRES, ,
 			[AC_MSG_RESULT(no)
commit f59771051badc2ea708437c5faa27d0895f787d6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Aug 18 08:48:36 2010 +0100

    drm: Add missing header file for tarball

diff --git a/src/Makefile.sources b/src/Makefile.sources
index c645c02..b04d80f 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -337,12 +337,13 @@ cairo_drm_headers = cairo-drm.h
 cairo_drm_private = drm/cairo-drm-private.h \
 		    drm/cairo-drm-ioctl-private.h \
 		    drm/cairo-drm-intel-private.h \
-		    drm/cairo-drm-intel-ioctl-private.h \
-		    drm/cairo-drm-i915-private.h \
-		    drm/cairo-drm-i965-private.h \
 		    drm/cairo-drm-intel-brw-defines.h \
 		    drm/cairo-drm-intel-brw-structs.h \
 		    drm/cairo-drm-intel-brw-eu.h \
+		    drm/cairo-drm-intel-command-private.h \
+		    drm/cairo-drm-intel-ioctl-private.h \
+		    drm/cairo-drm-i915-private.h \
+		    drm/cairo-drm-i965-private.h \
 		    drm/cairo-drm-radeon-private.h
 cairo_drm_sources = drm/cairo-drm.c \
 		    drm/cairo-drm-bo.c \
commit 8fca990be7fca609e834703e60dd888c13fc637f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 10 13:35:11 2010 +0100

    cairo: Remove trailing comma from cairo_device_t
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30115
    Reported-by: Murray Cumming <murrayc at murrayc.com>

diff --git a/src/cairo.h b/src/cairo.h
index 913320f..136c5db 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -1973,7 +1973,7 @@ typedef enum _cairo_device_type {
     CAIRO_DEVICE_TYPE_SCRIPT,
     CAIRO_DEVICE_TYPE_XCB,
     CAIRO_DEVICE_TYPE_XLIB,
-    CAIRO_DEVICE_TYPE_XML,
+    CAIRO_DEVICE_TYPE_XML
 } cairo_device_type_t;
 
 cairo_public cairo_device_type_t
commit 291876ad3477330143bbb814ea72c658dc8ca584
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Sep 9 22:53:38 2010 +0200

    test: do not leak resources
    
    Silence some leak reports by check-valgrind.

diff --git a/test/subsurface-outside-target.c b/test/subsurface-outside-target.c
index fd51243..c60ca8a 100644
--- a/test/subsurface-outside-target.c
+++ b/test/subsurface-outside-target.c
@@ -75,6 +75,7 @@ check_surface_extents (const cairo_test_context_t *ctx,
 
     cr = cairo_create (surface);
     cairo_clip_extents (cr, &x1, &y1, &x2, &y2);
+    cairo_destroy (cr);
 
     if (x != x1 ||
         y != y1 ||
commit 8fda4ab1cc7f60196b232d194c33e592ecdec9b5
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Aug 26 11:15:46 2010 +0200

    image: add _cairo_image_reset_static_data
    
    Image has static caches which needs to be reset to make
    cairo_debug_reset_static_data behave as expected.
    Silences a bunch of leak reports by check-valgrind.
    
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-debug.c b/src/cairo-debug.c
index 712ce93..c956753 100644
--- a/src/cairo-debug.c
+++ b/src/cairo-debug.c
@@ -77,6 +77,8 @@ cairo_debug_reset_static_data (void)
 
     _cairo_clip_reset_static_data ();
 
+    _cairo_image_reset_static_data ();
+
 #if CAIRO_HAS_DRM_SURFACE
     _cairo_drm_device_reset_static_data ();
 #endif
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index f88ccb8..4d65ee6 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -876,10 +876,13 @@ _nearest_sample (cairo_filter_t filter, double *tx, double *ty)
 }
 
 #if HAS_ATOMIC_OPS
+static pixman_image_t *__pixman_transparent_image;
+static pixman_image_t *__pixman_black_image;
+static pixman_image_t *__pixman_white_image;
+
 static pixman_image_t *
 _pixman_transparent_image (void)
 {
-    static pixman_image_t *__pixman_transparent_image;
     pixman_image_t *image;
 
     image = __pixman_transparent_image;
@@ -910,7 +913,6 @@ _pixman_transparent_image (void)
 static pixman_image_t *
 _pixman_black_image (void)
 {
-    static pixman_image_t *__pixman_black_image;
     pixman_image_t *image;
 
     image = __pixman_black_image;
@@ -941,7 +943,6 @@ _pixman_black_image (void)
 static pixman_image_t *
 _pixman_white_image (void)
 {
-    static pixman_image_t *__pixman_white_image;
     pixman_image_t *image;
 
     image = __pixman_white_image;
@@ -995,14 +996,39 @@ hars_petruska_f54_1_random (void)
 #undef rol
 }
 
+static struct {
+    cairo_color_t color;
+    pixman_image_t *image;
+} cache[16];
+static int n_cached;
+
+void
+_cairo_image_reset_static_data ()
+{
+    while (n_cached)
+	pixman_image_unref (cache[--n_cached].image);
+
+#if HAS_ATOMIC_OPS
+    if (__pixman_transparent_image) {
+	pixman_image_unref (__pixman_transparent_image);
+	__pixman_transparent_image = NULL;
+    }
+
+    if (__pixman_black_image) {
+	pixman_image_unref (__pixman_black_image);
+	__pixman_black_image = NULL;
+    }
+
+    if (__pixman_white_image) {
+	pixman_image_unref (__pixman_white_image);
+	__pixman_white_image = NULL;
+    }
+#endif
+}
+
 static pixman_image_t *
 _pixman_image_for_solid (const cairo_solid_pattern_t *pattern)
 {
-    static struct {
-	cairo_color_t color;
-	pixman_image_t *image;
-    } cache[16];
-    static int n_cached;
     pixman_color_t color;
     pixman_image_t *image;
     int i;
diff --git a/src/cairoint.h b/src/cairoint.h
index fe2f7fc..500b2d9 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1906,6 +1906,9 @@ cairo_private cairo_bool_t
 _pixman_format_to_masks (pixman_format_code_t	 pixman_format,
 			 cairo_format_masks_t	*masks);
 
+cairo_private void
+_cairo_image_reset_static_data (void);
+
 cairo_private cairo_surface_t *
 _cairo_image_surface_create_with_pixman_format (unsigned char		*data,
 						pixman_format_code_t	 pixman_format,
commit ca775cbf5a7245092cabdda43db9d06e96613ff4
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Aug 26 11:13:51 2010 +0200

    test: do not leak resources
    
    Silence two leak reports by check-valgrind.
    
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/linear-gradient-large.c b/test/linear-gradient-large.c
index f5e6a66..5646aa4 100644
--- a/test/linear-gradient-large.c
+++ b/test/linear-gradient-large.c
@@ -51,6 +51,7 @@ draw (cairo_t *cr, int width, int height)
     cairo_pattern_add_color_stop_rgb (gr, 1.0, 1, 1, 1);
 
     cairo_set_source (cr, gr);
+    cairo_pattern_destroy (gr);
     cairo_paint (cr);
 
     mark_point(cr, SIZE - OFFSET, OFFSET);
diff --git a/test/nil-surface.c b/test/nil-surface.c
index 408bdba..30a1f97 100644
--- a/test/nil-surface.c
+++ b/test/nil-surface.c
@@ -154,7 +154,8 @@ draw (cairo_t *cr, int width, int height)
     /* Test that push_group doesn't crash */
     cairo_push_group (cr2);
     cairo_stroke (cr2);
-    cairo_pop_group (cr2);
+    pattern = cairo_pop_group (cr2);
+    cairo_pattern_destroy (pattern);
 
     cairo_destroy (cr2);
 
commit 2b6c4c2a64c585cb815089e83719e00b1cfc985f
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Thu Sep 9 11:28:03 2010 +0200

    recording: Document CAIRO_HAS_RECORDING_SURFACE macro

diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index 211d662..79d51e8 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -90,6 +90,16 @@ typedef enum {
 
 static const cairo_surface_backend_t cairo_recording_surface_backend;
 
+/**
+ * CAIRO_HAS_RECORDING_SURFACE:
+ *
+ * Defined if the recording surface backend is available.
+ * The recording surface backend is always built in.
+ * This macro was added for completeness in cairo 1.10.
+ *
+ * Since: 1.10
+ */
+
 /* Currently all recording surfaces do have a size which should be passed
  * in as the maximum size of any target surface against which the
  * recording-surface will ever be replayed.
commit d8f88cf3f97af6771a4d77bf81e1025eb7bcfd1d
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Thu Sep 9 11:00:42 2010 +0200

    recording: Fix cairo_recording_surface_create() doc comments
    
    The name of the parameters in the docs should match the name of the
    function parameters. Added also return value docs.

diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index f814ed0..211d662 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -102,8 +102,8 @@ static const cairo_surface_backend_t cairo_recording_surface_backend;
 /**
  * cairo_recording_surface_create:
  * @content: the content of the recording surface
- * @extents_pixels: the extents to record in pixels, can be %NULL to record
- *                  unbounded operations.
+ * @extents: the extents to record in pixels, can be %NULL to record
+ *           unbounded operations.
  *
  * Creates a recording-surface which can be used to record all drawing operations
  * at the highest level (that is, the level of paint, mask, stroke, fill
@@ -114,7 +114,11 @@ static const cairo_surface_backend_t cairo_recording_surface_backend;
  * necessary objects (paths, patterns, etc.), in order to achieve
  * accurate replay.
  *
- * Since 1.10
+ * Return value: a pointer to the newly created surface. The caller
+ * owns the surface and should call cairo_surface_destroy() when done
+ * with it.
+ *
+ * Since: 1.10
  **/
 cairo_surface_t *
 cairo_recording_surface_create (cairo_content_t		 content,
commit 737880260f1895667baf25bcc6814052e6a6a027
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Thu Sep 9 10:57:13 2010 +0200

    recording: Add section doc comments

diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index f7c501c..f814ed0 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -37,7 +37,13 @@
  *	Adrian Johnson <ajohnson at redneon.com>
  */
 
-/* A recording surface is a surface that records all drawing operations at
+/**
+ * SECTION:cairo-recording
+ * @Title: Recording Surfaces
+ * @Short_Description: Records all drawing operations
+ * @See_Also: #cairo_surface_t
+ *
+ * A recording surface is a surface that records all drawing operations at
  * the highest level of the surface backend interface, (that is, the
  * level of paint, mask, stroke, fill, and show_text_glyphs). The recording
  * surface can then be "replayed" against any target surface by using it
@@ -70,8 +76,6 @@
  * copy-on-write implementation for _cairo_surface_snapshot.
  */
 
-/* XXX Rename to recording surface */
-
 #include "cairoint.h"
 #include "cairo-analysis-surface-private.h"
 #include "cairo-clip-private.h"
commit 1ddc1bfa01e4c17001504c886bc5fb97625f5861
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Thu Sep 9 10:54:50 2010 +0200

    doc: Add section for recording surface

diff --git a/doc/public/cairo-docs.xml b/doc/public/cairo-docs.xml
index 2351f47..c2ffead 100644
--- a/doc/public/cairo-docs.xml
+++ b/doc/public/cairo-docs.xml
@@ -36,6 +36,7 @@
     <xi:include href="xml/cairo-pdf.xml"/>
     <xi:include href="xml/cairo-png.xml"/>
     <xi:include href="xml/cairo-ps.xml"/>
+    <xi:include href="xml/cairo-recording.xml"/>
     <xi:include href="xml/cairo-win32.xml"/>
     <!--xi:include href="xml/cairo-beos.xml"/-->
     <xi:include href="xml/cairo-svg.xml"/>
diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt
index 8757366..88debec 100644
--- a/doc/public/cairo-sections.txt
+++ b/doc/public/cairo-sections.txt
@@ -102,6 +102,13 @@ cairo_ps_surface_dsc_comment
 </SECTION>
 
 <SECTION>
+<FILE>cairo-recording</FILE>
+CAIRO_HAS_RECORDING_SURFACE
+cairo_recording_surface_create
+cairo_recording_surface_ink_extents
+</SECTION>
+
+<SECTION>
 <FILE>cairo-win32</FILE>
 CAIRO_HAS_WIN32_SURFACE
 cairo_win32_surface_create


More information about the cairo-commit mailing list