mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1278927 - TSan: data race image/imgFrame.cpp on hasCheckedOptimize. r=seth.
This commit is contained in:
parent
a4603ba357
commit
5b033cd6c7
@ -15,8 +15,6 @@
|
||||
#include "gfxUtils.h"
|
||||
#include "gfxAlphaRecovery.h"
|
||||
|
||||
static bool gDisableOptimize = false;
|
||||
|
||||
#include "GeckoProfiler.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "MainThreadUtils.h"
|
||||
@ -149,13 +147,6 @@ imgFrame::imgFrame()
|
||||
, mSinglePixel(false)
|
||||
, mCompositingFailed(false)
|
||||
{
|
||||
static bool hasCheckedOptimize = false;
|
||||
if (!hasCheckedOptimize) {
|
||||
if (PR_GetEnv("MOZ_DISABLE_IMAGE_OPTIMIZE")) {
|
||||
gDisableOptimize = true;
|
||||
}
|
||||
hasCheckedOptimize = true;
|
||||
}
|
||||
}
|
||||
|
||||
imgFrame::~imgFrame()
|
||||
@ -339,6 +330,16 @@ imgFrame::Optimize()
|
||||
MOZ_ASSERT(mLockCount == 1,
|
||||
"Should only optimize when holding the lock exclusively");
|
||||
|
||||
// Check whether image optimization is disabled -- not thread safe!
|
||||
static bool gDisableOptimize = false;
|
||||
static bool hasCheckedOptimize = false;
|
||||
if (!hasCheckedOptimize) {
|
||||
if (PR_GetEnv("MOZ_DISABLE_IMAGE_OPTIMIZE")) {
|
||||
gDisableOptimize = true;
|
||||
}
|
||||
hasCheckedOptimize = true;
|
||||
}
|
||||
|
||||
// Don't optimize during shutdown because gfxPlatform may not be available.
|
||||
if (ShutdownTracker::ShutdownHasStarted()) {
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user