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

Unified Diff: bench/SkGlyphCacheBench.cpp

Issue 1974783002: Revert of Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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
Index: bench/SkGlyphCacheBench.cpp
diff --git a/bench/SkGlyphCacheBench.cpp b/bench/SkGlyphCacheBench.cpp
index c5e40af746949328a7fa14e945084d8101ce2a40..2e0429fce34a3babd0b9ed055b6f58f3f223eca6 100644
--- a/bench/SkGlyphCacheBench.cpp
+++ b/bench/SkGlyphCacheBench.cpp
@@ -53,15 +53,18 @@
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(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic));
+ paint.setTypeface(typeface);
for (int work = 0; work < loops; work++) {
do_font_stuff(&paint);
}
SkGraphics::SetFontCacheLimit(oldCacheLimitSize);
+ SkSafeUnref(typeface);
}
private:
@@ -87,7 +90,7 @@
void onDraw(int loops, SkCanvas*) override {
size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit();
SkGraphics::SetFontCacheLimit(fCacheSize);
- sk_sp<SkTypeface> typefaces[] =
+ SkTypeface* typefaces[] =
{sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic),
sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kItalic)};
@@ -101,6 +104,8 @@
});
}
SkGraphics::SetFontCacheLimit(oldCacheLimitSize);
+ SkSafeUnref(typefaces[0]);
+ SkSafeUnref(typefaces[1]);
}
private:
« no previous file with comments | « bench/CmapBench.cpp ('k') | bench/TextBench.cpp » ('j') | src/ports/SkFontMgr_android.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698