diff options
author | mtklein <mtklein@google.com> | 2015-09-09 07:10:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-09 07:10:42 -0700 |
commit | 2ac6793efc9b33f6104f9c39810bee5714bdc208 (patch) | |
tree | 9d7e8e1e89d3fae55e7f6eabc9139fa28989d561 /src/fonts | |
parent | 62fb1ba1786863e545c89839b5706ad5151cec15 (diff) |
Revert of Port uses of SkLazyPtr to SkOncePtr. (patchset #7 id:110001 of https://codereview.chromium.org/1322933005/ )
Reason for revert:
Breaks Chrome roll.
obj/skia/ext/skia_chrome.skia_memory_dump_provider.o
does not have -I include/private on its include path, but transitively includes SkMessageBus.h.
Original issue's description:
> 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
>
> Committed: https://skia.googlesource.com/skia/+/a1254acdb344174e761f5061c820559dab64a74c
TBR=herb@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1334523002
Diffstat (limited to 'src/fonts')
-rw-r--r-- | src/fonts/SkRemotableFontMgr.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fonts/SkRemotableFontMgr.cpp b/src/fonts/SkRemotableFontMgr.cpp index 41e3bc3235..5299fad5fd 100644 --- a/src/fonts/SkRemotableFontMgr.cpp +++ b/src/fonts/SkRemotableFontMgr.cpp @@ -5,9 +5,10 @@ * found in the LICENSE file. */ -#include "SkOncePtr.h" #include "SkRemotableFontMgr.h" +#include "SkLazyPtr.h" + SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity** data) : fCount(count), fData(count) { @@ -15,7 +16,12 @@ SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity *data = fData; } -SK_DECLARE_STATIC_ONCE_PTR(SkRemotableFontIdentitySet, empty); +// 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); SkRemotableFontIdentitySet* SkRemotableFontIdentitySet::NewEmpty() { - return SkRef(empty.get([]{ return new SkRemotableFontIdentitySet; })); + return SkRef(empty.get()); } |