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

Side by Side Diff: tests/TextBlobCacheTest.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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
« no previous file with comments | « tests/Test.cpp ('k') | tests/TextBlobTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 for (int i = 0; i < count; i++) { 93 for (int i = 0; i < count; i++) {
94 SkPaint paint; 94 SkPaint paint;
95 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); 95 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
96 paint.setTextSize(48); // draw big glyphs to really stress the atlas 96 paint.setTextSize(48); // draw big glyphs to really stress the atlas
97 97
98 SkString familyName; 98 SkString familyName;
99 fm->getFamilyName(i, &familyName); 99 fm->getFamilyName(i, &familyName);
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, nullptr);
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(new SkRandomTypeface(orig, pai nt, 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));
121 if (!SkToBool(lcd)) { 121 if (!SkToBool(lcd)) {
122 paint.setTextSize(160); 122 paint.setTextSize(160);
123 } 123 }
124 const SkTextBlobBuilder::RunBuffer& run = builder.allocR un(paint, 124 const SkTextBlobBuilder::RunBuffer& run = builder.allocR un(paint,
125 maxTotalText, 125 maxTotalText,
126 0, 0, 126 0, 0,
127 NULL); 127 nullptr);
128 memcpy(run.glyphs, text.get(), maxTotalText * sizeof(uin t16_t)); 128 memcpy(run.glyphs, text.get(), maxTotalText * sizeof(uin t16_t));
129 } 129 }
130 } 130 }
131 } 131 }
132 SkNEW_APPEND_TO_TARRAY(&blobs, TextBlobWrapper, (builder.build())); 132 SkNEW_APPEND_TO_TARRAY(&blobs, TextBlobWrapper, (builder.build()));
133 } 133 }
134 } 134 }
135 135
136 // create surface where LCD is impossible 136 // create surface where LCD is impossible
137 info = SkImageInfo::MakeN32Premul(kWidth, kHeight); 137 info = SkImageInfo::MakeN32Premul(kWidth, kHeight);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « tests/Test.cpp ('k') | tests/TextBlobTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698