diff options
author | Mike Klein <mtklein@chromium.org> | 2016-10-04 15:45:56 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-04 20:13:31 +0000 |
commit | 511f2d79bf6ea0ee858a3468d3aa8dcbfca58648 (patch) | |
tree | 50d33801abe2245cd147ca4bc477f6f205c0a494 /src/core/SkScan.h | |
parent | 1834242ec6e3cd62669227d394bc79e1cd66dcfb (diff) |
Make global use-analytic-AA bit threadsafe.
I also had to cut it down to just a global atomic bool... as a field in a global singleton accessed through instance(), it's very hard to make threadsafe.
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2937
Change-Id: If80be987906dd521fbe644d1d0d577009f06d0e3
Reviewed-on: https://skia-review.googlesource.com/2937
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkScan.h')
-rw-r--r-- | src/core/SkScan.h | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/core/SkScan.h b/src/core/SkScan.h index 1e3d60a290..7d513693fe 100644 --- a/src/core/SkScan.h +++ b/src/core/SkScan.h @@ -11,6 +11,7 @@ #include "SkFixed.h" #include "SkRect.h" +#include <atomic> class SkRasterClip; class SkRegion; @@ -22,21 +23,7 @@ class SkPath; */ typedef SkIRect SkXRect; -class GlobalAAConfig { -private: - GlobalAAConfig() {} - -public: - bool fUseAnalyticAA = false; - - GlobalAAConfig(const GlobalAAConfig&) = delete; - void operator=(const GlobalAAConfig&) = delete; - - static GlobalAAConfig& getInstance() { - static GlobalAAConfig instance; - return instance; - } -}; +extern std::atomic<bool> gSkUseAnalyticAA; class AdditiveBlitter; |