< prev index next >
src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java
Print this page
*** 52,63 ****
import sun.java2d.pipe.hw.AccelTypedVolatileImage;
import sun.java2d.pipe.hw.ContextCapabilities;
import static sun.java2d.opengl.OGLContext.OGLContextCaps.*;
import static sun.java2d.opengl.WGLSurfaceData.*;
import sun.java2d.opengl.OGLContext.OGLContextCaps;
- import sun.java2d.pipe.hw.AccelDeviceEventListener;
- import sun.java2d.pipe.hw.AccelDeviceEventNotifier;
import sun.java2d.windows.GDIWindowSurfaceData;
public class WGLGraphicsConfig
extends Win32GraphicsConfig
implements OGLGraphicsConfig
--- 52,61 ----
*** 90,101 ****
context = new OGLContext(OGLRenderQueue.getInstance(), this);
// add a record to the Disposer so that we destroy the native
// WGLGraphicsConfigInfo data when this object goes away
Disposer.addRecord(disposerReferent,
! new WGLGCDisposerRecord(pConfigInfo,
! device.getScreen()));
}
public Object getProxyKey() {
return this;
}
--- 88,98 ----
context = new OGLContext(OGLRenderQueue.getInstance(), this);
// add a record to the Disposer so that we destroy the native
// WGLGraphicsConfigInfo data when this object goes away
Disposer.addRecord(disposerReferent,
! new WGLGCDisposerRecord(pConfigInfo));
}
public Object getProxyKey() {
return this;
}
*** 196,226 ****
return context;
}
private static class WGLGCDisposerRecord implements DisposerRecord {
private long pCfgInfo;
! private int screen;
! public WGLGCDisposerRecord(long pCfgInfo, int screen) {
this.pCfgInfo = pCfgInfo;
}
public void dispose() {
- OGLRenderQueue rq = OGLRenderQueue.getInstance();
- rq.lock();
- try {
- rq.flushAndInvokeNow(new Runnable() {
- public void run() {
- AccelDeviceEventNotifier.
- eventOccured(screen,
- AccelDeviceEventNotifier.DEVICE_RESET);
- AccelDeviceEventNotifier.
- eventOccured(screen,
- AccelDeviceEventNotifier.DEVICE_DISPOSED);
- }
- });
- } finally {
- rq.unlock();
- }
if (pCfgInfo != 0) {
OGLRenderQueue.disposeGraphicsConfig(pCfgInfo);
pCfgInfo = 0;
}
}
--- 193,206 ----
return context;
}
private static class WGLGCDisposerRecord implements DisposerRecord {
private long pCfgInfo;
! public WGLGCDisposerRecord(long pCfgInfo) {
this.pCfgInfo = pCfgInfo;
}
public void dispose() {
if (pCfgInfo != 0) {
OGLRenderQueue.disposeGraphicsConfig(pCfgInfo);
pCfgInfo = 0;
}
}
*** 453,468 ****
*/
@Override
public ContextCapabilities getContextCapabilities() {
return oglCaps;
}
-
- @Override
- public void addDeviceEventListener(AccelDeviceEventListener l) {
- AccelDeviceEventNotifier.addListener(l, screen.getScreen());
- }
-
- @Override
- public void removeDeviceEventListener(AccelDeviceEventListener l) {
- AccelDeviceEventNotifier.removeListener(l);
- }
}
--- 433,438 ----
< prev index next >