diff options
author | Takazumi Matsumoto <tdr@cyanogenmod.org> | 2013-01-04 16:35:18 +0000 |
---|---|---|
committer | Takazumi Matsumoto <tdr@cyanogenmod.org> | 2013-01-07 19:14:43 +0000 |
commit | d0bfd5601a58b9a8b903a4593d9007c1c0ba2679 (patch) | |
tree | b1bc961861526b71c78d6bb333e648cf723e14c3 /opengl | |
parent | 0fd25ff90231db6adecabecad935c18bb5b91b54 (diff) | |
download | frameworks_base-d0bfd5601a58b9a8b903a4593d9007c1c0ba2679.zip frameworks_base-d0bfd5601a58b9a8b903a4593d9007c1c0ba2679.tar.gz frameworks_base-d0bfd5601a58b9a8b903a4593d9007c1c0ba2679.tar.bz2 |
GLSurfaceView: add property to default to RGB565
Some legacy devices (like the Xoom) are not capable of handling
RGB888 surfaces, which is now the default. This results in some
OpenGL apps crashing with "No config chosen" errors.
Set ro.opengles.surface.rgb565=true to go back to the old default
of RGB565 surfaces.
Credit to dreamcwli for the original patch.
Change-Id: I5ad9aa8e98eb6fd554b01022439141fe4a55bd70
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/java/android/opengl/GLSurfaceView.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index 54dcaaa..5b5cd52 100644 --- a/opengl/java/android/opengl/GLSurfaceView.java +++ b/opengl/java/android/opengl/GLSurfaceView.java @@ -169,6 +169,8 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback private final static boolean LOG_RENDERER = false; private final static boolean LOG_RENDERER_DRAW_FRAME = false; private final static boolean LOG_EGL = false; + + private final static boolean RGB565 = SystemProperties.getBoolean("ro.opengles.surface.rgb565", false); /** * The renderer only renders * when the surface is created, or when {@link #requestRender} is called. @@ -974,7 +976,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback */ private class SimpleEGLConfigChooser extends ComponentSizeChooser { public SimpleEGLConfigChooser(boolean withDepthBuffer) { - super(8, 8, 8, 0, withDepthBuffer ? 16 : 0, 0); + super(RGB565 ? 5 : 8, RGB565 ? 6 : 8, RGB565 ? 5 : 8, 0, withDepthBuffer ? 16 : 0, 0); } } |