Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: tests/TextBlobCacheTest.cpp

Issue 1974783002: Revert of Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 sk_sp<SkTypeface> orig(set->createTypeface(j)); 102 SkAutoTUnref<SkTypeface> orig(set->createTypeface(j));
103 if (normal) { 103 if (normal) {
104 paint.setTypeface(orig); 104 paint.setTypeface(orig);
105 } else { 105 } else {
106 paint.setTypeface(sk_make_sp<SkRandomTypeface>(orig, paint, true )); 106 SkAutoTUnref<SkTypeface> typeface(new SkRandomTypeface(orig, pai nt, true));
107 paint.setTypeface(typeface);
107 } 108 }
108 109
109 SkTextBlobBuilder builder; 110 SkTextBlobBuilder builder;
110 for (int aa = 0; aa < 2; aa++) { 111 for (int aa = 0; aa < 2; aa++) {
111 for (int subpixel = 0; subpixel < 2; subpixel++) { 112 for (int subpixel = 0; subpixel < 2; subpixel++) {
112 for (int lcd = 0; lcd < 2; lcd++) { 113 for (int lcd = 0; lcd < 2; lcd++) {
113 paint.setAntiAlias(SkToBool(aa)); 114 paint.setAntiAlias(SkToBool(aa));
114 paint.setSubpixelText(SkToBool(subpixel)); 115 paint.setSubpixelText(SkToBool(subpixel));
115 paint.setLCDRenderText(SkToBool(lcd)); 116 paint.setLCDRenderText(SkToBool(lcd));
116 if (!SkToBool(lcd)) { 117 if (!SkToBool(lcd)) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 165 }
165 166
166 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobAbnormal, reporter, ctxInfo) { 167 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobAbnormal, reporter, ctxInfo) {
167 text_blob_cache_inner(reporter, ctxInfo.fGrContext, 256, 256, 10, false, fal se); 168 text_blob_cache_inner(reporter, ctxInfo.fGrContext, 256, 256, 10, false, fal se);
168 } 169 }
169 170
170 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobStressAbnormal, reporter, ctxInfo) { 171 DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobStressAbnormal, reporter, ctxInfo) {
171 text_blob_cache_inner(reporter, ctxInfo.fGrContext, 256, 256, 10, false, tru e); 172 text_blob_cache_inner(reporter, ctxInfo.fGrContext, 256, 256, 10, false, tru e);
172 } 173 }
173 #endif 174 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698