| Index: src/core/SkMiniRecorder.cpp
|
| diff --git a/src/core/SkMiniRecorder.cpp b/src/core/SkMiniRecorder.cpp
|
| index 2d5b0943e58eb646e767d782017bcc431d67449f..378f4304b392d682038362cede3babc698d04b3f 100644
|
| --- a/src/core/SkMiniRecorder.cpp
|
| +++ b/src/core/SkMiniRecorder.cpp
|
| @@ -8,7 +8,7 @@
|
| #include "SkCanvas.h"
|
| #include "SkTLazy.h"
|
| #include "SkMiniRecorder.h"
|
| -#include "SkOncePtr.h"
|
| +#include "SkOnce.h"
|
| #include "SkPicture.h"
|
| #include "SkPictureCommon.h"
|
| #include "SkRecordDraw.h"
|
| @@ -27,7 +27,6 @@
|
| int numSlowPaths() const override { return 0; }
|
| bool willPlayBackBitmaps() const override { return false; }
|
| };
|
| -SK_DECLARE_STATIC_ONCE_PTR(SkEmptyPicture, gEmptyPicture);
|
|
|
| template <typename T>
|
| class SkMiniPicture final : public SkPicture {
|
| @@ -107,8 +106,13 @@
|
| fState = State::kEmpty; \
|
| return sk_make_sp<SkMiniPicture<Type>>(cull, reinterpret_cast<Type*>(fBuffer.get()))
|
|
|
| + static SkOnce once;
|
| + static SkPicture* empty;
|
| +
|
| switch (fState) {
|
| - case State::kEmpty: return sk_ref_sp(gEmptyPicture.get([]{ return new SkEmptyPicture; }));
|
| + case State::kEmpty:
|
| + once([]{ empty = new SkEmptyPicture; });
|
| + return sk_ref_sp(empty);
|
| CASE(DrawBitmapRectFixedSize);
|
| CASE(DrawPath);
|
| CASE(DrawRect);
|
|
|