| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
| 9 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 paint.setTextSize(48); // draw big glyphs to really stress the atlas | 92 paint.setTextSize(48); // draw big glyphs to really stress the atlas |
| 93 | 93 |
| 94 SkString familyName; | 94 SkString familyName; |
| 95 fm->getFamilyName(i, &familyName); | 95 fm->getFamilyName(i, &familyName); |
| 96 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); | 96 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); |
| 97 for (int j = 0; j < set->count(); ++j) { | 97 for (int j = 0; j < set->count(); ++j) { |
| 98 SkFontStyle fs; | 98 SkFontStyle fs; |
| 99 set->getStyle(j, &fs, nullptr); | 99 set->getStyle(j, &fs, nullptr); |
| 100 | 100 |
| 101 // We use a typeface which randomy returns unexpected mask formats t
o fuzz | 101 // We use a typeface which randomy returns unexpected mask formats t
o fuzz |
| 102 SkAutoTUnref<SkTypeface> orig(set->createTypeface(j)); | 102 sk_sp<SkTypeface> orig(set->createTypeface(j)); |
| 103 if (normal) { | 103 if (normal) { |
| 104 paint.setTypeface(orig); | 104 paint.setTypeface(orig); |
| 105 } else { | 105 } else { |
| 106 SkAutoTUnref<SkTypeface> typeface(new SkRandomTypeface(orig, pai
nt, true)); | 106 paint.setTypeface(sk_make_sp<SkRandomTypeface>(orig, paint, true
)); |
| 107 paint.setTypeface(typeface); | |
| 108 } | 107 } |
| 109 | 108 |
| 110 SkTextBlobBuilder builder; | 109 SkTextBlobBuilder builder; |
| 111 for (int aa = 0; aa < 2; aa++) { | 110 for (int aa = 0; aa < 2; aa++) { |
| 112 for (int subpixel = 0; subpixel < 2; subpixel++) { | 111 for (int subpixel = 0; subpixel < 2; subpixel++) { |
| 113 for (int lcd = 0; lcd < 2; lcd++) { | 112 for (int lcd = 0; lcd < 2; lcd++) { |
| 114 paint.setAntiAlias(SkToBool(aa)); | 113 paint.setAntiAlias(SkToBool(aa)); |
| 115 paint.setSubpixelText(SkToBool(subpixel)); | 114 paint.setSubpixelText(SkToBool(subpixel)); |
| 116 paint.setLCDRenderText(SkToBool(lcd)); | 115 paint.setLCDRenderText(SkToBool(lcd)); |
| 117 if (!SkToBool(lcd)) { | 116 if (!SkToBool(lcd)) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 164 } |
| 166 | 165 |
| 167 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobAbnormal, reporter, ctxInfo) { | 166 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobAbnormal, reporter, ctxInfo) { |
| 168 text_blob_cache_inner(reporter, ctxInfo.grContext(), 256, 256, 10, false, fa
lse); | 167 text_blob_cache_inner(reporter, ctxInfo.grContext(), 256, 256, 10, false, fa
lse); |
| 169 } | 168 } |
| 170 | 169 |
| 171 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobStressAbnormal, reporter, ctxInfo) { | 170 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobStressAbnormal, reporter, ctxInfo) { |
| 172 text_blob_cache_inner(reporter, ctxInfo.grContext(), 256, 256, 10, false, tr
ue); | 171 text_blob_cache_inner(reporter, ctxInfo.grContext(), 256, 256, 10, false, tr
ue); |
| 173 } | 172 } |
| 174 #endif | 173 #endif |
| OLD | NEW |