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

Side by Side Diff: tests/FontObjTest.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « tests/FontMgrTest.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkFont.h" 8 #include "SkFont.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 { SK_Scalar1/2, 0 }, 71 { SK_Scalar1/2, 0 },
72 // these two exercise obliquing (skew) 72 // these two exercise obliquing (skew)
73 { SK_Scalar1, -SK_Scalar1/4 }, 73 { SK_Scalar1, -SK_Scalar1/4 },
74 { SK_Scalar1/2, -SK_Scalar1/4 }, 74 { SK_Scalar1/2, -SK_Scalar1/4 },
75 }; 75 };
76 76
77 SkPaint paint; 77 SkPaint paint;
78 char txt[] = "long.text.with.lots.of.dots."; 78 char txt[] = "long.text.with.lots.of.dots.";
79 79
80 for (size_t i = 0; i < SK_ARRAY_COUNT(faces); i++) { 80 for (size_t i = 0; i < SK_ARRAY_COUNT(faces); i++) {
81 paint.setTypeface(SkTypeface::MakeFromName(faces[i], SkTypeface::kNormal )); 81 paint.setTypeface(SkTypeface::MakeFromName(faces[i], SkFontStyle()));
82 82
83 for (size_t j = 0; j < SK_ARRAY_COUNT(settings); j++) { 83 for (size_t j = 0; j < SK_ARRAY_COUNT(settings); j++) {
84 paint.setHinting(settings[j].hinting); 84 paint.setHinting(settings[j].hinting);
85 paint.setLinearText((settings[j].flags & SkPaint::kLinearText_Flag) != 0); 85 paint.setLinearText((settings[j].flags & SkPaint::kLinearText_Flag) != 0);
86 paint.setSubpixelText((settings[j].flags & SkPaint::kSubpixelText_Fl ag) != 0); 86 paint.setSubpixelText((settings[j].flags & SkPaint::kSubpixelText_Fl ag) != 0);
87 87
88 for (size_t k = 0; k < SK_ARRAY_COUNT(gScaleRec); ++k) { 88 for (size_t k = 0; k < SK_ARRAY_COUNT(gScaleRec); ++k) {
89 paint.setTextScaleX(gScaleRec[k].fScaleX); 89 paint.setTextScaleX(gScaleRec[k].fScaleX);
90 paint.setTextSkewX(gScaleRec[k].fSkewX); 90 paint.setTextSkewX(gScaleRec[k].fSkewX);
91 91
(...skipping 18 matching lines...) Expand all
110 } 110 }
111 } 111 }
112 } 112 }
113 } 113 }
114 114
115 DEF_TEST(FontObj, reporter) { 115 DEF_TEST(FontObj, reporter) {
116 test_cachedfont(reporter); 116 test_cachedfont(reporter);
117 } 117 }
118 118
119 // need tests for SkStrSearch 119 // need tests for SkStrSearch
OLDNEW
« no previous file with comments | « tests/FontMgrTest.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698