diff options
author | bungeman <bungeman@google.com> | 2016-05-12 10:09:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-12 10:09:31 -0700 |
commit | 13b9c95295f4c5732e34574789e721a6bc08f7b4 (patch) | |
tree | c3ef0aa2af9890c03cb79968f32166af39fba9ba /bench/SkGlyphCacheBench.cpp | |
parent | 40d21de8b6620d724f34bdc85af1dcb593d33fe0 (diff) |
Move SkTypeface to sk_sp.
Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002
Review-Url: https://codereview.chromium.org/1933393002
Diffstat (limited to 'bench/SkGlyphCacheBench.cpp')
-rw-r--r-- | bench/SkGlyphCacheBench.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bench/SkGlyphCacheBench.cpp b/bench/SkGlyphCacheBench.cpp index 2e0429fce3..c5e40af746 100644 --- a/bench/SkGlyphCacheBench.cpp +++ b/bench/SkGlyphCacheBench.cpp @@ -53,18 +53,15 @@ protected: void onDraw(int loops, SkCanvas*) override { size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit(); SkGraphics::SetFontCacheLimit(fCacheSize); - SkTypeface* typeface = sk_tool_utils::create_portable_typeface( - "serif", SkTypeface::kItalic); SkPaint paint; paint.setAntiAlias(true); paint.setSubpixelText(true); - paint.setTypeface(typeface); + paint.setTypeface(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic)); for (int work = 0; work < loops; work++) { do_font_stuff(&paint); } SkGraphics::SetFontCacheLimit(oldCacheLimitSize); - SkSafeUnref(typeface); } private: @@ -90,7 +87,7 @@ protected: void onDraw(int loops, SkCanvas*) override { size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit(); SkGraphics::SetFontCacheLimit(fCacheSize); - SkTypeface* typefaces[] = + sk_sp<SkTypeface> typefaces[] = {sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic), sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kItalic)}; @@ -104,8 +101,6 @@ protected: }); } SkGraphics::SetFontCacheLimit(oldCacheLimitSize); - SkSafeUnref(typefaces[0]); - SkSafeUnref(typefaces[1]); } private: |