From 1ac5f46bb15c08b7126e22d10a80e6d607207780 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 8 Oct 2011 01:13:42 +0200 Subject: GLWindow/GLDrawableHelper: Adding experimental notion of skipping GL context release for a specific thread - marked deprecated - used to perf measure situation on omap3, ie figuring out where the low perf. in GearsES2 comes from, our core JOGL code or the GL usage. Turns out it's the GL usage itself, ie the shader - good. - calls are commented out in the demos --- .../classes/com/jogamp/newt/opengl/GLWindow.java | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/newt/classes/com/jogamp') diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 7712b4654..3a49c06f0 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -51,6 +51,7 @@ import javax.media.opengl.*; import jogamp.opengl.FPSCounterImpl; import jogamp.opengl.GLDrawableHelper; import com.jogamp.opengl.JoglVersion; +import com.jogamp.opengl.util.Animator; /** * An implementation of {@link javax.media.opengl.GLAutoDrawable} interface, @@ -539,14 +540,12 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC } } - /** This implementation uses a static value */ - public void setAutoSwapBufferMode(boolean onOrOff) { + public void setAutoSwapBufferMode(boolean enable) { if(null!=helper) { - helper.setAutoSwapBufferMode(onOrOff); + helper.setAutoSwapBufferMode(enable); } } - /** This implementation uses a static value */ public boolean getAutoSwapBufferMode() { if(null!=helper) { return helper.getAutoSwapBufferMode(); @@ -554,6 +553,28 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC return false; } + /** + * @param t the thread for which context release shall be skipped, usually the animation thread, + * ie. {@link Animator#getThread()}. + * @deprecated this is an experimental feature, + * intended for measuring performance in regards to GL context switch + */ + public void setSkipContextReleaseThread(Thread t) { + if(null!=helper) { + helper.setSkipContextReleaseThread(t); + } + } + + /** + * @deprecated see {@link #setSkipContextReleaseThread(Thread)} + */ + public Thread getSkipContextReleaseThread() { + if(null!=helper) { + return helper.getSkipContextReleaseThread(); + } + return null; + } + public void swapBuffers() { if(drawable!=null && context != null) { drawable.swapBuffers(); -- cgit v1.2.3