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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user