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 4dcb88c93c
commit 65f7a7d740
3 changed files with 23 additions and 1 deletions

View File

@ -358,6 +358,9 @@ pref("gfx.displayport.strategy_vb.danger_y_incr", -1); // additional danger zone
// prediction bias strategy options
pref("gfx.displayport.strategy_pb.threshold", -1); // velocity threshold in inches/frame
// Allow 24-bit colour when the hardware supports it
pref("gfx.android.rgb16.force", false);
// don't allow JS to move and resize existing windows
pref("dom.disable_window_move_resize", true);

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);

View File

@ -8,6 +8,7 @@ package org.mozilla.gecko.gfx;
import org.mozilla.gecko.GeckoAccessibility;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.PrefsHelper;
import org.mozilla.gecko.R;
import org.mozilla.gecko.TouchEventInterceptor;
import org.mozilla.gecko.ZoomConstraints;
@ -119,6 +120,15 @@ public class LayerView extends FrameLayout {
}
public void geckoConnected() {
// See if we want to force 16-bit colour before doing anything
PrefsHelper.getPref("gfx.android.rgb16.force", new PrefsHelper.PrefHandlerBase() {
@Override public void prefValue(String pref, boolean force16bit) {
if (force16bit) {
GeckoAppShell.setScreenDepthOverride(16);
}
}
});
mLayerClient.notifyGeckoReady();
addTouchInterceptor(new TouchEventInterceptor() {
private PointF mInitialTouchPoint = null;