Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(876)

Unified Diff: src/fonts/SkRemotableFontMgr.cpp

Issue 1322933005: Port uses of SkLazyPtr to SkOncePtr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: name Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/lazy/SkDiscardableMemoryPool.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fonts/SkRemotableFontMgr.cpp
diff --git a/src/fonts/SkRemotableFontMgr.cpp b/src/fonts/SkRemotableFontMgr.cpp
index 5299fad5fdcc1d03d0254137a92316fa12679693..41e3bc3235b67b1756e333bb8988c36bc58f3f0f 100644
--- a/src/fonts/SkRemotableFontMgr.cpp
+++ b/src/fonts/SkRemotableFontMgr.cpp
@@ -5,10 +5,9 @@
* found in the LICENSE file.
*/
+#include "SkOncePtr.h"
#include "SkRemotableFontMgr.h"
-#include "SkLazyPtr.h"
-
SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity** data)
: fCount(count), fData(count)
{
@@ -16,12 +15,7 @@ SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity
*data = fData;
}
-// As a template argument, this must have external linkage.
-SkRemotableFontIdentitySet* sk_remotable_font_identity_set_new() {
- return new SkRemotableFontIdentitySet;
-}
-
-SK_DECLARE_STATIC_LAZY_PTR(SkRemotableFontIdentitySet, empty, sk_remotable_font_identity_set_new);
+SK_DECLARE_STATIC_ONCE_PTR(SkRemotableFontIdentitySet, empty);
SkRemotableFontIdentitySet* SkRemotableFontIdentitySet::NewEmpty() {
- return SkRef(empty.get());
+ return SkRef(empty.get([]{ return new SkRemotableFontIdentitySet; }));
}
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/lazy/SkDiscardableMemoryPool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698