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

Side by Side Diff: tests/TextBlobTest.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore deleted Android code. 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 unified diff | Download patch
« no previous file with comments | « tests/TextBlobCacheTest.cpp ('k') | tests/TypefaceTest.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 "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkPoint.h" 9 #include "SkPoint.h"
10 #include "SkTextBlobRunIterator.h" 10 #include "SkTextBlobRunIterator.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 SkAutoTUnref<const SkTextBlob> blob(builder.build()); 171 SkAutoTUnref<const SkTextBlob> blob(builder.build());
172 REPORTER_ASSERT(reporter, blob->bounds().isEmpty()); 172 REPORTER_ASSERT(reporter, blob->bounds().isEmpty());
173 } 173 }
174 } 174 }
175 175
176 // Verify that text-related properties are captured in run paints. 176 // Verify that text-related properties are captured in run paints.
177 static void TestPaintProps(skiatest::Reporter* reporter) { 177 static void TestPaintProps(skiatest::Reporter* reporter) {
178 SkPaint font; 178 SkPaint font;
179 font.setTextEncoding(SkPaint::kGlyphID_TextEncoding); 179 font.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
180 180
181 SkAutoTUnref<SkTypeface> typeface(SkTypeface::RefDefault());
182
183 // Kitchen sink font. 181 // Kitchen sink font.
184 font.setTextSize(42); 182 font.setTextSize(42);
185 font.setTextScaleX(4.2f); 183 font.setTextScaleX(4.2f);
186 font.setTypeface(typeface); 184 font.setTypeface(SkTypeface::MakeDefault());
187 font.setTextSkewX(0.42f); 185 font.setTextSkewX(0.42f);
188 font.setTextAlign(SkPaint::kCenter_Align); 186 font.setTextAlign(SkPaint::kCenter_Align);
189 font.setHinting(SkPaint::kFull_Hinting); 187 font.setHinting(SkPaint::kFull_Hinting);
190 font.setAntiAlias(true); 188 font.setAntiAlias(true);
191 font.setUnderlineText(true); 189 font.setUnderlineText(true);
192 font.setStrikeThruText(true); 190 font.setStrikeThruText(true);
193 font.setFakeBoldText(true); 191 font.setFakeBoldText(true);
194 font.setLinearText(true); 192 font.setLinearText(true);
195 font.setSubpixelText(true); 193 font.setSubpixelText(true);
196 font.setDevKernText(true); 194 font.setDevKernText(true);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 }; 342 };
345 343
346 DEF_TEST(TextBlob_builder, reporter) { 344 DEF_TEST(TextBlob_builder, reporter) {
347 TextBlobTester::TestBuilder(reporter); 345 TextBlobTester::TestBuilder(reporter);
348 TextBlobTester::TestBounds(reporter); 346 TextBlobTester::TestBounds(reporter);
349 } 347 }
350 348
351 DEF_TEST(TextBlob_paint, reporter) { 349 DEF_TEST(TextBlob_paint, reporter) {
352 TextBlobTester::TestPaintProps(reporter); 350 TextBlobTester::TestPaintProps(reporter);
353 } 351 }
OLDNEW
« no previous file with comments | « tests/TextBlobCacheTest.cpp ('k') | tests/TypefaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698