mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 822115 - nglayout.debug.widget_update_flashing pref cache is not thread safe. r=mattwoodrow
This commit is contained in:
parent
f440c12fc5
commit
09597e2391
@ -629,16 +629,7 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
void
|
||||
BasicLayerManager::FlashWidgetUpdateArea(gfxContext *aContext)
|
||||
{
|
||||
static bool sWidgetFlashingEnabled;
|
||||
static bool sWidgetFlashingPrefCached = false;
|
||||
|
||||
if (!sWidgetFlashingPrefCached) {
|
||||
sWidgetFlashingPrefCached = true;
|
||||
mozilla::Preferences::AddBoolVarCache(&sWidgetFlashingEnabled,
|
||||
"nglayout.debug.widget_update_flashing");
|
||||
}
|
||||
|
||||
if (sWidgetFlashingEnabled) {
|
||||
if (gfxPlatform::GetPlatform()->WidgetUpdateFlashing()) {
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
|
@ -340,6 +340,9 @@ gfxPlatform::Init()
|
||||
|
||||
gPlatform->mWorkAroundDriverBugs = Preferences::GetBool("gfx.work-around-driver-bugs", true);
|
||||
|
||||
mozilla::Preferences::AddBoolVarCache(&gPlatform->mWidgetUpdateFlashing,
|
||||
"nglayout.debug.widget_update_flashing");
|
||||
|
||||
mozilla::gl::GLContext::PlatformStartup();
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
|
@ -493,6 +493,8 @@ public:
|
||||
|
||||
virtual int GetScreenDepth() const;
|
||||
|
||||
bool WidgetUpdateFlashing() const { return mWidgetUpdateFlashing; }
|
||||
|
||||
protected:
|
||||
gfxPlatform();
|
||||
virtual ~gfxPlatform();
|
||||
@ -586,6 +588,7 @@ private:
|
||||
bool mWorkAroundDriverBugs;
|
||||
|
||||
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
|
||||
bool mWidgetUpdateFlashing;
|
||||
};
|
||||
|
||||
#endif /* GFX_PLATFORM_H */
|
||||
|
Loading…
Reference in New Issue
Block a user