diff options
author | reed <reed@google.com> | 2016-05-05 01:28:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-05 01:28:56 -0700 |
commit | 82da9a8aa0ce648f36882830765b42e0ada6c0fa (patch) | |
tree | e7a40b16493db77e7b03ffe13a06491f2d8e4063 /src/fonts | |
parent | d9f5d20f81b15190fa858eda1f536deae21e8e78 (diff) |
Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1945293004/ )
Reason for revert:
previous revert unneeded (I think)
Original issue's description:
> Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ )
>
> Reason for revert:
> broken the Mac and Linux builders, e.g.:
>
> https://build.chromium.org/p/chromium/builders/Mac/builds/15151
> https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052
>
> Original issue's description:
> > SkOncePtr -> SkOnce
> >
> > It's always nice to kill off a synchronization primitive.
> > And while less terse, I think this new code reads more clearly.
> >
> > ... and, SkOncePtr's tests were the only thing now using sk_num_cores()
> > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.
> >
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
> > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
> >
> > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02
>
> TBR=herb@google.com,mtklein@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b
TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review-Url: https://codereview.chromium.org/1949313003
Diffstat (limited to 'src/fonts')
-rw-r--r-- | src/fonts/SkRemotableFontMgr.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fonts/SkRemotableFontMgr.cpp b/src/fonts/SkRemotableFontMgr.cpp index 41e3bc3235..aca8a0b193 100644 --- a/src/fonts/SkRemotableFontMgr.cpp +++ b/src/fonts/SkRemotableFontMgr.cpp @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -#include "SkOncePtr.h" +#include "SkOnce.h" #include "SkRemotableFontMgr.h" SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity** data) @@ -15,7 +15,9 @@ SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity *data = fData; } -SK_DECLARE_STATIC_ONCE_PTR(SkRemotableFontIdentitySet, empty); SkRemotableFontIdentitySet* SkRemotableFontIdentitySet::NewEmpty() { - return SkRef(empty.get([]{ return new SkRemotableFontIdentitySet; })); + static SkOnce once; + static SkRemotableFontIdentitySet* empty; + once([]{ empty = new SkRemotableFontIdentitySet; }); + return SkRef(empty); } |