Bug 1195401 - Use gfxPrefs (threadsafe) rather than crashing on debug builds for off-main-thread pref access. r=snorp

This commit is contained in:
Kartikaya Gupta 2015-08-21 13:21:58 -04:00
parent bb46521fdd
commit 5d049411d3
2 changed files with 3 additions and 2 deletions

View File

@ -11,13 +11,13 @@
#include <android/log.h>
#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) &&

View File

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