Index: src/core/SkData.cpp |
diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp |
index 995a30a542470e6bd37e7f9cd08d5d6cb9ab45fc..ea2da3dae462c74f2bba68a9af8fba80329ea647 100644 |
--- a/src/core/SkData.cpp |
+++ b/src/core/SkData.cpp |
@@ -7,7 +7,7 @@ |
#include "SkData.h" |
#include "SkOSFile.h" |
-#include "SkOncePtr.h" |
+#include "SkOnce.h" |
#include "SkReadBuffer.h" |
#include "SkStream.h" |
#include "SkWriteBuffer.h" |
@@ -80,10 +80,12 @@ |
/////////////////////////////////////////////////////////////////////////////// |
-SK_DECLARE_STATIC_ONCE_PTR(SkData, gEmpty); |
sk_sp<SkData> SkData::MakeEmpty() { |
- SkData* data = SkRef(gEmpty.get([]{return new SkData(nullptr, 0, nullptr, nullptr); })); |
- return sk_sp<SkData>(data); |
+ static SkOnce once; |
+ static SkData* empty; |
+ |
+ once([]{ empty = new SkData(nullptr, 0, nullptr, nullptr); }); |
+ return sk_ref_sp(empty); |
} |
// assumes fPtr was allocated via sk_malloc |