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

Unified Diff: tests/PictureTest.cpp

Issue 1317913005: whitelist fallback typefaces (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove string change Created 5 years, 4 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/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index de4d1e3e001593446796bdbf232c9f848f00627a..45edc715efc2b67ce421b8194559469418586141 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1151,7 +1151,20 @@ static void test_gen_id(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, hasData->uniqueID() != empty->uniqueID());
}
+static void test_typeface(skiatest::Reporter* reporter) {
+ SkPictureRecorder recorder;
+ SkCanvas* canvas = recorder.beginRecording(10, 10);
+ SkPaint paint;
+ paint.setTypeface(SkTypeface::CreateFromName("Arial", SkTypeface::kItalic));
+ canvas->drawText("Q", 1, 0, 10, paint);
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+ REPORTER_ASSERT(reporter, picture->hasText());
+ SkDynamicMemoryWStream stream;
+ picture->serialize(&stream);
+}
+
DEF_TEST(Picture, reporter) {
+ test_typeface(reporter);
#ifdef SK_DEBUG
test_deleting_empty_picture();
test_serializing_empty_picture();

Powered by Google App Engine
This is Rietveld 408576698