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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 16952006: Replace fixed-size array of effect stages in GrDrawState with two appendable arrays, one for color,… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comments Created 7 years, 6 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/debug/GrFrameBufferObj.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 header->fCoverageOutput = coverageOutput; 112 header->fCoverageOutput = coverageOutput;
113 113
114 *this->checksum() = 0; 114 *this->checksum() = 0;
115 *this->checksum() = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.get ()), keyLength); 115 *this->checksum() = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.get ()), keyLength);
116 fInitialized = true; 116 fInitialized = true;
117 } 117 }
118 118
119 bool GrGpuGL::programUnitTest(int maxStages) { 119 bool GrGpuGL::programUnitTest(int maxStages) {
120 120
121 maxStages = GrMin(maxStages, (int)GrDrawState::kNumStages);
122
123 GrTextureDesc dummyDesc; 121 GrTextureDesc dummyDesc;
124 dummyDesc.fFlags = kRenderTarget_GrTextureFlagBit; 122 dummyDesc.fFlags = kRenderTarget_GrTextureFlagBit;
125 dummyDesc.fConfig = kSkia8888_GrPixelConfig; 123 dummyDesc.fConfig = kSkia8888_GrPixelConfig;
126 dummyDesc.fWidth = 34; 124 dummyDesc.fWidth = 34;
127 dummyDesc.fHeight = 18; 125 dummyDesc.fHeight = 18;
128 SkAutoTUnref<GrTexture> dummyTexture1(this->createTexture(dummyDesc, NULL, 0 )); 126 SkAutoTUnref<GrTexture> dummyTexture1(this->createTexture(dummyDesc, NULL, 0 ));
129 dummyDesc.fFlags = kNone_GrTextureFlags; 127 dummyDesc.fFlags = kNone_GrTextureFlags;
130 dummyDesc.fConfig = kAlpha_8_GrPixelConfig; 128 dummyDesc.fConfig = kAlpha_8_GrPixelConfig;
131 dummyDesc.fWidth = 16; 129 dummyDesc.fWidth = 16;
132 dummyDesc.fHeight = 22; 130 dummyDesc.fHeight = 22;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 198 }
201 } 199 }
202 return true; 200 return true;
203 } 201 }
204 202
205 static void GLProgramsTest(skiatest::Reporter* reporter, GrContextFactory* facto ry) { 203 static void GLProgramsTest(skiatest::Reporter* reporter, GrContextFactory* facto ry) {
206 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { 204 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
207 GrContext* context = factory->get(static_cast<GrContextFactory::GLContex tType>(type)); 205 GrContext* context = factory->get(static_cast<GrContextFactory::GLContex tType>(type));
208 if (NULL != context) { 206 if (NULL != context) {
209 GrGpuGL* gpu = static_cast<GrGpuGL*>(context->getGpu()); 207 GrGpuGL* gpu = static_cast<GrGpuGL*>(context->getGpu());
210 int maxStages = GrDrawState::kNumStages; 208 int maxStages = 6;
211 #if SK_ANGLE 209 #if SK_ANGLE
212 // Some long shaders run out of temporary registers in the D3D compi ler on ANGLE. 210 // Some long shaders run out of temporary registers in the D3D compi ler on ANGLE.
213 if (type == GrContextFactory::kANGLE_GLContextType) { 211 if (type == GrContextFactory::kANGLE_GLContextType) {
214 maxStages = 3; 212 maxStages = 3;
215 } 213 }
216 #endif 214 #endif
217 REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages)); 215 REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages));
218 } 216 }
219 } 217 }
220 } 218 }
(...skipping 17 matching lines...) Expand all
238 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1); 236 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1);
239 GrConfigConversionEffect::Create(NULL, 237 GrConfigConversionEffect::Create(NULL,
240 false, 238 false,
241 GrConfigConversionEffect::kNone_PMConversio n, 239 GrConfigConversionEffect::kNone_PMConversio n,
242 SkMatrix::I()); 240 SkMatrix::I());
243 SkScalar matrix[20]; 241 SkScalar matrix[20];
244 SkColorMatrixFilter cmf(matrix); 242 SkColorMatrixFilter cmf(matrix);
245 } 243 }
246 244
247 #endif 245 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/debug/GrFrameBufferObj.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698