diff --git a/gfx/thebes/gfxPrefs.cpp b/gfx/thebes/gfxPrefs.cpp index e530e432e1d0..72bc58d78b92 100644 --- a/gfx/thebes/gfxPrefs.cpp +++ b/gfx/thebes/gfxPrefs.cpp @@ -76,7 +76,7 @@ gfxPrefs::Pref::OnChange() if (auto gpm = gfx::GPUProcessManager::Get()) { if (gfx::GPUChild* gpu = gpm->GetGPUChild()) { GfxPrefValue value; - GetCachedValue(&value); + GetLiveValue(&value); Unused << gpu->SendUpdatePref(gfx::GfxPrefSetting(mIndex, value)); } } diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index bd6452a9d26d..8764aa51e476 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -112,6 +112,9 @@ public: // Returns true if the value is default, false if changed. virtual bool HasDefaultValue() const = 0; + // Returns the pref value as a discriminated union. + virtual void GetLiveValue(GfxPrefValue* aOutValue) const = 0; + // Returns the pref value as a discriminated union. virtual void GetCachedValue(GfxPrefValue* aOutValue) const = 0; @@ -228,6 +231,10 @@ private: const char *Name() const override { return Prefname(); } + void GetLiveValue(GfxPrefValue* aOutValue) const override { + T value = GetLiveValue(); + CopyPrefValue(&value, aOutValue); + } // When using the Preferences service, the change callback can be triggered // *before* our cached value is updated, so we expose a method to grab the // true live value.