From d28e1b139f14b10b9e22750ac44dbc18f08a0d34 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 7 Mar 2012 12:48:03 +0100 Subject: 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'. --- .../classes/jogamp/newt/driver/android/AndroidWindow.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/newt/classes/jogamp') 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()); -- cgit v1.2.3