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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 18295008: Remove possiblity of NULL effect in GrEffectStage (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: wrap line Created 7 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 | Annotate | Revision Log
« include/gpu/GrEffectStage.h ('K') | « src/gpu/GrDrawState.h ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 // This is a GPU-backend specific test. It relies on static intializers to work 9 // This is a GPU-backend specific test. It relies on static intializers to work
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 // If adding this effect would exceed the max attrib count then gene rate a 166 // If adding this effect would exceed the max attrib count then gene rate a
167 // new random effect. 167 // new random effect.
168 if (currAttribIndex + numAttribs > GrDrawState::kMaxVertexAttribCnt) { 168 if (currAttribIndex + numAttribs > GrDrawState::kMaxVertexAttribCnt) {
169 --s; 169 --s;
170 continue; 170 continue;
171 } 171 }
172 for (int i = 0; i < numAttribs; ++i) { 172 for (int i = 0; i < numAttribs; ++i) {
173 attribIndices[i] = currAttribIndex++; 173 attribIndices[i] = currAttribIndex++;
174 } 174 }
175 GrEffectStage* stage = SkNEW(GrEffectStage); 175 GrEffectStage* stage = SkNEW_ARGS(GrEffectStage,
176 stage->setEffect(effect.get(), attribIndices[0], attribIndices[1]); 176 (effect.get(), attribIndices[0], a ttribIndices[1]));
177 stages[s] = stage; 177 stages[s] = stage;
178 } 178 }
179 const GrTexture* dstTexture = random.nextBool() ? dummyTextures[0] : dum myTextures[1]; 179 const GrTexture* dstTexture = random.nextBool() ? dummyTextures[0] : dum myTextures[1];
180 pdesc.setRandom(&random, 180 pdesc.setRandom(&random,
181 this, 181 this,
182 dummyTextures[0]->asRenderTarget(), 182 dummyTextures[0]->asRenderTarget(),
183 dstTexture, 183 dstTexture,
184 stages.get(), 184 stages.get(),
185 numColorStages, 185 numColorStages,
186 numCoverageStages, 186 numCoverageStages,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1); 236 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1);
237 GrConfigConversionEffect::Create(NULL, 237 GrConfigConversionEffect::Create(NULL,
238 false, 238 false,
239 GrConfigConversionEffect::kNone_PMConversio n, 239 GrConfigConversionEffect::kNone_PMConversio n,
240 SkMatrix::I()); 240 SkMatrix::I());
241 SkScalar matrix[20]; 241 SkScalar matrix[20];
242 SkColorMatrixFilter cmf(matrix); 242 SkColorMatrixFilter cmf(matrix);
243 } 243 }
244 244
245 #endif 245 #endif
OLDNEW
« include/gpu/GrEffectStage.h ('K') | « src/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698