diff options
author | mtklein <mtklein@chromium.org> | 2016-05-02 07:19:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-02 07:19:41 -0700 |
commit | 59c12e3f0071acfa685346487e54a2a311066dac (patch) | |
tree | 5311ab7c77393dc85a8bb979b7c3b7f761a51e0b /src/core/SkBigPicture.h | |
parent | 57b46159740020ef904aaf41e9e5ae07106591cc (diff) |
remove non-static uses of SkOncePtr
Still slowly working through all the SK_DECLARE_STATIC_FOO macros.
SkOncePtr is complicating things by having SkOncePtr delete its pointer
and SkBaseOncePtr not. Simplify things by removing SkOncePtr, leaving
only the leaky SkBaseOncePtr.
We replace SkOncePtr<T> instead with SkOnce and T. In most cases this
did not need to be a pointer, and in some cases here we're even saving
a few bytes by replacing SkOncePtr<T> with SkOnce and a T.
The dependency map of SK_DECLARE_STATIC_FOO is:
SkBaseMutex -> SkBaseSemaphore -> SkBaseOncePtr
They're intertwined enough that I think I've got to do all three in one
next CL.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939503002
Review-Url: https://codereview.chromium.org/1939503002
Diffstat (limited to 'src/core/SkBigPicture.h')
-rw-r--r-- | src/core/SkBigPicture.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/SkBigPicture.h b/src/core/SkBigPicture.h index 0834709f8a..f9997f705b 100644 --- a/src/core/SkBigPicture.h +++ b/src/core/SkBigPicture.h @@ -8,7 +8,7 @@ #ifndef SkBigPicture_DEFINED #define SkBigPicture_DEFINED -#include "SkOncePtr.h" +#include "SkOnce.h" #include "SkPicture.h" #include "SkRect.h" #include "SkTemplates.h" @@ -65,7 +65,7 @@ public: private: struct Analysis { - explicit Analysis(const SkRecord&); + void init(const SkRecord&); bool suitableForGpuRasterization(const char** reason) const; @@ -81,7 +81,8 @@ private: const SkRect fCullRect; const size_t fApproxBytesUsedBySubPictures; - SkOncePtr<const Analysis> fAnalysis; + mutable SkOnce fAnalysisOnce; + mutable Analysis fAnalysis; SkAutoTUnref<const SkRecord> fRecord; SkAutoTDelete<const SnapshotArray> fDrawablePicts; SkAutoTUnref<const SkBBoxHierarchy> fBBH; |