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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 12462008: Add GrEllipseEdgeEffect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rebase again Created 7 years, 9 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
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 GrPrintf("\nTest Program %d\n-------------\n", t); 114 GrPrintf("\nTest Program %d\n-------------\n", t);
115 static const int stop = -1; 115 static const int stop = -1;
116 if (t == stop) { 116 if (t == stop) {
117 int breakpointhere = 9; 117 int breakpointhere = 9;
118 } 118 }
119 #endif 119 #endif
120 120
121 GrGLProgram::Desc pdesc; 121 GrGLProgram::Desc pdesc;
122 GrEffectStage stages[GrDrawState::kNumStages]; 122 GrEffectStage stages[GrDrawState::kNumStages];
123 123
124 int currAttribIndex = GrDrawState::kAttribIndexCount;
125 int attribIndices[2];
124 for (int s = 0; s < maxStages; ++s) { 126 for (int s = 0; s < maxStages; ++s) {
125 // enable the stage? 127 // enable the stage?
126 if (random.nextBool()) { 128 if (random.nextBool()) {
127 GrTexture* dummyTextures[] = {dummyTexture1.get(), dummyTexture2 .get()}; 129 GrTexture* dummyTextures[] = {dummyTexture1.get(), dummyTexture2 .get()};
128 SkAutoTUnref<const GrEffectRef> effect(GrEffectTestFactory::Crea teStage( 130 SkAutoTUnref<const GrEffectRef> effect(GrEffectTestFactory::Crea teStage(
129 &random, 131 &random,
130 this->getContext(), 132 this->getContext(),
131 dummyTextures)); 133 dummyTextures));
132 stages[s].setEffect(effect.get()); 134 for (int i = 0; i < effect.get()->get()->numVertexAttribs(); ++i ) {
135 attribIndices[i] = currAttribIndex++;
136 }
137 stages[s].setEffect(effect.get(), attribIndices);
133 } 138 }
134 } 139 }
135 pdesc.setRandom(&random, this, stages); 140 pdesc.setRandom(&random, this, stages);
136 141
137 const GrEffectStage* stagePtrs[GrDrawState::kNumStages]; 142 const GrEffectStage* stagePtrs[GrDrawState::kNumStages];
138 for (int s = 0; s < GrDrawState::kNumStages; ++s) { 143 for (int s = 0; s < GrDrawState::kNumStages; ++s) {
139 stagePtrs[s] = &stages[s]; 144 stagePtrs[s] = &stages[s];
140 } 145 }
141 SkAutoTUnref<GrGLProgram> program(GrGLProgram::Create(this->glContext(), 146 SkAutoTUnref<GrGLProgram> program(GrGLProgram::Create(this->glContext(),
142 pdesc, 147 pdesc,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1); 189 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1);
185 GrConfigConversionEffect::Create(NULL, 190 GrConfigConversionEffect::Create(NULL,
186 false, 191 false,
187 GrConfigConversionEffect::kNone_PMConversio n, 192 GrConfigConversionEffect::kNone_PMConversio n,
188 SkMatrix::I()); 193 SkMatrix::I());
189 SkScalar matrix[20]; 194 SkScalar matrix[20];
190 SkColorMatrixFilter cmf(matrix); 195 SkColorMatrixFilter cmf(matrix);
191 } 196 }
192 197
193 #endif 198 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698