Bug 803299 - Respect gfx.android.rgb16.force pref. r=blassey

This commit is contained in:
Chris Lord
2013-07-04 14:53:27 +01:00
parent c3aabd3407
commit d555170fbc
3 changed files with 23 additions and 1 deletions

View File

@@ -1326,7 +1326,7 @@ public class GeckoAppShell
* Returns the colour depth of the default screen. This will either be
* 24 or 16.
*/
public static int getScreenDepth() {
public static synchronized int getScreenDepth() {
if (sScreenDepth == 0 && getGeckoInterface() != null) {
switch (getGeckoInterface().getActivity().getWindowManager().getDefaultDisplay().getPixelFormat()) {
case PixelFormat.RGBA_8888 :
@@ -1343,6 +1343,15 @@ public class GeckoAppShell
return sScreenDepth;
}
public static synchronized void setScreenDepthOverride(int aScreenDepth) {
if (sScreenDepth != 0) {
Log.e(LOGTAG, "Tried to override screen depth after it's already been set");
return;
}
sScreenDepth = aScreenDepth;
}
public static void setFullScreen(boolean fullscreen) {
if (getGeckoInterface() != null)
getGeckoInterface().setFullScreen(fullscreen);