| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); | 100 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); |
| 101 for (int j = 0; j < set->count(); ++j) { | 101 for (int j = 0; j < set->count(); ++j) { |
| 102 SkFontStyle fs; | 102 SkFontStyle fs; |
| 103 set->getStyle(j, &fs, NULL); | 103 set->getStyle(j, &fs, NULL); |
| 104 | 104 |
| 105 // We use a typeface which randomy returns unexpected mask formats t
o fuzz | 105 // We use a typeface which randomy returns unexpected mask formats t
o fuzz |
| 106 SkAutoTUnref<SkTypeface> orig(set->createTypeface(j)); | 106 SkAutoTUnref<SkTypeface> orig(set->createTypeface(j)); |
| 107 if (normal) { | 107 if (normal) { |
| 108 paint.setTypeface(orig); | 108 paint.setTypeface(orig); |
| 109 } else { | 109 } else { |
| 110 SkAutoTUnref<SkTypeface> typeface(SkNEW_ARGS(SkRandomTypeface, (
orig, paint, true))); | 110 SkAutoTUnref<SkTypeface> typeface(new SkRandomTypeface(orig, pai
nt, true)); |
| 111 paint.setTypeface(typeface); | 111 paint.setTypeface(typeface); |
| 112 } | 112 } |
| 113 | 113 |
| 114 SkTextBlobBuilder builder; | 114 SkTextBlobBuilder builder; |
| 115 for (int aa = 0; aa < 2; aa++) { | 115 for (int aa = 0; aa < 2; aa++) { |
| 116 for (int subpixel = 0; subpixel < 2; subpixel++) { | 116 for (int subpixel = 0; subpixel < 2; subpixel++) { |
| 117 for (int lcd = 0; lcd < 2; lcd++) { | 117 for (int lcd = 0; lcd < 2; lcd++) { |
| 118 paint.setAntiAlias(SkToBool(aa)); | 118 paint.setAntiAlias(SkToBool(aa)); |
| 119 paint.setSubpixelText(SkToBool(subpixel)); | 119 paint.setSubpixelText(SkToBool(subpixel)); |
| 120 paint.setLCDRenderText(SkToBool(lcd)); | 120 paint.setLCDRenderText(SkToBool(lcd)); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 DEF_GPUTEST(TextBlobAbnormal, reporter, factory) { | 171 DEF_GPUTEST(TextBlobAbnormal, reporter, factory) { |
| 172 text_blob_cache_inner(reporter, factory, 256, 256, 10, false, false); | 172 text_blob_cache_inner(reporter, factory, 256, 256, 10, false, false); |
| 173 } | 173 } |
| 174 | 174 |
| 175 DEF_GPUTEST(TextBlobStressAbnormal, reporter, factory) { | 175 DEF_GPUTEST(TextBlobStressAbnormal, reporter, factory) { |
| 176 text_blob_cache_inner(reporter, factory, 256, 256, 10, false, true); | 176 text_blob_cache_inner(reporter, factory, 256, 256, 10, false, true); |
| 177 } | 177 } |
| 178 #endif | 178 #endif |
| OLD | NEW |