Hi,

The attached patch fixes gradients in cairo 1.2, but unfortunately it
will break the build if compiled against cairo 1.0.

Basically, cairo renamed one of their constants in the new version; the
CAIRO_EXTEND_NONE constant in 1.0 becomes CAIRO_EXTEND_PAD in 1.2, while
CAIRO_EXTEND_NONE in 1.2 has a completely new behaviour.

So, the options as I see it...

1) change the Classpath dependencies to require cairo 1.2, and hold the
patch until then; or

2) do some configure/makefile and C preprocessor magickery to use the
correct constant depending on what they have on their system (but I have
no idea how to do this ;-)  )

Cheers,
Francis

Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c,v
retrieving revision 1.14
diff -u -r1.14 gnu_java_awt_peer_gtk_CairoGraphics2D.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c	6 Aug 2006 21:00:54 -0000	1.14
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c	11 Sep 2006 15:51:19 -0000
@@ -134,7 +134,7 @@
   cairo_pattern_add_color_stop_rgba(pattern, 1.0, r2 / 255.0, g2 / 255.0, 
 				    b2 / 255.0, a2 / 255.0);
 
-  extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_NONE;
+  extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_PAD;
 
   cairo_pattern_set_extend( pattern, extend );
 

Reply via email to