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