JDK-6667607 : D3D/OGL: NPE is thrown when running PerspectiveTest from the effects project [RSL]
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-02-26
  • Updated: 2010-10-14
  • Resolved: 2008-03-25
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 6
6u10 b20Fixed
Related Reports
Relates :  
Description
an NPE is thrown after playing with PerspectiveTest demo from
the effects project:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at sun.java2d.SunGraphics2D.validateColor(SunGraphics2D.java:1646)
        at sun.java2d.SunGraphics2D.<init>(SunGraphics2D.java:237)
        at sun.awt.image.SunVolatileImage.createGraphics(SunVolatileImage.java:192)
        at sun.java2d.pipe.hw.AccelTypedVolatileImage.createGraphics(AccelTypedVolatileImage.java:54)
        at sun.awt.image.VolatileSurfaceManager.initContents(VolatileSurfaceManager.java:263)
        at sun.java2d.d3d.D3DVolatileSurfaceManager.initContents(D3DVolatileSurfaceManager.java:209)
        at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:74)
        at sun.java2d.pipe.hw.AccelTypedVolatileImage.<init>(AccelTypedVolatileImage.java:38)
        at sun.java2d.d3d.D3DGraphicsConfig.createCompatibleVolatileImage(D3DGraphicsConfig.java:273)
        at com.sun.scenario.effect.impl.hw.HWRenderer$1.run(HWRenderer.java:75)

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/6u10/6667607.0
10-03-2008

EVALUATION The effects framework creates too many VIs and we run out of vram, and the bug is that that we try to initialize these "special" VolatileImages if their accelerated surface is null. They're "special" because they are created via the RSL API (AccelGraphicsConfig.createCompatibleVI()) which is supposed to return null if requested image type can not be created. So for these images we do not create a heap-based backup surface if an accelerated surface couldn't be created since they will not be used if they aren't accelerated. One way to fix this is to check if the sdCurrent is null in VSM.initContents() and don't attempt to initialize the image.
26-02-2008