diff options
author | Sven Gothel <[email protected]> | 2012-08-18 00:45:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-08-18 00:45:13 +0200 |
commit | 5a5c2bc7a113906453e0de6f0403f394acdb9a4f (patch) | |
tree | 8154f5942da8da946b2daaced0640b525dec0d9b /src/jogl | |
parent | b255e569c5197aa60255a6141960a39a827222c4 (diff) |
Fix GLCanvas's JAWTWindow reference ; Add ES2 test in TestAWT01GLn ; Ubuntu 12.04/Pandaboard(Omap4, PowerVR SGX 540) 103/108 tests passed (before freeze) of 124 total
Fix GLCanvas's JAWTWindow reference
- drawable.getNativeSurface() may not be a JAWTWindow
due to our EGL WrappedSurface. Hence store the created JAWTWindow reference locally.
Add ES2 test in TestAWT01GLn
- test EGL/ES2 w/ AWT GLCanvas
Ubuntu 12.04/Pandaboard(Omap4, PowerVR SGX 540): 103/108 tests passed (before freeze) of 124 total
- machine freezes around test 108 ..
- new passed unit test high for ES2 incl. AWT tests
Diffstat (limited to 'src/jogl')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 03fd78ac7..033591fe3 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -146,6 +146,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing private final GLDrawableHelper helper = new GLDrawableHelper(); private AWTGraphicsConfiguration awtConfig; private volatile GLDrawable drawable; // volatile: avoid locking for read-only access + private volatile JAWTWindow jawtWindow; // the JAWTWindow presentation of this AWT Canvas, bound to the 'drawable' lifecycle private GLContextImpl context; private volatile boolean sendReshape = false; // volatile: maybe written by EDT w/o locking @@ -268,9 +269,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing @Override public final boolean isOffscreenLayerSurfaceEnabled() { - final GLDrawable _drawable = drawable; - if(null != _drawable) { - return ((JAWTWindow)_drawable.getNativeSurface()).isOffscreenLayerSurfaceEnabled(); + final JAWTWindow _jawtWindow = jawtWindow; + if(null != _jawtWindow) { + return _jawtWindow.isOffscreenLayerSurfaceEnabled(); } return false; } @@ -539,7 +540,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing private void createDrawableAndContext() { // no lock required, since this resource ain't available yet - final JAWTWindow jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig); + jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig); jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer); jawtWindow.lockSurface(); try { @@ -811,11 +812,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing public void run() { context=null; if(null!=drawable) { - final JAWTWindow jawtWindow = (JAWTWindow)drawable.getNativeSurface(); drawable.setRealized(false); drawable=null; if(null!=jawtWindow) { jawtWindow.destroy(); + jawtWindow=null; } } |