| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |