diff --git a/gfx/gl/AndroidSurfaceTexture.cpp b/gfx/gl/AndroidSurfaceTexture.cpp index 2537046571d1..e7fa1cc21c7b 100644 --- a/gfx/gl/AndroidSurfaceTexture.cpp +++ b/gfx/gl/AndroidSurfaceTexture.cpp @@ -11,13 +11,13 @@ #include #include "AndroidSurfaceTexture.h" #include "gfxImageSurface.h" +#include "gfxPrefs.h" #include "AndroidBridge.h" #include "nsThreadUtils.h" #include "mozilla/gfx/Matrix.h" #include "GeneratedJNIWrappers.h" #include "SurfaceTexture.h" #include "GLContext.h" -#include "mozilla/Preferences.h" using namespace mozilla; using namespace mozilla::jni; @@ -132,7 +132,7 @@ 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); + bool canDetach = gfxPrefs::SurfaceTextureDetachEnabled(); mCanDetach = AndroidBridge::Bridge()->GetAPIVersion() >= 16 && (!mAttachedContext || mAttachedContext->Vendor() != GLVendor::Imagination) && diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index 820387cae35e..d99bcec0f815 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -240,6 +240,7 @@ private: // Note that "gfx.logging.level" is defined in Logging.h DECL_GFX_PREF(Once, "gfx.logging.crash.length", GfxLoggingCrashLength, uint32_t, 6); DECL_GFX_PREF(Live, "gfx.perf-warnings.enabled", PerfWarnings, bool, false); + DECL_GFX_PREF(Live, "gfx.SurfaceTexture.detach.enabled", SurfaceTextureDetachEnabled, bool, true); DECL_GFX_PREF(Live, "gfx.testing.device-reset", DeviceResetForTesting, int32_t, 0); DECL_GFX_PREF(Live, "gfx.testing.device-fail", DeviceFailForTesting, bool, false);