[cairo-commit] 3 commits - Makefile.am src/cairo-surface-fallback.c test/cairo-test.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Sep 15 08:48:40 PDT 2008


 Makefile.am                  |    6 +++++-
 src/cairo-surface-fallback.c |    6 ++++++
 test/cairo-test.c            |    2 --
 3 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 77b43da99f759fb970b90fd61eb3ace0f7224795
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Sep 15 15:52:27 2008 +0100

    [test] Fixup potential use of uninitialized test_image.
    
    In the churn of reordering the tests, some of the error paths were left
    unaltered - causing potential invalid dereferences.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 1049cdd..e4f250c 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -737,7 +737,6 @@ cairo_test_for_target (cairo_test_context_t		 *ctx,
 	    if (cairo_test_files_equal (test_filename, pass_filename)) {
 		/* identical output as last known PASS */
 		cairo_test_log (ctx, "Vector surface matches last pass.\n");
-		cairo_surface_destroy (test_image);
 		ret = CAIRO_TEST_SUCCESS;
 		goto UNWIND_CAIRO;
 	    }
@@ -745,7 +744,6 @@ cairo_test_for_target (cairo_test_context_t		 *ctx,
 		/* identical output as last known FAIL, fail */
 		cairo_test_log (ctx, "Vector surface matches last fail.\n");
 		have_result = TRUE; /* presume these were kept around as well */
-		cairo_surface_destroy (test_image);
 		ret = CAIRO_TEST_FAILURE;
 		goto UNWIND_CAIRO;
 	    }
commit 34f250643212146c964f7e1c30524a4d585af156
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Sep 15 15:41:36 2008 +0100

    [surface] Trivial rejection of fill/stroke if clip extents is zero
    
    Avoid tessellating the path if we know that the target extents is zero.
    Besides the rare occurrence when everything is clipped out, a zero-sized
    surface is often intended as a no-op surface for benchmarking.

diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index eb5a23c..427554b 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -821,6 +821,9 @@ _cairo_surface_fallback_stroke (cairo_surface_t		*surface,
     if (status)
         return status;
 
+    if (extents.width == 0 || extents.height == 0)
+	return CAIRO_STATUS_SUCCESS;
+
     box.p1.x = _cairo_fixed_from_int (extents.x);
     box.p1.y = _cairo_fixed_from_int (extents.y);
     box.p2.x = _cairo_fixed_from_int (extents.x + extents.width);
@@ -883,6 +886,9 @@ _cairo_surface_fallback_fill (cairo_surface_t		*surface,
     if (status)
         return status;
 
+    if (extents.width == 0 || extents.height == 0)
+	return CAIRO_STATUS_SUCCESS;
+
     box.p1.x = _cairo_fixed_from_int (extents.x);
     box.p1.y = _cairo_fixed_from_int (extents.y);
     box.p2.x = _cairo_fixed_from_int (extents.x + extents.width);
commit cac2ea0fcda2222f36ebd3414f91302dad691b85
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Sep 14 11:20:25 2008 +0100

    [Makefile] Disable doc/ if we don't have gtk-doc.
    
    make check dies in the documentation even if we have explicitly disabled
    gtk-doc - so only enter doc/ with gtk-doc enabled.

diff --git a/Makefile.am b/Makefile.am
index 48ac855..13c1862 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,11 @@ include $(top_srcdir)/build/Makefile.am.common
 ACLOCAL_AMFLAGS = -I build
 
 DIST_SUBDIRS = src boilerplate test perf doc util
-SUBDIRS = src doc
+SUBDIRS = src
+# gtk-doc is required for our documentation
+if ENABLE_GTK_DOC
+SUBDIRS += doc
+endif
 # libpng is required for our test programs
 if CAIRO_HAS_PNG_FUNCTIONS
 SUBDIRS += boilerplate test perf


More information about the cairo-commit mailing list