diff options
author | Sven Gothel <[email protected]> | 2013-01-20 15:05:02 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-01-20 15:05:02 +0100 |
commit | 85d70b7d38885fa8ba6374aa790d5a296acc8ec1 (patch) | |
tree | 7aaf7d638fad47252695cc55894a6f3404d14b45 /src/test | |
parent | 0989484b89535d56e9f150cdf63e2a17bf36e32e (diff) |
Android: Allow selection of native window formats RGBA8888, RGBX8888 and RGB565; Fix HiSilicon/Vivante/Immersion.16 EGLConfig selection (zero depth buffer @ visualID)
- NEWT/Android Fix PixelFormat/NativeWindowFormat/VisualID Selection
- Fix allows proper selection of native window formats: RGBA8888, RGBX8888 and RGB565
- Selection is performed in 3 steps:
1) @ Construction (non native): SurfaceHolder.setFormat( getSurfaceHolderFormat( caps ) )
2) @ Native Surface Creation: getANativeWindowFormat( androidFormat) -> ANativeWindow_setBuffersGeometry(..)
Note: The set native format is revalidated, i.e. read out via ANativeWindow_getFormat(..).
3) @ EGL Creation: ANativeWindow_getFormat(..) -> fixCaps(..) - simply fixing the chosen caps.
- NEWT GLWindow.GLLifecycleHook.resetCounter:
- Also reset GLAnimatorControl's counter, if attached.
- NEWT WindowImpl -> GLLifecycleHook.resetCounter() calls issued _after_ operation before unlock().
- JOGL/EGLGraphicsConfigurationFactory
- Validate whether the visualID matching EGLConfig depth buffer is suitable.
On HiSilicon/Vivante/Immersion.16: Depth buffer w/ matching visualID is zero!
- NativeWindow/Capabilities.compareTo: Fix alpha comparison
Diffstat (limited to 'src/test')
3 files changed, 164 insertions, 1 deletions
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java index 4468868f6..e782ac75f 100644 --- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java +++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java @@ -47,6 +47,9 @@ import android.util.Log; public class NEWTGearsES2Activity extends NewtBaseActivity { static String TAG = "NEWTGearsES2Activity"; + static final String forceRGBA5650 = "demo.force.rgba5650"; + static final String forceECT = "demo.force.ect"; + @Override public void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate - 0"); @@ -54,6 +57,11 @@ public class NEWTGearsES2Activity extends NewtBaseActivity { // create GLWindow (-> incl. underlying NEWT Display, Screen & Window) GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2)); + if( null != System.getProperty(forceRGBA5650) ) { + Log.d(TAG, "forceRGBA5650"); + caps.setRedBits(5); caps.setGreenBits(6); caps.setBlueBits(5); + } + Log.d(TAG, "req caps: "+caps); GLWindow glWindow = GLWindow.create(caps); glWindow.setFullscreen(true); @@ -81,6 +89,11 @@ public class NEWTGearsES2Activity extends NewtBaseActivity { setAnimator(animator); // glWindow.setSkipContextReleaseThread(animator.getThread()); + if( null != System.getProperty(forceECT) ) { + Log.d(TAG, "forceECT"); + animator.setExclusiveContext(true); + } + glWindow.setVisible(true); animator.setUpdateFPSFrames(60, System.err); @@ -88,5 +101,5 @@ public class NEWTGearsES2Activity extends NewtBaseActivity { glWindow.resetFPSCounter(); Log.d(TAG, "onCreate - X"); - } + } } diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java new file mode 100644 index 000000000..c54aa0fa6 --- /dev/null +++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java @@ -0,0 +1,75 @@ +/** + * Copyright 2012 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +package com.jogamp.opengl.test.android; + +import java.util.Arrays; +import java.util.List; + +import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties; + +public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLauncher { + + static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity"; + // static String[] pkgs = new String[] { "com.jogamp.common", "javax.media.opengl", "com.jogamp.opengl.test" }; + static String[] pkgs = new String[] { "com.jogamp.opengl.test" }; + + @Override + public void init() { + final OrderedProperties props = getProperties(); + // props.setProperty("jogamp.debug.JNILibLoader", "true"); + // props.setProperty("jogamp.debug.NativeLibrary", "true"); + // props.setProperty("jogamp.debug.IOUtil", "true"); + // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true"); + // props.setProperty("nativewindow.debug", "all"); + props.setProperty("nativewindow.debug.GraphicsConfiguration", "true"); + // props.setProperty("jogl.debug", "all"); + // properties.setProperty("jogl.debug.GLProfile", "true"); + // props.setProperty("jogl.debug.GLDrawable", "true"); + props.setProperty("jogl.debug.GLContext", "true"); + props.setProperty("jogl.debug.GLSLCode", "true"); + // props.setProperty("jogl.debug.CapabilitiesChooser", "true"); + // props.setProperty("jogl.debug.GLSLState", "true"); + // props.setProperty("jogl.debug.DebugGL", "true"); + // props.setProperty("jogl.debug.TraceGL", "true"); + // props.setProperty("newt.debug", "all"); + props.setProperty("newt.debug.Window", "true"); + props.setProperty("newt.debug.Window.MouseEvent", "true"); + props.setProperty("newt.debug.Window.KeyEvent", "true"); + + props.setProperty("demo.force.ect", "true"); + } + + @Override + public String getActivityName() { + return demo; + } + @Override + public List<String> getPackages() { + return Arrays.asList(pkgs); + } +} diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java new file mode 100644 index 000000000..fbd9b0a9c --- /dev/null +++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java @@ -0,0 +1,75 @@ +/** + * Copyright 2012 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +package com.jogamp.opengl.test.android; + +import java.util.Arrays; +import java.util.List; + +import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties; + +public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivityLauncher { + + static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity"; + // static String[] pkgs = new String[] { "com.jogamp.common", "javax.media.opengl", "com.jogamp.opengl.test" }; + static String[] pkgs = new String[] { "com.jogamp.opengl.test" }; + + @Override + public void init() { + final OrderedProperties props = getProperties(); + // props.setProperty("jogamp.debug.JNILibLoader", "true"); + // props.setProperty("jogamp.debug.NativeLibrary", "true"); + // props.setProperty("jogamp.debug.IOUtil", "true"); + // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true"); + // props.setProperty("nativewindow.debug", "all"); + props.setProperty("nativewindow.debug.GraphicsConfiguration", "true"); + // props.setProperty("jogl.debug", "all"); + // properties.setProperty("jogl.debug.GLProfile", "true"); + // props.setProperty("jogl.debug.GLDrawable", "true"); + props.setProperty("jogl.debug.GLContext", "true"); + props.setProperty("jogl.debug.GLSLCode", "true"); + // props.setProperty("jogl.debug.CapabilitiesChooser", "true"); + // props.setProperty("jogl.debug.GLSLState", "true"); + // props.setProperty("jogl.debug.DebugGL", "true"); + // props.setProperty("jogl.debug.TraceGL", "true"); + // props.setProperty("newt.debug", "all"); + props.setProperty("newt.debug.Window", "true"); + props.setProperty("newt.debug.Window.MouseEvent", "true"); + props.setProperty("newt.debug.Window.KeyEvent", "true"); + + props.setProperty("demo.force.rgba5650", "true"); + } + + @Override + public String getActivityName() { + return demo; + } + @Override + public List<String> getPackages() { + return Arrays.asList(pkgs); + } +} |