And it helps if I attach the patch. Again. I think this means I shouldn't be submitting patches this late in the afternoon =)
Francis On Thu, 2006-09-14 at 16:46 -0400, Francis Kung wrote: > On Wed, 2006-09-13 at 13:04 -0400, Francis Kung wrote: > > Hi, > > > > The attached patch fixes gradients in cairo 1.2, but unfortunately it > > will break the build if compiled against cairo 1.0. > > Tom pointed out the CAIRO_VERSION macro which can be used at > compile-time, and the attached patch (committed) uses it to keep > gradients working with both cairo 1.0.x and cairo 1.2.x. > > Cheers, > Francis > > > 2006-09-14 Francis Kung <[EMAIL PROTECTED]> > > * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c > (gnu_java_awt_peer_gtk_CairoGraphics2D_setGradient): Updated constants > to > be compatible with Cairo 1.2.x. > > >
### Eclipse Workspace Patch 1.0 #P classpath 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.16 diff -u -r1.16 gnu_java_awt_peer_gtk_CairoGraphics2D.c --- native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c 14 Sep 2006 18:30:59 -0000 1.16 +++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c 14 Sep 2006 20:40:25 -0000 @@ -134,7 +134,11 @@ 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; + #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) + extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_PAD; + #else + extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_NONE; + #endif cairo_pattern_set_extend( pattern, extend );
