diff options
author | Mathias Agopian <mathias@google.com> | 2010-05-24 19:12:33 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-05-24 19:12:33 -0700 |
commit | 36893612af956b238679bce4e95fd104d279e518 (patch) | |
tree | ff19248cbc31678bf855594efb47754dfe25dd6e /core/java | |
parent | 61a5870871cbc191414669568039321428722236 (diff) | |
parent | d6ddcb7f00a7af95b452233d965b922632f78f21 (diff) | |
download | frameworks_base-36893612af956b238679bce4e95fd104d279e518.zip frameworks_base-36893612af956b238679bce4e95fd104d279e518.tar.gz frameworks_base-36893612af956b238679bce4e95fd104d279e518.tar.bz2 |
am d6ddcb7f: fix [2677468] some 3rd party GL ES apps get a 32-bits surface by default and fail
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/view/SurfaceView.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 2a3f032..cc30d71 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -140,7 +140,10 @@ public class SurfaceView extends View { boolean mViewVisibility = false; int mRequestedWidth = -1; int mRequestedHeight = -1; - int mRequestedFormat = PixelFormat.OPAQUE; + /* Set SurfaceView's format to 565 by default to maintain backward + * compatibility with applications assuming this format. + */ + int mRequestedFormat = PixelFormat.RGB_565; int mRequestedType = -1; boolean mHaveFrame = false; @@ -163,16 +166,20 @@ public class SurfaceView extends View { public SurfaceView(Context context) { super(context); - setWillNotDraw(true); + init(); } public SurfaceView(Context context, AttributeSet attrs) { super(context, attrs); - setWillNotDraw(true); + init(); } public SurfaceView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); + init(); + } + + private void init() { setWillNotDraw(true); } |