From 0302b5f91189a8b2c1e22f5a299f1ea81e599b1e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 14 Nov 2013 14:57:14 +0100 Subject: Bug 904 - GLJPanel: Add property to skip isGLOriented() based vertical flip by default (2/2) Property 'jogl.gljpanel.noverticalflip' will set the skipGLOrientationVerticalFlip default to true - intended for perf. testing of existing applications --- make/scripts/tests-x64.bat | 3 +++ make/scripts/tests.sh | 1 + src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 8 ++++++-- .../opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java | 4 +++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat index ac74f4c94..379bcf323 100755 --- a/make/scripts/tests-x64.bat +++ b/make/scripts/tests-x64.bat @@ -19,6 +19,9 @@ set LIB_DIR= set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%BLD_SUB%\joal.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar echo CP_ALL %CP_ALL% +REM set D_ARGS="" +REM set D_ARGS="-Djogl.gljpanel.noverticalflip" + set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true" scripts\tests-win.bat %* diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index bed169737..97e524254 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -204,6 +204,7 @@ function jrun() { #D_ARGS="-Dnativewindow.debug=all" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.gljpanel.noglsl" + #D_ARGS="-Djogl.gljpanel.noverticalflip" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Animator" #D_ARGS="-Djogl.debug.GLContext -Dnativewindow.debug.X11Util.XSync" #D_ARGS="-Dnativewindow.debug.X11Util.XSync -Dnativewindow.debug.ToolkitLock.TraceLock" diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index 011b14321..bff8a1880 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -170,6 +170,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing private static final boolean DEBUG; private static final boolean DEBUG_VIEWPORT; private static final boolean USE_GLSL_TEXTURE_RASTERIZER; + private static final boolean SKIP_VERTICAL_FLIP_DEFAULT; /** Indicates whether the Java 2D OpenGL pipeline is requested by user. */ private static final boolean java2dOGLEnabledByProp; @@ -185,7 +186,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing DEBUG = Debug.debug("GLJPanel"); DEBUG_VIEWPORT = Debug.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true); USE_GLSL_TEXTURE_RASTERIZER = !Debug.isPropertyDefined("jogl.gljpanel.noglsl", true); - + SKIP_VERTICAL_FLIP_DEFAULT = Debug.isPropertyDefined("jogl.gljpanel.noverticalflip", true); boolean enabled = Debug.getBooleanProperty("sun.java2d.opengl", false); java2dOGLEnabledByProp = enabled && !Debug.isPropertyDefined("jogl.gljpanel.noogl", true); @@ -203,6 +204,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing useJava2DGLPipeline = enabled; java2DGLPipelineOK = enabled; if( DEBUG ) { + System.err.println("GLJPanel: DEBUG_VIEWPORT "+DEBUG_VIEWPORT); + System.err.println("GLJPanel: USE_GLSL_TEXTURE_RASTERIZER "+USE_GLSL_TEXTURE_RASTERIZER); + System.err.println("GLJPanel: SKIP_VERTICAL_FLIP_DEFAULT "+SKIP_VERTICAL_FLIP_DEFAULT); System.err.println("GLJPanel: java2dOGLEnabledByProp "+java2dOGLEnabledByProp); System.err.println("GLJPanel: useJava2DGLPipeline "+useJava2DGLPipeline); System.err.println("GLJPanel: java2DGLPipelineOK "+java2DGLPipelineOK); @@ -253,7 +257,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing // The backend in use private volatile Backend backend; - private boolean skipGLOrientationVerticalFlip = false; + private boolean skipGLOrientationVerticalFlip = SKIP_VERTICAL_FLIP_DEFAULT; // Used by all backends either directly or indirectly to hook up callbacks private final Updater updater = new Updater(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java index 3133a449d..8b19537f8 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java @@ -239,7 +239,9 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase { canvas.setSize(size); canvas.setPreferredSize(size); canvas.setDoubleBuffered(useSwingDoubleBuffer); - canvas.setSkipGLOrientationVerticalFlip(skipGLOrientationVerticalFlip); + if( skipGLOrientationVerticalFlip ) { // don't fiddle w/ default .. + canvas.setSkipGLOrientationVerticalFlip(skipGLOrientationVerticalFlip); + } if( useGears ) { final GearsES2 g = new GearsES2(0); g.setVerbose(false); -- cgit v1.2.3