Bug 205645

Summary: Gradient doesn't fill entire area in Java2D demo
Product: [Fedora] Fedora Reporter: Andrew Overholt <overholt>
Component: gccAssignee: Francis Kung <francis.kung>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: fitzsim
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-09-14 20:49:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
image illustrating the problem
none
stack trace
none
narrowing down the problem
none
fix none

Description Andrew Overholt 2006-09-07 19:59:01 UTC
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):
libgcj-4.1.1-20

How reproducible:
Always

Steps to Reproduce:
1. Get Java2Demo.jar
2. java -jar Java2Demo.jar
3. Go to the Arcs_Curves tab and observe the BezierAnim
  
Actual results:
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.

Additional info:
I will attach another screenshot of some stacktraces that appear while running
the demo.

Comment 1 Andrew Overholt 2006-09-07 19:59:01 UTC
Created attachment 135806 [details]
image illustrating the problem

Comment 2 Andrew Overholt 2006-09-07 19:59:46 UTC
Created attachment 135807 [details]
stack trace

Comment 3 Francis Kung 2006-09-11 15:16:39 UTC
This problem only appears on Cairo 1.2, and seems to be related to cairo's
treatment of gradient control vectors.

Comment 4 Francis Kung 2006-09-11 15:19:12 UTC
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.

Comment 5 Francis Kung 2006-09-11 17:53:42 UTC
Created attachment 136025 [details]
fix

This patch to GNU Classpath fixes the problem, but requires cairo 1.2; it will
break the build if compiled against cairo 1.0.

Comment 6 Thomas Fitzsimmons 2006-09-14 19:04:40 UTC
(In reply to comment #5)
> Created an attachment (id=136025) [edit]
> fix
> 
> 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?

I'm thinking:

#if CAIRO_VERSION >= CAIRO_1_2
extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_PAD;
#else
extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_NONE;
#endif


Comment 7 Francis Kung 2006-09-14 20:49:07 UTC
Thanks, that was what I was looking for.

This has now been fixed upstream in GNU Classpath.