From 82f679b064784213591b460fc5eaa1f5f196fbd1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 14 Feb 2014 06:37:13 +0100 Subject: Bug 975 - GLJPanel's OffscreenDrawable shall not double swap - Use default auto-swap mechanims Refines commit 908ebd99d1eb57ce773a1fdd67c76886da86b9e6 Note that the test case decide whether to auto-swap (after read-pixels) or not auto-swap (manual swap before read-pixels). See UITestCase.swapBuffersBeforeRead(GLCapabilitiesImmutable chosenCaps): Determines whether the chosen GLCapabilitiesImmutable requires a swap-buffers before reading pixels. Usually one uses the default-read-buffer, i.e. GL.GL_FRONT for single-buffer and GL.GL_BACK for double-buffer GLDrawables and GL.GL_COLOR_ATTACHMENT0 for offscreen framebuffer objects. Here swap-buffers shall happen after calling reading pixels, the default. However, multisampling offscreen GLFBODrawables utilize swap-buffers to downsample the multisamples into the readable sampling sink. In this case, we require a swap-buffers before reading pixels. Returns: chosenCaps.isFBO() && chosenCaps.getSampleBuffers() +++ - GLJPanel: - Remove SurfaceUpdatedListener mechanism in favor of default auto-swap-buffer via GLDrawableHelper. This removes complexity. - postGL does not need to perform explicit swapBuffer operation, but rely on GLDrawableHelper and the default mechanism. This is also compatible w/ J2D backend. - Use GLDrawableHelper for setAutoSwapBufferMode(..) and getAutoSwapBufferMode() +++ UnitTests: - UITestCase: - Add 'boolean swapBuffersBeforeRead(GLCapabilitiesImmutable chosenCaps)' to determine whether swapBuffers() must occure before read-pixels. See above. - GLReadBuffer00Base* - remove explicit addSnapshotGLEL/removeSnapshotGLEL - add TextRendererGLEL, to display frame-count and -dimension - SnapshotGLEL* - simply toggle auto-swap in their init(..) and dispose(..) method! - clear back-buffer if 'swapBuffersBeforeRead' to test whether the right buffer is being used for read-pixels. --- make/scripts/tests.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'make/scripts/tests.sh') diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index ae8075994..49b1b46ef 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -209,6 +209,7 @@ function jrun() { #D_ARGS="-Dnewt.debug.Window" #D_ARGS="-Xprof" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel" + #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.debug.GLJPanel.Viewport" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.gljpanel.noglsl" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.gljpanel.noglsl -Djogl.gljpanel.awtverticalflip" #D_ARGS="-Djogl.debug.GLJPanel -Djogl.debug.DebugGL" @@ -219,6 +220,7 @@ function jrun() { #D_ARGS="-Dnativewindow.debug.NativeWindow" #D_ARGS="-Dnativewindow.osx.calayer.bugfree" #D_ARGS="-Dnativewindow.debug.ToolkitLock" + #D_ARGS="-Djogl.debug.graph.curve" #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLCode -Djogl.debug.TraceGL" #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLState" #D_ARGS="-Djogamp.debug.TempJarCache -Djogamp.debug.JarUtil -Djogamp.debug.IOUtil" -- cgit v1.2.3