[cairo-commit] 5 commits - Makefile.am src/cairo-path-stroke.c test/dash-curve.c test/dash-curve-ref.png test/.gitignore test/Makefile.am
Chris Wilson
ickle at kemper.freedesktop.org
Wed Jan 16 15:47:33 PST 2008
Makefile.am | 13 ++++++--
src/cairo-path-stroke.c | 4 +-
test/.gitignore | 1
test/Makefile.am | 18 +++++++++--
test/dash-curve-ref.png |binary
test/dash-curve.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 101 insertions(+), 9 deletions(-)
New commits:
commit 3f202c081d211d5ac6c28ce96cd0f57f8bb26aac
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Jan 16 23:42:24 2008 +0000
[Makefile.am] Another path massage for lcov.
Beware the inline functions in the headers that are now being pulled
into the boilerplate code.
diff --git a/Makefile.am b/Makefile.am
index c592e67..f112368 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,10 @@ lcov-perf:
# placing the objects files in the .libs/ directory separate from the *.c
genlcov:
$(LTP) --directory $(top_builddir) --path $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_TEST --no-checksum
- $(SED) -e 's#.libs/##' -e 's#$(shell pwd)#$(shell cd $(top_srcdir) && pwd)#' < cairo-lcov.info > cairo-lcov.info.tmp
+ $(SED) -e 's#.libs/##' \
+ -e 's#boilerplate/src#src#' \
+ -e 's#$(shell pwd)#$(shell cd $(top_srcdir) && pwd)#' \
+ < cairo-lcov.info > cairo-lcov.info.tmp
LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-lcov --title "Cairo Code Coverage" --show-details cairo-lcov.info.tmp
$(RM) cairo-lcov.info.tmp
else
commit 9ebfa8b5fb82596341b9ca0f19c362f24a7ff782
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Jan 16 20:35:41 2008 +0000
[Makefile.am] Couple check-ref-missing into release-check
Verify that all the reference images checked into git will be included
within the distribution tarball as early as possible in the release
process.
diff --git a/Makefile.am b/Makefile.am
index 1c21784..c592e67 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -149,6 +149,10 @@ release-verify-sane-changelogs: changelogs
&& false); else :; fi
@echo "Good."
+release-verify-sane-tests:
+ @echo "Checking that the TESTS are sane..."
+ @cd test && $(MAKE) $(AM_MAKEFLAGS) release-verify-sane-tests
+
release-verify-soname-major:
@echo -n "Checking that the cairo soname major number is 2..."
@test "$(LT_CURRENT_MINUS_AGE)" = "2" \
@@ -184,7 +188,7 @@ release-remove-old:
release-cleanup-group-sticky:
find . -type f | xargs chmod g-s
-release-check: release-verify-sane-changelogs release-verify-soname-major release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky distcheck
+release-check: release-verify-sane-changelogs release-verify-sane-tests release-verify-soname-major release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky distcheck
release-upload: release-check $(tar_file) $(sha1_file) $(gpg_file)
mkdir -p releases
diff --git a/test/Makefile.am b/test/Makefile.am
index 3c63ebc..b110c8d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -701,8 +701,16 @@ check-ref-dups:
# Not exactly the best script in the world...
check-ref-missing:
- @for i in *-ref.png; do\
- echo ${REFERENCE_IMAGES} | grep -sq $$i || echo $$i; \
- done
+ @missing=""; \
+ for i in `git ls-files *-ref.png`; do \
+ echo ${REFERENCE_IMAGES} | grep -sq $$i || missing="$$missing $$i" ; \
+ done ; \
+ if test -n "$$missing"; then \
+ echo "Some reference files are not included in the distribution." ;\
+ echo "Missing from REFERENCE_IMAGES:$$missing" ; \
+ exit 1; \
+ fi
+
+release-verify-sane-tests: check-ref-missing
-.PHONY: check-valgrind test recheck retest html rehtml check-ref-dups check-ref-missing
+.PHONY: check-valgrind test recheck retest html rehtml check-ref-dups check-ref-missing release-verify-sane-tests
commit f9a80c06b40634ffef00770731d3b433e465a1b9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Jan 16 23:28:27 2008 +0000
[cairo-path-stroke] Convert degenerate splines into lines.
This fixes a discrepancy in the stoker between splines and lines,
whereby the stroker failed to add a dash for a zero length spline.
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c
index 773e9fd..6464e3d 100644
--- a/src/cairo-path-stroke.c
+++ b/src/cairo-path-stroke.c
@@ -882,7 +882,7 @@ _cairo_stroker_curve_to (void *closure,
status = _cairo_spline_init (&spline, a, b, c, d);
if (status == CAIRO_INT_STATUS_DEGENERATE)
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_stroker_line_to (closure, d);
status = _cairo_pen_init_copy (&pen, &stroker->pen);
if (status)
@@ -966,7 +966,7 @@ _cairo_stroker_curve_to_dashed (void *closure,
status = _cairo_spline_init (&spline, a, b, c, d);
if (status == CAIRO_INT_STATUS_DEGENERATE)
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_stroker_line_to_dashed (closure, d);
/* If the line width is so small that the pen is reduced to a
single point, then we have nothing to do. */
commit 2621a323a0ccfe33ff42ed17536db0dc89473a9f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Jan 16 23:24:41 2008 +0000
[test/dash-curve] Add a new test case for dashes along splines.
Modify the dash-state test case and use curves instead of lines -
exercises _cairo_stroker_curve_to_dashed() and degenerate splines.
diff --git a/test/.gitignore b/test/.gitignore
index 5665cbe..2aaf613 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -32,6 +32,7 @@ create-for-stream.svg
create-from-png
create-from-png-stream
dash-caps-joins
+dash-curve
dash-no-dash
dash-offset-negative
dash-scale
diff --git a/test/Makefile.am b/test/Makefile.am
index 805ac16..3c63ebc 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -25,6 +25,7 @@ create-for-stream$(EXEEXT) \
create-from-png$(EXEEXT) \
create-from-png-stream$(EXEEXT) \
dash-caps-joins$(EXEEXT) \
+dash-curve$(EXEEXT) \
dash-no-dash$(EXEEXT) \
dash-offset-negative$(EXEEXT) \
dash-scale$(EXEEXT) \
@@ -265,6 +266,7 @@ REFERENCE_IMAGES = \
dash-caps-joins-ps-rgb24-ref.png \
dash-caps-joins-quartz-ref.png \
dash-caps-joins-ref.png \
+ dash-curve-ref.png \
dash-no-dash-ref.png \
dash-offset-negative-ref.png \
dash-scale-ps-argb32-ref.png \
diff --git a/test/dash-curve-ref.png b/test/dash-curve-ref.png
new file mode 100644
index 0000000..542b2d8
Binary files /dev/null and b/test/dash-curve-ref.png differ
diff --git a/test/dash-curve.c b/test/dash-curve.c
new file mode 100644
index 0000000..48f5c12
--- /dev/null
+++ b/test/dash-curve.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright © 2007 Jeff Smith
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Jeff Smith not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Jeff Smith makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * JEFF SMITH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL JEFF SMITH BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Jeff Smith <whydoubt at yahoo.com>
+ */
+
+#include "cairo-test.h"
+
+static cairo_test_draw_function_t draw;
+
+cairo_test_t test = {
+ "dash-curve",
+ "Tries to explore the state space of the dashing code along curves",
+ 25*60, 4*60,
+ draw
+};
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ double dashes[2] = {20, 20};
+ int a=0, b=0, c=0;
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_paint (cr);
+
+ for (a=0; a<4; a++)
+ for (b=0; b<5; b++)
+ for (c=0; c<5; c++) {
+ cairo_move_to (cr, ((b*5)+c)*60+10, a*60+10);
+ cairo_rel_curve_to (cr,
+ 0, b*10,
+ 0, b*10,
+ c*10, b*10);
+
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_set_line_width (cr, 8);
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_dash (cr, dashes, 2, a*10);
+ cairo_stroke_preserve (cr);
+
+ cairo_set_source_rgb (cr, 0, 0.5, 1);
+ cairo_set_line_width (cr, 2);
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
+ cairo_set_dash (cr, 0, 0, 0);
+ cairo_stroke (cr);
+ }
+ return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+ return cairo_test (&test);
+}
commit bb41fa22e3d3b1fe4b3e802ecf7d8041eacda3fd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Jan 16 23:21:53 2008 +0000
[Makefile.am] Further massage lcov paths for srcdir != builddir.
The lcov scripts generate incorrect absolute paths to the builddir for
source files - so convert them to srcdir using sed.
diff --git a/Makefile.am b/Makefile.am
index f1dbef0..1c21784 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,8 +35,8 @@ lcov-perf:
# we have to massage the lcov.info file slightly to hide the effect of libtool
# placing the objects files in the .libs/ directory separate from the *.c
genlcov:
- $(LTP) --directory $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_PERF --no-checksum
- $(SED) -e 's#.libs/##' < cairo-lcov.info > cairo-lcov.info.tmp
+ $(LTP) --directory $(top_builddir) --path $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_TEST --no-checksum
+ $(SED) -e 's#.libs/##' -e 's#$(shell pwd)#$(shell cd $(top_srcdir) && pwd)#' < cairo-lcov.info > cairo-lcov.info.tmp
LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-lcov --title "Cairo Code Coverage" --show-details cairo-lcov.info.tmp
$(RM) cairo-lcov.info.tmp
else
More information about the cairo-commit
mailing list