mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 946907: Make sure GLContext reads preferences through gfxPrefs which means it's done on the main thread. Rename the macro to DECL_GFX_PREF before it gets used in a lot of places. r=bjacob
This commit is contained in:
parent
811e6c1157
commit
a6a3b6984a
@ -15,7 +15,6 @@
|
||||
#include "GLReadTexImageHelper.h"
|
||||
|
||||
#include "gfxCrashReporterUtils.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "GLContextProvider.h"
|
||||
#include "GLTextureImage.h"
|
||||
@ -28,11 +27,11 @@
|
||||
#include "GfxTexturesReporter.h"
|
||||
#include "TextureGarbageBin.h"
|
||||
#include "gfx2DGlue.h"
|
||||
#include "gfxPrefs.h"
|
||||
|
||||
#include "OGLShaderProgram.h" // for ShaderProgramType
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#include <CoreServices/CoreServices.h>
|
||||
@ -308,7 +307,7 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
||||
return true;
|
||||
}
|
||||
|
||||
mWorkAroundDriverBugs = gfxPlatform::GetPlatform()->WorkAroundDriverBugs();
|
||||
mWorkAroundDriverBugs = gfxPrefs::WorkAroundDriverBugs();
|
||||
|
||||
SymLoadStruct symbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fActiveTexture, { "ActiveTexture", "ActiveTextureARB", nullptr } },
|
||||
@ -1333,7 +1332,7 @@ GLContext::ChooseGLFormats(const SurfaceCaps& caps) const
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t msaaLevel = Preferences::GetUint("gl.msaa-level", 2);
|
||||
uint32_t msaaLevel = gfxPrefs::MSAALevel();
|
||||
GLsizei samples = msaaLevel * msaaLevel;
|
||||
samples = std::min(samples, mMaxSamples);
|
||||
|
||||
|
@ -455,8 +455,6 @@ gfxPlatform::Init()
|
||||
gPlatform->mOrientationSyncPrefsObserver = new OrientationSyncPrefsObserver();
|
||||
Preferences::AddStrongObserver(gPlatform->mOrientationSyncPrefsObserver, "layers.orientation.sync.timeout");
|
||||
|
||||
gPlatform->mWorkAroundDriverBugs = Preferences::GetBool("gfx.work-around-driver-bugs", true);
|
||||
|
||||
mozilla::Preferences::AddBoolVarCache(&gPlatform->mWidgetUpdateFlashing,
|
||||
"nglayout.debug.widget_update_flashing");
|
||||
|
||||
|
@ -603,8 +603,6 @@ public:
|
||||
*/
|
||||
static PRLogModuleInfo* GetLog(eGfxLog aWhichLog);
|
||||
|
||||
bool WorkAroundDriverBugs() const { return mWorkAroundDriverBugs; }
|
||||
|
||||
virtual int GetScreenDepth() const;
|
||||
|
||||
bool WidgetUpdateFlashing() const { return mWidgetUpdateFlashing; }
|
||||
@ -742,7 +740,6 @@ private:
|
||||
uint32_t mContentBackendBitmask;
|
||||
|
||||
mozilla::widget::GfxInfoCollector<gfxPlatform> mAzureCanvasBackendCollector;
|
||||
bool mWorkAroundDriverBugs;
|
||||
|
||||
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
|
||||
bool mWidgetUpdateFlashing;
|
||||
|
@ -18,7 +18,7 @@
|
||||
// from any thread after that first call.
|
||||
|
||||
// To register a preference, you need to add a line in this file using
|
||||
// the DECL_GFX_PREFS macro.
|
||||
// the DECL_GFX_PREF macro.
|
||||
//
|
||||
// Update argument controls whether we read the preference value and save it
|
||||
// or connect with a callback. See UpdatePolicy enum below.
|
||||
@ -28,7 +28,7 @@
|
||||
// Default is the default value for the preference.
|
||||
//
|
||||
// For example this line in the .h:
|
||||
// DECL_GFX_PREFS(Once,"layers.dump",LayersDump,bool,false);
|
||||
// DECL_GFX_PREF(Once,"layers.dump",LayersDump,bool,false);
|
||||
// means that you can call
|
||||
// bool var = gfxPrefs::LayersDump();
|
||||
// from any thread, but that you will only get the preference value of
|
||||
@ -36,7 +36,7 @@
|
||||
// was not set, the default would be false.
|
||||
//
|
||||
// In another example, this line in the .h:
|
||||
// DECL_GFX_PREFS(Live,"gl.msaa-level",MSAALevel,uint32_t,2);
|
||||
// DECL_GFX_PREF(Live,"gl.msaa-level",MSAALevel,uint32_t,2);
|
||||
// means that every time you call
|
||||
// uint32_t var = gfxPrefs::MSAALevel();
|
||||
// from any thread, you will get the most up to date preference value of
|
||||
@ -51,7 +51,7 @@
|
||||
// values changing mid execution, and if you're using those preferences
|
||||
// in any setup and initialization, you may need to do extra work.
|
||||
|
||||
#define DECL_GFX_PREFS(Update, Pref, Name, Type, Default) \
|
||||
#define DECL_GFX_PREF(Update, Pref, Name, Type, Default) \
|
||||
public: \
|
||||
static Type Name() { MOZ_ASSERT(Exists()); return One().mPref##Name.mValue; } \
|
||||
private: \
|
||||
@ -99,10 +99,14 @@ private:
|
||||
};
|
||||
|
||||
public:
|
||||
// This is where DECL_GFX_PREFS for each of the preferences should go.
|
||||
// This is where DECL_GFX_PREF for each of the preferences should go.
|
||||
// We will keep these in an alphabetical order to make it easier to see if
|
||||
// a method accessing a pref already exists. Just add yours in the list.
|
||||
|
||||
DECL_GFX_PREF(Once, "gfx.work-around-driver-bugs", WorkAroundDriverBugs, bool, true);
|
||||
|
||||
DECL_GFX_PREF(Live, "gl.msaa-level", MSAALevel, uint32_t, 2);
|
||||
|
||||
public:
|
||||
// Manage the singleton:
|
||||
static gfxPrefs& One()
|
||||
@ -133,6 +137,6 @@ private:
|
||||
gfxPrefs& operator=(const gfxPrefs&) MOZ_DELETE;
|
||||
};
|
||||
|
||||
#undef DECL_GFX_PREFS /* Don't need it outside of this file */
|
||||
#undef DECL_GFX_PREF /* Don't need it outside of this file */
|
||||
|
||||
#endif /* GFX_PREFS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user