зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1120611 - Avoid a data race for the rendering intent. r=jrmuizelaar
--HG-- extra : rebase_source : 54549a96e59772af1223d69e854d34d28e6d369c
This commit is contained in:
Родитель
3bed1dc615
Коммит
0cf06341a4
|
@ -135,10 +135,6 @@ static qcms_transform *gCMSRGBATransform = nullptr;
|
|||
static bool gCMSInitialized = false;
|
||||
static eCMSMode gCMSMode = eCMSMode_Off;
|
||||
|
||||
static bool gCMSIntentInitialized = false;
|
||||
static int gCMSIntent = QCMS_INTENT_DEFAULT;
|
||||
|
||||
|
||||
static void ShutdownCMS();
|
||||
|
||||
#include "mozilla/gfx/2D.h"
|
||||
|
@ -1752,9 +1748,7 @@ gfxPlatform::OffMainThreadCompositingEnabled()
|
|||
eCMSMode
|
||||
gfxPlatform::GetCMSMode()
|
||||
{
|
||||
if (gCMSInitialized == false) {
|
||||
gCMSInitialized = true;
|
||||
|
||||
if (!gCMSInitialized) {
|
||||
int32_t mode = gfxPrefs::CMSMode();
|
||||
if (mode >= 0 && mode < eCMSMode_AllCount) {
|
||||
gCMSMode = static_cast<eCMSMode>(mode);
|
||||
|
@ -1764,6 +1758,7 @@ gfxPlatform::GetCMSMode()
|
|||
if (enableV4) {
|
||||
qcms_enable_iccv4();
|
||||
}
|
||||
gCMSInitialized = true;
|
||||
}
|
||||
return gCMSMode;
|
||||
}
|
||||
|
@ -1771,25 +1766,19 @@ gfxPlatform::GetCMSMode()
|
|||
int
|
||||
gfxPlatform::GetRenderingIntent()
|
||||
{
|
||||
if (!gCMSIntentInitialized) {
|
||||
gCMSIntentInitialized = true;
|
||||
// gfxPrefs.h is using 0 as the default for the rendering
|
||||
// intent preference, based on that being the value for
|
||||
// QCMS_INTENT_DEFAULT. Assert here to catch if that ever
|
||||
// changes and we can then figure out what to do about it.
|
||||
MOZ_ASSERT(QCMS_INTENT_DEFAULT == 0);
|
||||
|
||||
// gfxPrefs.h is using 0 as the default for the rendering
|
||||
// intent preference, based on that being the value for
|
||||
// QCMS_INTENT_DEFAULT. Assert here to catch if that ever
|
||||
// changes and we can then figure out what to do about it.
|
||||
MOZ_ASSERT(QCMS_INTENT_DEFAULT == 0);
|
||||
|
||||
/* Try to query the pref system for a rendering intent. */
|
||||
int32_t pIntent = gfxPrefs::CMSRenderingIntent();
|
||||
if ((pIntent >= QCMS_INTENT_MIN) && (pIntent <= QCMS_INTENT_MAX)) {
|
||||
gCMSIntent = pIntent;
|
||||
} else {
|
||||
/* If the pref is out of range, use embedded profile. */
|
||||
gCMSIntent = -1;
|
||||
}
|
||||
}
|
||||
return gCMSIntent;
|
||||
/* Try to query the pref system for a rendering intent. */
|
||||
int32_t pIntent = gfxPrefs::CMSRenderingIntent();
|
||||
if ((pIntent < QCMS_INTENT_MIN) || (pIntent > QCMS_INTENT_MAX)) {
|
||||
/* If the pref is out of range, use embedded profile. */
|
||||
pIntent = -1;
|
||||
}
|
||||
return pIntent;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1987,7 +1976,6 @@ static void ShutdownCMS()
|
|||
}
|
||||
|
||||
// Reset the state variables
|
||||
gCMSIntent = -2;
|
||||
gCMSMode = eCMSMode_Off;
|
||||
gCMSInitialized = false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче