JDK-6602861 : D3D: Nimbus L&F: Painting broken on some D3D cards
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u5
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2007-09-10
  • Updated: 2011-02-16
  • Resolved: 2007-09-18
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 b04Fixed
Related Reports
Relates :  
Relates :  
Due to the order of some painting operations in the abstract Painter base class, rendering doesn't occur on some video cards when using direct3d.

EVALUATION Note that the fix for this bug is really only a work around. The remaining issues will be tracked under a different bug id: 6603000: D3D: incorrect texel to pixel mapping in some cases

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

EVALUATION Another problem exposed by the Nimbus L&F in the Direct3D pipeline is the way we map texels to pixels. The naive way was to subtract .5 from the geometry (as suggested in the D3D SDK articles). However, this approach is only valid for pretransformed geometry. Nimbus L&F does a lot of large factor scaling, so the problem with the above approach was apparent: with large scale -0.5 would totally screw up the geometry after the transform is applied. An alternate approach is to apply the texture transform: shift the texture coordinates by +0.5 texel to achieve the same effect. But in order to do this correctly we must take the scale (and possibly others) factors from the device transform. This works ok for scales, but unfortunately not for generic transforms. More investigation is needed for the generic case. This manifests in rendering vertical scrollbars in Nimbus L&F: part of it is a scaled and rotated VI. On some boards the bottom line of pixels doesn't get rendered which may have been caused by the incompleteness of the approach. For now we will put a partial fix which makes Nimbus work fine on most boards and will work on the full fix. Also, this fix doesn't address some texture bleeding on nVidia FX 5xxxx series - most likely caused by scaling with bilinear filtering from non-pow2 textures.

EVALUATION In AbstractRegionPainter we configure the graphics (and in this call set antialiasing to true) and then clear the buffer. This exposes a bug on many video cards, causing the VolatileImage to punt and not render. We need to reverse this logic, such that we clear the buffer and then configure the graphics context.