aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/FontObjTest.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-05-12 10:09:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-12 10:09:31 -0700
commit13b9c95295f4c5732e34574789e721a6bc08f7b4 (patch)
treec3ef0aa2af9890c03cb79968f32166af39fba9ba /tests/FontObjTest.cpp
parent40d21de8b6620d724f34bdc85af1dcb593d33fe0 (diff)
Move SkTypeface to sk_sp.
Diffstat (limited to 'tests/FontObjTest.cpp')
-rw-r--r--tests/FontObjTest.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/FontObjTest.cpp b/tests/FontObjTest.cpp
index 9d18ce6b2e..66c8bd500f 100644
--- a/tests/FontObjTest.cpp
+++ b/tests/FontObjTest.cpp
@@ -23,7 +23,7 @@ static bool is_enable_bytecode_hints(const SkPaint& paint) {
}
static void test_cachedfont(skiatest::Reporter* reporter, const SkPaint& paint) {
- SkAutoTUnref<SkFont> font(SkFont::Testing_CreateFromPaint(paint));
+ sk_sp<SkFont> font(SkFont::Testing_CreateFromPaint(paint));
// Currently SkFont resolves null into the default, so only test if paint's is not null
if (paint.getTypeface()) {
@@ -78,8 +78,7 @@ static void test_cachedfont(skiatest::Reporter* reporter) {
char txt[] = "long.text.with.lots.of.dots.";
for (size_t i = 0; i < SK_ARRAY_COUNT(faces); i++) {
- SkAutoTUnref<SkTypeface> face(SkTypeface::CreateFromName(faces[i], SkTypeface::kNormal));
- paint.setTypeface(face);
+ paint.setTypeface(SkTypeface::MakeFromName(faces[i], SkTypeface::kNormal));
for (size_t j = 0; j < SK_ARRAY_COUNT(settings); j++) {
paint.setHinting(settings[j].hinting);
@@ -103,7 +102,7 @@ static void test_cachedfont(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, width1 == width2);
- SkAutoTUnref<SkFont> font(SkFont::Testing_CreateFromPaint(paint));
+ sk_sp<SkFont> font(SkFont::Testing_CreateFromPaint(paint));
SkScalar font_width1 = font->measureText(txt, strlen(txt), kUTF8_SkTextEncoding);
// measureText not yet implemented...
REPORTER_ASSERT(reporter, font_width1 == -1);