JDK-8096948 : Shape.setSmooth() can leak setting to any following Region nodes
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u40
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-12-06
  • Updated: 2015-06-12
  • Resolved: 2014-12-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u40Fixed
Related Reports
Relates :  
Description
The attached test case shows that if you render a shape node with a non-AA value for setSmooth(), that setting will be used to render any subsequent Region objects until another shape object is encountered with a different AA setting.

This is a regression caused by the recent support added to honor the setSmooth() flag in the rendering pipeline.
Comments
Fixed in the 8u-dev repo with the following changeset: changeset: 8470:efa9e7b1f887 date: Sun Dec 07 02:59:21 2014 -0800 summary: Fix RT-39602: Shape.setSmooth() can leak setting to any following nodes (like Region) http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/efa9e7b1f887
07-12-2014

It looks good and I agree with Jim's assessment of the 2 fixes are good fix.
06-12-2014

The fix for this bug looks good, and should go into 8u40. I agree that we should keep the fix for RT-39590 for consistency. +1
06-12-2014

Note that this fix also fixes RT-39590 independently. We could potentially back out the fix for RT-39590 and use this fix instead, but I think both fixes make sense, each for their own reasons.
06-12-2014

Here is the fix to follow the standard pattern for saving/restoring state in the Graphics object: http://cr.openjdk.java.net/~flar/RT-39602/webrev.00/
06-12-2014

Some notes on the test case. It has 4 quadrants. In each quadrant there is a node paired with a Rectangle that has its setSmooth set as indicated. The node immediately to the right of that Rectangle will be inheriting the AA flag from it. The top row have Rectangle objects with setSmooth(true). The bottom row have Rectangle objects with setSmooth(false). The rectangles are labeled for testing (with a Text object that *follows* the test node in the hierarchy so that there are no nodes between the Rectangle and the test node). The left half is Rectangles paired with Region objects with a rounded border. The Regions should all have AA borders, but may not if they inherit the flag. The right half is Rectangles paired with Canvas objects containing an oval. The Canvas objects render with their own graphics so they don't show this inheritance bug, but I included them for testing purposes.
06-12-2014