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/nativewindow | |
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/nativewindow')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/Capabilities.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java index 5795e8cfe..d35f92fea 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java +++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java @@ -157,11 +157,9 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable { } final CapabilitiesImmutable caps = (CapabilitiesImmutable) o; */ - final int a = ( alphaBits > 0 ) ? alphaBits : 1; - final int rgba = redBits * greenBits * blueBits * a; - - final int xa = ( caps.getAlphaBits() ) > 0 ? caps.getAlphaBits() : 1; - final int xrgba = caps.getRedBits() * caps.getGreenBits() * caps.getBlueBits() * xa; + final int rgba = redBits * greenBits * blueBits * ( alphaBits + 1 ); + + final int xrgba = caps.getRedBits() * caps.getGreenBits() * caps.getBlueBits() * ( caps.getAlphaBits() + 1 ); if(rgba > xrgba) { return 1; |