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

Side by Side Diff: tests/TextBlobTest.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 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());
182
181 // Kitchen sink font. 183 // Kitchen sink font.
182 font.setTextSize(42); 184 font.setTextSize(42);
183 font.setTextScaleX(4.2f); 185 font.setTextScaleX(4.2f);
184 font.setTypeface(SkTypeface::MakeDefault()); 186 font.setTypeface(typeface);
185 font.setTextSkewX(0.42f); 187 font.setTextSkewX(0.42f);
186 font.setTextAlign(SkPaint::kCenter_Align); 188 font.setTextAlign(SkPaint::kCenter_Align);
187 font.setHinting(SkPaint::kFull_Hinting); 189 font.setHinting(SkPaint::kFull_Hinting);
188 font.setAntiAlias(true); 190 font.setAntiAlias(true);
189 font.setUnderlineText(true); 191 font.setUnderlineText(true);
190 font.setStrikeThruText(true); 192 font.setStrikeThruText(true);
191 font.setFakeBoldText(true); 193 font.setFakeBoldText(true);
192 font.setLinearText(true); 194 font.setLinearText(true);
193 font.setSubpixelText(true); 195 font.setSubpixelText(true);
194 font.setDevKernText(true); 196 font.setDevKernText(true);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 }; 344 };
343 345
344 DEF_TEST(TextBlob_builder, reporter) { 346 DEF_TEST(TextBlob_builder, reporter) {
345 TextBlobTester::TestBuilder(reporter); 347 TextBlobTester::TestBuilder(reporter);
346 TextBlobTester::TestBounds(reporter); 348 TextBlobTester::TestBounds(reporter);
347 } 349 }
348 350
349 DEF_TEST(TextBlob_paint, reporter) { 351 DEF_TEST(TextBlob_paint, reporter) {
350 TextBlobTester::TestPaintProps(reporter); 352 TextBlobTester::TestPaintProps(reporter);
351 } 353 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698