diff options
author | Sven Gothel <[email protected]> | 2012-03-07 12:48:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-07 12:48:03 +0100 |
commit | d28e1b139f14b10b9e22750ac44dbc18f08a0d34 (patch) | |
tree | 40ba16e7232f9df113e954cd4e56e61027040779 /src | |
parent | 7b450386d876c52805295804c9ebf9a109ed5508 (diff) |
AndroidWindow.surfaceChanged(.., int pFormat, ..): Use passed pixel-format if valid
Turns out on Android 4.0.3 / Pandaboard ES (at least),
the NDK method 'ANativeWindow_getFormat()' returns '1'.
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java b/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java index 5be36fd76..ec687277a 100644 --- a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java +++ b/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java @@ -292,7 +292,7 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { } /** - Canvas cLock = null; + android.graphics.Canvas cLock = null; @Override protected int lockSurfaceImpl() { @@ -300,7 +300,7 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { throw new InternalError("surface already locked"); } if (0 != surfaceHandle) { - cLock = nsv.getHolder().lockCanvas(); + cLock = androidView.getHolder().lockCanvas(); } return ( null != cLock ) ? LOCK_SUCCESS : LOCK_SURFACE_NOT_READY; } @@ -310,7 +310,7 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { if (null == cLock) { throw new InternalError("surface not locked"); } - nsv.getHolder().unlockCanvasAndPost(cLock); + androidView.getHolder().unlockCanvasAndPost(cLock); cLock=null; } */ @@ -354,7 +354,11 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { surface = aHolder.getSurface(); surfaceHandle = getSurfaceHandle0(surface); acquire0(surfaceHandle); - format = getSurfaceVisualID0(surfaceHandle); + if(PixelFormat.UNKNOWN == aFormat) { + format = getSurfaceVisualID0(surfaceHandle); + } else { + format = aFormat; + } final int nWidth = getWidth0(surfaceHandle); final int nHeight = getHeight0(surfaceHandle); capsByFormat = (GLCapabilitiesImmutable) fixCaps(format, getRequestedCapabilities()); |