|
Modernize and trim down SkOnce.
The API and implementation are very much simplified.
You may not want to bother reading the diff.
As is our trend, SkOnce now uses <atomic> directly.
Member initialization means we don't need SK_DECLARE_STATIC_ONCE.
SkSpinlock already works this same way.
All uses of the old API taking an external bool* and Lock* were pessimal,
so I have not carried this sort of API forward. It's simpler, faster,
and more space-efficient to always use this single SkOnce class interface.
SkOnce weighs 2 bytes: a done bool and an SkSpinlock, also a bool internally.
This API refactoring opens up the opportunity to fuse those into a single
three-state byte if we'd like.
No public API changes.
TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1894893002
Committed: https://skia.googlesource.com/skia/+/d9dd4282118fc14eac735e6fa0b3ec53047b457f
Total comments: 5
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+65 lines, -167 lines) |
Patch |
|
M |
include/effects/SkColorCubeFilter.h
|
View
|
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
|
M |
include/gpu/GrResourceKey.h
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
include/ports/SkFontMgr_indirect.h
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
include/private/SkOnce.h
|
View
|
1
|
1 chunk |
+21 lines, -120 lines |
3 comments
|
Download
|
|
M |
src/core/SkGlobalInitialization_core.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/core/SkOpts.cpp
|
View
|
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/core/SkTaskGroup.cpp
|
View
|
|
1 chunk |
+3 lines, -3 lines |
2 comments
|
Download
|
|
M |
src/effects/SkColorCubeFilter.cpp
|
View
|
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/effects/gradients/SkGradientShader.cpp
|
View
|
|
3 chunks |
+2 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/effects/gradients/SkGradientShaderPriv.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/fonts/SkFontMgr_indirect.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrProgramElement.cpp
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/utils/win/SkDWrite.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
tests/OnceTest.cpp
|
View
|
|
2 chunks |
+13 lines, -13 lines |
0 comments
|
Download
|
|
M |
tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
Total messages: 23 (12 generated)
|