25 |
25 |
26 package sun.java2d.opengl; |
26 package sun.java2d.opengl; |
27 |
27 |
28 import java.awt.AlphaComposite; |
28 import java.awt.AlphaComposite; |
29 import java.awt.Composite; |
29 import java.awt.Composite; |
|
30 import java.awt.GraphicsConfiguration; |
30 import java.awt.GraphicsEnvironment; |
31 import java.awt.GraphicsEnvironment; |
31 import java.awt.Rectangle; |
32 import java.awt.Rectangle; |
32 import java.awt.Transparency; |
33 import java.awt.Transparency; |
33 import java.awt.image.ColorModel; |
34 import java.awt.image.ColorModel; |
34 import java.awt.image.Raster; |
35 import java.awt.image.Raster; |
576 /** |
577 /** |
577 * Disposes the native resources associated with the given OGLSurfaceData |
578 * Disposes the native resources associated with the given OGLSurfaceData |
578 * (referenced by the pData parameter). This method is invoked from |
579 * (referenced by the pData parameter). This method is invoked from |
579 * the native Dispose() method from the Disposer thread when the |
580 * the native Dispose() method from the Disposer thread when the |
580 * Java-level OGLSurfaceData object is about to go away. Note that we |
581 * Java-level OGLSurfaceData object is about to go away. Note that we |
581 * also pass a reference to the native GLX/WGLGraphicsConfigInfo |
582 * also pass a reference to the OGLGraphicsConfig |
582 * (pConfigInfo) for the purposes of making a context current. |
583 * for the purposes of making a context current. |
583 */ |
584 */ |
584 static void dispose(long pData, long pConfigInfo) { |
585 static void dispose(long pData, OGLGraphicsConfig gc) { |
585 OGLRenderQueue rq = OGLRenderQueue.getInstance(); |
586 OGLRenderQueue rq = OGLRenderQueue.getInstance(); |
586 rq.lock(); |
587 rq.lock(); |
587 try { |
588 try { |
588 // make sure we have a current context before |
589 // make sure we have a current context before |
589 // disposing the native resources (e.g. texture object) |
590 // disposing the native resources (e.g. texture object) |
590 OGLContext.setScratchSurface(pConfigInfo); |
591 OGLContext.setScratchSurface(gc); |
591 |
592 |
592 RenderBuffer buf = rq.getBuffer(); |
593 RenderBuffer buf = rq.getBuffer(); |
593 rq.ensureCapacityAndAlignment(12, 4); |
594 rq.ensureCapacityAndAlignment(12, 4); |
594 buf.putInt(DISPOSE_SURFACE); |
595 buf.putInt(DISPOSE_SURFACE); |
595 buf.putLong(pData); |
596 buf.putLong(pData); |