JDK-6613860 : D3D/OGL: accelerated pipelines incorrectly deal with mutable Color subclasses
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u5
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-10-06
  • Updated: 2011-03-30
  • Resolved: 2007-10-23
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.
6u10 b06Fixed
The new accelerated pipelines (OGL, D3D) don't handle well subclasses
of Color which change its rgb over time (see attached test case).

The Nimbus L&F uses mutable colors for color theming, and
this might cause artifacts.

SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/6u5/6613860.0

EVALUATION While Color subclasses are supposed to be immutable unfortunately the API allows for subclassing (and in fact there's a jdk class SystemClass which does change the rgb with device palette changes). We can at least handle the case where the rgb changes from one Graphics instance to another. In BufferedContext.validate() we should improve the check for whether we should update the color in the native context. Currently we just check if the instance of the Paint object is changed.