summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-06-14 21:50:48 -0700
committerMathias Agopian <mathias@google.com>2010-06-14 21:56:34 -0700
commit2d468c5d73cc1cefbcfa8d98e30622c54756918c (patch)
treed2e254ee1b71ed8ff2257cb1f0d86a678a2d1ad4
parent96e59eb8f34e999deb9eb4974cbfc07c71df3cab (diff)
downloadframeworks_base-2d468c5d73cc1cefbcfa8d98e30622c54756918c.zip
frameworks_base-2d468c5d73cc1cefbcfa8d98e30622c54756918c.tar.gz
frameworks_base-2d468c5d73cc1cefbcfa8d98e30622c54756918c.tar.bz2
Make sure SurfaceView use a 565 surface when requesting an OPAQUE format.
this is needed for backward compatibility with somewhat buggy applications. not a big deal, since the app can request another format explicitely. Change-Id: Ic73f8acedf94ffc0115637efac28fa8ffaa7e5a4
-rw-r--r--core/java/android/view/SurfaceView.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 8beceec..d1a0f75 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -724,6 +724,12 @@ public class SurfaceView extends View {
}
public void setFormat(int format) {
+
+ // for backward compatibility reason, OPAQUE always
+ // means 565 for SurfaceView
+ if (format == PixelFormat.OPAQUE)
+ format = PixelFormat.RGB_565;
+
mRequestedFormat = format;
if (mWindow != null) {
updateWindow(false);