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

Unified Diff: tests/FontMgrTest.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: tests/FontMgrTest.cpp
diff --git a/tests/FontMgrTest.cpp b/tests/FontMgrTest.cpp
index 414631c58f066ed43ac201e278d6d2c51a13a201..92dc18b1353959d23dabf96f45227f9046f5b299 100644
--- a/tests/FontMgrTest.cpp
+++ b/tests/FontMgrTest.cpp
@@ -19,7 +19,7 @@
static void test_font(skiatest::Reporter* reporter) {
uint32_t flags = 0;
- sk_sp<SkFont> font(SkFont::Make(nullptr, 24, SkFont::kA8_MaskType, flags));
+ SkAutoTUnref<SkFont> font(SkFont::Create(nullptr, 24, SkFont::kA8_MaskType, flags));
REPORTER_ASSERT(reporter, font->getTypeface());
REPORTER_ASSERT(reporter, 24 == font->getSize());
@@ -39,7 +39,7 @@
REPORTER_ASSERT(reporter, glyphs[0] != glyphs[1]); // 'h' != 'e'
REPORTER_ASSERT(reporter, glyphs[2] == glyphs[3]); // 'l' == 'l'
- sk_sp<SkFont> newFont(font->makeWithSize(36));
+ SkAutoTUnref<SkFont> newFont(font->cloneWithSize(36));
REPORTER_ASSERT(reporter, newFont.get());
REPORTER_ASSERT(reporter, font->getTypeface() == newFont->getTypeface());
REPORTER_ASSERT(reporter, 36 == newFont->getSize()); // double check we haven't changed
@@ -47,7 +47,7 @@
SkPaint paint;
paint.setTextSize(18);
- font = SkFont::Testing_CreateFromPaint(paint);
+ font.reset(SkFont::Testing_CreateFromPaint(paint));
REPORTER_ASSERT(reporter, font.get());
REPORTER_ASSERT(reporter, font->getSize() == paint.getTextSize());
REPORTER_ASSERT(reporter, SkFont::kBW_MaskType == font->getMaskType());
@@ -64,12 +64,14 @@
};
for (size_t i = 0; i < SK_ARRAY_COUNT(inNames); ++i) {
- sk_sp<SkTypeface> first(SkTypeface::MakeFromName(inNames[i], SkTypeface::kNormal));
+ SkAutoTUnref<SkTypeface> first(SkTypeface::CreateFromName(inNames[i],
+ SkTypeface::kNormal));
if (nullptr == first.get()) {
continue;
}
for (int j = 0; j < 10; ++j) {
- sk_sp<SkTypeface> face(SkTypeface::MakeFromName(inNames[i], SkTypeface::kNormal));
+ SkAutoTUnref<SkTypeface> face(SkTypeface::CreateFromName(inNames[i],
+ SkTypeface::kNormal));
#if 0
SkString name;
face->getFamilyName(&name);

Powered by Google App Engine
This is Rietveld 408576698