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

Side by Side Diff: src/gpu/effects/GrBitmapTextGeoProc.cpp

Issue 1213623022: fix up test create functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 5 years, 5 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 | « src/gpu/effects/GrBicubicEffect.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.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 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 "GrBitmapTextGeoProc.h" 8 #include "GrBitmapTextGeoProc.h"
9 #include "GrFontAtlasSizes.h" 9 #include "GrFontAtlasSizes.h"
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 GrGLPrimitiveProcessor* 145 GrGLPrimitiveProcessor*
146 GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt, 146 GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt,
147 const GrGLSLCaps& caps) const { 147 const GrGLSLCaps& caps) const {
148 return SkNEW_ARGS(GrGLBitmapTextGeoProc, (*this, bt)); 148 return SkNEW_ARGS(GrGLBitmapTextGeoProc, (*this, bt));
149 } 149 }
150 150
151 /////////////////////////////////////////////////////////////////////////////// 151 ///////////////////////////////////////////////////////////////////////////////
152 152
153 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc); 153 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc);
154 154
155 GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(SkRandom* random, 155 GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) {
156 GrContext*, 156 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
157 const GrCaps&, 157 GrProcessorUnitTest::kAlphaTextureIdx;
158 GrTexture* textures[]) {
159 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
160 GrProcessorUnitTest::kAlphaTextureIdx;
161 static const SkShader::TileMode kTileModes[] = { 158 static const SkShader::TileMode kTileModes[] = {
162 SkShader::kClamp_TileMode, 159 SkShader::kClamp_TileMode,
163 SkShader::kRepeat_TileMode, 160 SkShader::kRepeat_TileMode,
164 SkShader::kMirror_TileMode, 161 SkShader::kMirror_TileMode,
165 }; 162 };
166 SkShader::TileMode tileModes[] = { 163 SkShader::TileMode tileModes[] = {
167 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 164 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
168 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 165 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
169 }; 166 };
170 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode : 167 GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams:: kBilerp_FilterMode :
171 GrTextureParams::kNon e_FilterMode); 168 GrTextureParams::kNon e_FilterMode);
172 169
173 GrMaskFormat format; 170 GrMaskFormat format;
174 switch (random->nextULessThan(3)) { 171 switch (d->fRandom->nextULessThan(3)) {
175 default:
176 SkFAIL("Incomplete enum\n");
177 case 0: 172 case 0:
178 format = kA8_GrMaskFormat; 173 format = kA8_GrMaskFormat;
179 break; 174 break;
180 case 1: 175 case 1:
181 format = kA565_GrMaskFormat; 176 format = kA565_GrMaskFormat;
182 break; 177 break;
183 case 2: 178 case 2:
184 format = kARGB_GrMaskFormat; 179 format = kARGB_GrMaskFormat;
185 break; 180 break;
186 } 181 }
187 182
188 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params, 183 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params,
189 format, GrTest::TestMatrix(random), rando m->nextBool()); 184 format, GrTest::TestMatrix(d->fRandom),
185 d->fRandom->nextBool());
190 } 186 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBicubicEffect.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698