aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-08 01:13:42 +0200
committerSven Gothel <[email protected]>2011-10-08 01:13:42 +0200
commit1ac5f46bb15c08b7126e22d10a80e6d607207780 (patch)
treedabb6dc6e03a1dd6448036026a7257366bfd4b60 /src/newt/classes
parent00a55caad191db3bda63779058fe49086d5c38cf (diff)
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
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java29
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java6
2 files changed, 30 insertions, 5 deletions
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();
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
index 5e5b90770..bb678935a 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
@@ -81,6 +81,10 @@ public class NewtBaseActivity extends Activity {
public void setAnimator(Animator animator) {
this.animator = animator;
+ if(!animator.isStarted()) {
+ animator.start();
+ }
+ animator.pause();
}
@Override
@@ -127,7 +131,7 @@ public class NewtBaseActivity extends Activity {
super.onResume();
}
if(null != animator) {
- animator.start();
+ animator.resume();
}
}