Red Hat Bugzilla – Bug 205645
Gradient doesn't fill entire area in Java2D demo
Last modified: 2007-11-30 17:11:42 EST
Description of problem:
It looks like the gradient is "running out" of colour in Sun's Java2D demo.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Get Java2Demo.jar
2. java -jar Java2Demo.jar
3. Go to the Arcs_Curves tab and observe the BezierAnim
When it is on gradient, you'll notice that it sometimes does not fill all the
way to the right of the moving bezier. See the attached screenshot.
I will attach another screenshot of some stacktraces that appear while running
Created attachment 135806 [details]
image illustrating the problem
Created attachment 135807 [details]
This problem only appears on Cairo 1.2, and seems to be related to cairo's
treatment of gradient control vectors.
Created attachment 136008 [details]
narrowing down the problem
classpath + cairo 1.0 acts the same way as the reference implementation (points
beyond the defined gradient vector are filled as opaque), but classpath + cairo
1.2 does not extend the fill beyond the gradient vector.
Created attachment 136025 [details]
This patch to GNU Classpath fixes the problem, but requires cairo 1.2; it will
break the build if compiled against cairo 1.0.
(In reply to comment #5)
> Created an attachment (id=136025) 
> This patch to GNU Classpath fixes the problem, but requires cairo 1.2; it will
> break the build if compiled against cairo 1.0.
Does Cairo provide compatibility defines?
#if CAIRO_VERSION >= CAIRO_1_2
extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_PAD;
extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_NONE;
Thanks, that was what I was looking for.
This has now been fixed upstream in GNU Classpath.