зеркало из https://github.com/mozilla/gecko-dev.git
Bug 822115 - nglayout.debug.widget_update_flashing pref cache is not thread safe. r=mattwoodrow
This commit is contained in:
Родитель
f440c12fc5
Коммит
09597e2391
|
@ -629,16 +629,7 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||||
void
|
void
|
||||||
BasicLayerManager::FlashWidgetUpdateArea(gfxContext *aContext)
|
BasicLayerManager::FlashWidgetUpdateArea(gfxContext *aContext)
|
||||||
{
|
{
|
||||||
static bool sWidgetFlashingEnabled;
|
if (gfxPlatform::GetPlatform()->WidgetUpdateFlashing()) {
|
||||||
static bool sWidgetFlashingPrefCached = false;
|
|
||||||
|
|
||||||
if (!sWidgetFlashingPrefCached) {
|
|
||||||
sWidgetFlashingPrefCached = true;
|
|
||||||
mozilla::Preferences::AddBoolVarCache(&sWidgetFlashingEnabled,
|
|
||||||
"nglayout.debug.widget_update_flashing");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sWidgetFlashingEnabled) {
|
|
||||||
float r = float(rand()) / RAND_MAX;
|
float r = float(rand()) / RAND_MAX;
|
||||||
float g = float(rand()) / RAND_MAX;
|
float g = float(rand()) / RAND_MAX;
|
||||||
float b = 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);
|
gPlatform->mWorkAroundDriverBugs = Preferences::GetBool("gfx.work-around-driver-bugs", true);
|
||||||
|
|
||||||
|
mozilla::Preferences::AddBoolVarCache(&gPlatform->mWidgetUpdateFlashing,
|
||||||
|
"nglayout.debug.widget_update_flashing");
|
||||||
|
|
||||||
mozilla::gl::GLContext::PlatformStartup();
|
mozilla::gl::GLContext::PlatformStartup();
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
|
|
|
@ -493,6 +493,8 @@ public:
|
||||||
|
|
||||||
virtual int GetScreenDepth() const;
|
virtual int GetScreenDepth() const;
|
||||||
|
|
||||||
|
bool WidgetUpdateFlashing() const { return mWidgetUpdateFlashing; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
gfxPlatform();
|
gfxPlatform();
|
||||||
virtual ~gfxPlatform();
|
virtual ~gfxPlatform();
|
||||||
|
@ -586,6 +588,7 @@ private:
|
||||||
bool mWorkAroundDriverBugs;
|
bool mWorkAroundDriverBugs;
|
||||||
|
|
||||||
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
|
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
|
||||||
|
bool mWidgetUpdateFlashing;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* GFX_PLATFORM_H */
|
#endif /* GFX_PLATFORM_H */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче