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

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: Address comments. 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
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()); 181 sk_sp<SkTypeface> typeface(SkTypeface::MakeDefault());
182 182
183 // Kitchen sink font. 183 // Kitchen sink font.
184 font.setTextSize(42); 184 font.setTextSize(42);
185 font.setTextScaleX(4.2f); 185 font.setTextScaleX(4.2f);
186 font.setTypeface(typeface); 186 font.setTypeface(typeface);
f(malita) 2016/05/02 13:46:36 Nit: ditto
bungeman-skia 2016/05/02 20:24:55 Done.
187 font.setTextSkewX(0.42f); 187 font.setTextSkewX(0.42f);
188 font.setTextAlign(SkPaint::kCenter_Align); 188 font.setTextAlign(SkPaint::kCenter_Align);
189 font.setHinting(SkPaint::kFull_Hinting); 189 font.setHinting(SkPaint::kFull_Hinting);
190 font.setAntiAlias(true); 190 font.setAntiAlias(true);
191 font.setUnderlineText(true); 191 font.setUnderlineText(true);
192 font.setStrikeThruText(true); 192 font.setStrikeThruText(true);
193 font.setFakeBoldText(true); 193 font.setFakeBoldText(true);
194 font.setLinearText(true); 194 font.setLinearText(true);
195 font.setSubpixelText(true); 195 font.setSubpixelText(true);
196 font.setDevKernText(true); 196 font.setDevKernText(true);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 }; 344 };
345 345
346 DEF_TEST(TextBlob_builder, reporter) { 346 DEF_TEST(TextBlob_builder, reporter) {
347 TextBlobTester::TestBuilder(reporter); 347 TextBlobTester::TestBuilder(reporter);
348 TextBlobTester::TestBounds(reporter); 348 TextBlobTester::TestBounds(reporter);
349 } 349 }
350 350
351 DEF_TEST(TextBlob_paint, reporter) { 351 DEF_TEST(TextBlob_paint, reporter) {
352 TextBlobTester::TestPaintProps(reporter); 352 TextBlobTester::TestPaintProps(reporter);
353 } 353 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698