Bug 1153848 - Add pref to disable SurfaceTexture attach/detach. r=snorp

This commit is contained in:
Dylan Roeh 2015-07-06 16:43:45 -05:00
parent 3001b545ba
commit ae8b9a16f3
2 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@
#include "GeneratedJNIWrappers.h"
#include "SurfaceTexture.h"
#include "GLContext.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
using namespace mozilla::jni;
@ -131,9 +132,12 @@ AndroidSurfaceTexture::UpdateCanDetach()
// The API for attach/detach only exists on 16+, and PowerVR has some sort of
// fencing issue. Additionally, attach/detach seems to be busted on at least some
// Mali adapters (400MP2 for sure, bug 1131793)
bool canDetach = Preferences::GetBool("gfx.SurfaceTexture.detach.enabled", true);
mCanDetach = AndroidBridge::Bridge()->GetAPIVersion() >= 16 &&
(!mAttachedContext || mAttachedContext->Vendor() != GLVendor::Imagination) &&
(!mAttachedContext || mAttachedContext->Vendor() != GLVendor::ARM /* Mali */);
(!mAttachedContext || mAttachedContext->Vendor() != GLVendor::ARM /* Mali */) &&
canDetach;
}
bool

View File

@ -337,6 +337,9 @@ pref("gfx.displayport.strategy_pb.threshold", -1); // velocity threshold in inch
// Allow 24-bit colour when the hardware supports it
pref("gfx.android.rgb16.force", false);
// Allow GLContexts to be attached/detached from SurfaceTextures
pref("gfx.SurfaceTexture.detach.enabled", true);
// don't allow JS to move and resize existing windows
pref("dom.disable_window_move_resize", true);