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

Unified Diff: tests/SerializationTest.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/SerializationTest.cpp
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index 9e9b221cd287800c74dd8c19cde24c1273092610..4750bbe25d436a13de76f62ede826487c719efb4 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -322,14 +322,14 @@
}
REPORTER_ASSERT(reporter, 0 == pixelErrors);
}
-static void serialize_and_compare_typeface(sk_sp<SkTypeface> typeface, const char* text,
+static void serialize_and_compare_typeface(SkTypeface* typeface, const char* text,
skiatest::Reporter* reporter)
{
// Create a paint with the typeface.
SkPaint paint;
paint.setColor(SK_ColorGRAY);
paint.setTextSize(SkIntToScalar(30));
- paint.setTypeface(std::move(typeface));
+ paint.setTypeface(typeface);
// Paint some text.
SkPictureRecorder recorder;
@@ -357,11 +357,11 @@
{
// Load typeface from file to test CreateFromFile with index.
SkString filename = GetResourcePath("/fonts/test.ttc");
- sk_sp<SkTypeface> typeface(SkTypeface::MakeFromFile(filename.c_str(), 1));
+ SkAutoTUnref<SkTypeface> typeface(SkTypeface::CreateFromFile(filename.c_str(), 1));
if (!typeface) {
INFOF(reporter, "Could not run fontstream test because test.ttc not found.");
} else {
- serialize_and_compare_typeface(std::move(typeface), "A!", reporter);
+ serialize_and_compare_typeface(typeface, "A!", reporter);
}
}
@@ -372,12 +372,12 @@
INFOF(reporter, "Could not run fontstream test because Distortable.ttf not found.");
} else {
SkFixed axis = SK_FixedSqrt2;
- sk_sp<SkTypeface> typeface(SkTypeface::MakeFromFontData(
+ SkAutoTUnref<SkTypeface> typeface(SkTypeface::CreateFromFontData(
new SkFontData(distortable.release(), 0, &axis, 1)));
if (!typeface) {
INFOF(reporter, "Could not run fontstream test because Distortable.ttf not created.");
} else {
- serialize_and_compare_typeface(std::move(typeface), "abc", reporter);
+ serialize_and_compare_typeface(typeface, "abc", reporter);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698