OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkData.h" | 8 #include "SkData.h" |
9 #include "SkOTTable_OS_2.h" | 9 #include "SkOTTable_OS_2.h" |
10 #include "SkSFNTHeader.h" | 10 #include "SkSFNTHeader.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (!stream) { | 76 if (!stream) { |
77 REPORT_FAILURE(reporter, "/fonts/Em.ttf", SkString("Cannot load resource
")); | 77 REPORT_FAILURE(reporter, "/fonts/Em.ttf", SkString("Cannot load resource
")); |
78 return; | 78 return; |
79 } | 79 } |
80 sk_sp<SkData> data(SkData::MakeFromStream(stream.get(), stream->getLength())
); | 80 sk_sp<SkData> data(SkData::MakeFromStream(stream.get(), stream->getLength())
); |
81 | 81 |
82 using SkFS = SkFontStyle; | 82 using SkFS = SkFontStyle; |
83 for (int weight = SkFS::kInvisible_Weight; weight <= SkFS::kExtraBlack_Weigh
t; ++weight) { | 83 for (int weight = SkFS::kInvisible_Weight; weight <= SkFS::kExtraBlack_Weigh
t; ++weight) { |
84 TypefaceStyle_test(reporter, weight, 5, data.get()); | 84 TypefaceStyle_test(reporter, weight, 5, data.get()); |
85 } | 85 } |
86 for (int width = SkFS::kUltraCondensed_Width; width <= SkFS::kUltaExpanded_W
idth; ++width) { | 86 for (int width = SkFS::kUltraCondensed_Width; width <= SkFS::kUltraExpanded_
Width; ++width) { |
87 TypefaceStyle_test(reporter, 400, width, data.get()); | 87 TypefaceStyle_test(reporter, 400, width, data.get()); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 DEF_TEST(Typeface, reporter) { | 91 DEF_TEST(Typeface, reporter) { |
92 | 92 |
93 sk_sp<SkTypeface> t1(SkTypeface::MakeFromName(nullptr, SkFontStyle())); | 93 sk_sp<SkTypeface> t1(SkTypeface::MakeFromName(nullptr, SkFontStyle())); |
94 sk_sp<SkTypeface> t2(SkTypeface::MakeDefault(SkTypeface::kNormal)); | 94 sk_sp<SkTypeface> t2(SkTypeface::MakeDefault(SkTypeface::kNormal)); |
95 | 95 |
96 REPORTER_ASSERT(reporter, SkTypeface::Equal(t1.get(), t2.get())); | 96 REPORTER_ASSERT(reporter, SkTypeface::Equal(t1.get(), t2.get())); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 REPORTER_ASSERT(reporter, count(reporter, cache) == 2); | 166 REPORTER_ASSERT(reporter, count(reporter, cache) == 2); |
167 cache.purgeAll(); | 167 cache.purgeAll(); |
168 REPORTER_ASSERT(reporter, count(reporter, cache) == 2); | 168 REPORTER_ASSERT(reporter, count(reporter, cache) == 2); |
169 } | 169 } |
170 REPORTER_ASSERT(reporter, count(reporter, cache) == 2); | 170 REPORTER_ASSERT(reporter, count(reporter, cache) == 2); |
171 cache.purgeAll(); | 171 cache.purgeAll(); |
172 REPORTER_ASSERT(reporter, count(reporter, cache) == 1); | 172 REPORTER_ASSERT(reporter, count(reporter, cache) == 1); |
173 } | 173 } |
174 REPORTER_ASSERT(reporter, t1->unique()); | 174 REPORTER_ASSERT(reporter, t1->unique()); |
175 } | 175 } |
OLD | NEW |