Bug 894087 - Fix 24-bit color detection. r=Cwiiis

This commit is contained in:
Brian Nicholson
2013-07-18 12:09:01 -07:00
parent da343534d1
commit 0ef04478fc

View File

@@ -1371,18 +1371,10 @@ public class GeckoAppShell
public static synchronized int getScreenDepth() {
if (sScreenDepth == 0) {
sScreenDepth = 16;
if (getGeckoInterface() != null) {
switch (getGeckoInterface().getActivity().getWindowManager().getDefaultDisplay().getPixelFormat()) {
case PixelFormat.RGBA_8888 :
case PixelFormat.RGBX_8888 :
case PixelFormat.RGB_888 :
{
if (isHighMemoryDevice()) {
sScreenDepth = 24;
}
break;
}
}
PixelFormat info = new PixelFormat();
PixelFormat.getPixelFormatInfo(getGeckoInterface().getActivity().getWindowManager().getDefaultDisplay().getPixelFormat(), info);
if (info.bitsPerPixel >= 24 && isHighMemoryDevice()) {
sScreenDepth = 24;
}
}