Bug 989349 - part 2 - eliminate static constructor in GLContextProviderGLX.cpp; r=bjacob

This commit is contained in:
Nathan Froyd 2014-03-26 09:26:11 -04:00
Родитель 781fda6642
Коммит d341118272
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -1190,14 +1190,20 @@ GLContextProviderGLX::CreateOffscreen(const gfxIntSize& size,
}
static StaticRefPtr<GLContext> gGlobalContext;
// TODO move that out of static initializaion
static bool gUseContextSharing = getenv("MOZ_DISABLE_CONTEXT_SHARING_GLX") == 0;
GLContext*
GLContextProviderGLX::GetGlobalContext()
{
static bool checkedContextSharing = false;
static bool useContextSharing = false;
if (!checkedContextSharing) {
useContextSharing = getenv("MOZ_DISABLE_CONTEXT_SHARING_GLX") == 0;
checkedContextSharing = true;
}
// TODO: get GLX context sharing to work well with multiple threads
if (!gUseContextSharing) {
if (!useContextSharing) {
return nullptr;
}