From 0302b5f91189a8b2c1e22f5a299f1ea81e599b1e Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
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
---
 src/jogl/classes/javax/media/opengl/awt/GLJPanel.java             | 8 ++++++--
 .../opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java | 4 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)

(limited to 'src')

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