[cairo-commit] 3 commits - pixman/src ROADMAP test/linear-gradient-reflect.c test/linear-gradient-reflect-ref.png test/Makefile.am

Carl Worth cworth at kemper.freedesktop.org
Fri Feb 2 16:43:06 PST 2007


 ROADMAP                              |    1 
 pixman/src/fbcompose.c               |    6 +-
 test/Makefile.am                     |    2 
 test/linear-gradient-reflect-ref.png |binary
 test/linear-gradient-reflect.c       |   74 +++++++++++++++++++++++++++++++++++
 5 files changed, 81 insertions(+), 2 deletions(-)

New commits:
diff-tree ae4f37e0a32c3e231c38434846e80fd90162d888 (from 0b7ba5ccfa21265c1b36919ff08bd3a1f0d1075b)
Author: David Turner <digit at mounini.par.corp.google.com>
Date:   Fri Feb 2 10:30:24 2007 +0100

    fixing gradient repeat mode computations
    
    This fixes the regression of linear gradient as demonstrated
    by the recently added linear-gradient-reflect test.

diff --git a/pixman/src/fbcompose.c b/pixman/src/fbcompose.c
index d698eb4..7d7ac00 100644
--- a/pixman/src/fbcompose.c
+++ b/pixman/src/fbcompose.c
@@ -2852,13 +2852,15 @@ _gradient_walker_reset (GradientWalker  
 	    pixman_color_t  *tmp_c;
 	    int32_t          tmp_x;
 
-	    tmp_x   = 0x20000 - right_x;
-	    right_x = 0x20000 - left_x;
+	    tmp_x   = 0x10000 - right_x;
+	    right_x = 0x10000 - left_x;
 	    left_x  = tmp_x;
 
 	    tmp_c   = right_c;
 	    right_c = left_c;
 	    left_c  = tmp_c;
+
+            x = 0x10000 - x;
 	}
 	left_x  += (pos - x);
 	right_x += (pos - x);
diff-tree 0b7ba5ccfa21265c1b36919ff08bd3a1f0d1075b (from 1757b49ebda3ec464a442d8c4f5ba39c88c1e3e5)
Author: T Rowley <tor at cs.brown.edu>
Date:   Fri Feb 2 16:36:12 2007 -0800

    Add linear-gradient-reflect test case
    
    This testcase works before the
    e9bef30d2bcdf41c7b7f20b3517839c37e752f75 landing, and has visual
    artifacts afterwards.

diff --git a/test/Makefile.am b/test/Makefile.am
index 8d31419..c5a7559 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -53,6 +53,7 @@ leaky-polygon			\
 line-width			\
 line-width-scale		\
 linear-gradient			\
+linear-gradient-reflect		\
 long-lines			\
 mask				\
 mask-ctm			\
@@ -251,6 +252,7 @@ leaky-dash-ref.png					\
 leaky-polygon-ref.png					\
 linear-gradient-ref.png					\
 linear-gradient-svg-ref.png				\
+linear-gradient-reflect-ref.png				\
 line-width-ref.png					\
 line-width-scale-ref.png				\
 line-width-scale-ps-argb32-ref.png			\
diff --git a/test/linear-gradient-reflect-ref.png b/test/linear-gradient-reflect-ref.png
new file mode 100644
index 0000000..e4f9db8
Binary files /dev/null and b/test/linear-gradient-reflect-ref.png differ
diff --git a/test/linear-gradient-reflect.c b/test/linear-gradient-reflect.c
new file mode 100644
index 0000000..779ccd8
--- /dev/null
+++ b/test/linear-gradient-reflect.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright © 2007 Tim Rowley
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Author: Tim Rowley
+ */
+
+#include "cairo-test.h"
+#include "stdio.h"
+
+#define WIDTH  50
+#define HEIGHT 50
+
+static cairo_test_draw_function_t draw;
+
+cairo_test_t test = {
+    "linear-gradient-reflect",
+    "Tests the drawing of linear gradient with reflect",
+    WIDTH, HEIGHT,
+    draw
+};
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+    cairo_pattern_t *pattern;
+
+    cairo_set_source_rgb (cr, 0.5, 0.5, 0.5);
+    cairo_paint (cr);
+
+    cairo_save (cr);
+
+    pattern = cairo_pattern_create_linear (0, 0, 10.0, 0);
+
+    cairo_pattern_add_color_stop_rgb (pattern, 0.0,
+				      0.0, 0.0, 1.0);
+    cairo_pattern_add_color_stop_rgb (pattern, 1.0,
+				      1.0, 0.0, 0.0);
+    cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REFLECT);
+
+    cairo_set_source (cr, pattern);
+    cairo_pattern_destroy (pattern);
+    cairo_rectangle (cr, 0.0, 0.0, WIDTH, HEIGHT);
+    cairo_fill (cr);
+
+    cairo_restore (cr);
+
+    return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+    return cairo_test (&test);
+}
diff-tree 1757b49ebda3ec464a442d8c4f5ba39c88c1e3e5 (from c621201a41639be8ba9ee735c2859aa117ba4216)
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Feb 1 16:17:29 2007 -0800

    ROADMAP: Add bug about broken cairo_show_text on win32

diff --git a/ROADMAP b/ROADMAP
index f2ce1bd..6b7fe60 100644
--- a/ROADMAP
+++ b/ROADMAP
@@ -42,6 +42,7 @@ cairo 1.3.14
  ✓ "issue with rotated image sources" from Benjamin Otte on mailing list
    "Problem with linear gradients and reflect mode post-rewrite" from T Rowley on list
    8801 text rendering lacking locking in multithreaded apps
+   cairo_show_text has incorrect spacing on win32
 
 cairo 1.3.6
 ===========


More information about the cairo-commit mailing list