aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMiniRecorder.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-09-09 06:48:29 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-09 06:48:29 -0700
commita1254acdb344174e761f5061c820559dab64a74c (patch)
treee7337fb34009c082ae4887e0eb91e5027e100ba4 /src/core/SkMiniRecorder.cpp
parenta5783aeff042ccaf517e50dee3660a4925f5f694 (diff)
Port uses of SkLazyPtr to SkOncePtr.
This gives SkOncePtr a non-trivial destructor that uses std::default_delete by default. This is overrideable, as seen in SkColorTable. SK_DECLARE_STATIC_ONCE_PTR still just leaves its pointers hanging at EOP. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1322933005
Diffstat (limited to 'src/core/SkMiniRecorder.cpp')
-rw-r--r--src/core/SkMiniRecorder.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkMiniRecorder.cpp b/src/core/SkMiniRecorder.cpp
index 5161c64722..0a4859f379 100644
--- a/src/core/SkMiniRecorder.cpp
+++ b/src/core/SkMiniRecorder.cpp
@@ -7,8 +7,8 @@
#include "SkCanvas.h"
#include "SkTLazy.h"
-#include "SkLazyPtr.h"
#include "SkMiniRecorder.h"
+#include "SkOncePtr.h"
#include "SkPicture.h"
#include "SkPictureCommon.h"
#include "SkRecordDraw.h"
@@ -27,7 +27,7 @@ public:
int numSlowPaths() const override { return 0; }
bool willPlayBackBitmaps() const override { return false; }
};
-SK_DECLARE_STATIC_LAZY_PTR(SkEmptyPicture, gEmptyPicture);
+SK_DECLARE_STATIC_ONCE_PTR(SkEmptyPicture, gEmptyPicture);
template <typename T>
class SkMiniPicture final : public SkPicture {
@@ -108,7 +108,7 @@ SkPicture* SkMiniRecorder::detachAsPicture(const SkRect& cull) {
return new SkMiniPicture<Type>(cull, reinterpret_cast<Type*>(fBuffer.get()))
switch (fState) {
- case State::kEmpty: return SkRef(gEmptyPicture.get());
+ case State::kEmpty: return SkRef(gEmptyPicture.get([]{ return new SkEmptyPicture; }));
CASE(DrawBitmapRectFixedSize);
CASE(DrawPath);
CASE(DrawRect);