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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 584913002: Stop calling rand() in debug-only code for GLProgramsTest (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « no previous file | 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 -1; 121 -1;
122 122
123 do { 123 do {
124 header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>( 124 header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>(
125 random->nextULessThan(kColorInputCnt)); 125 random->nextULessThan(kColorInputCnt));
126 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && 126 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
127 kAttribute_ColorInput == header->fCoverageInput); 127 kAttribute_ColorInput == header->fCoverageInput);
128 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ? 128 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ?
129 currAttribIndex++ : 129 currAttribIndex++ :
130 -1; 130 -1;
131 131 bool useGS = random->nextBool();
132 #if GR_GL_EXPERIMENTAL_GS 132 #if GR_GL_EXPERIMENTAL_GS
133 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool(); 133 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && useGS;
134 #else
135 (void) useGS;
134 #endif 136 #endif
135 137
136 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1; 138 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1;
137 139
138 header->fColorEffectCnt = numColorStages; 140 header->fColorEffectCnt = numColorStages;
139 header->fCoverageEffectCnt = numCoverageStages; 141 header->fCoverageEffectCnt = numCoverageStages;
140 142
141 if (dstRead) { 143 if (dstRead) {
142 header->fDstReadKey = SkToU8(GrGLFragmentShaderBuilder::KeyForDstRead(ds tCopyTexture, 144 header->fDstReadKey = SkToU8(GrGLFragmentShaderBuilder::KeyForDstRead(ds tCopyTexture,
143 gpu->glCap s())); 145 gpu->glCap s()));
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1)); 385 SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1));
384 GrConfigConversionEffect::Create(NULL, 386 GrConfigConversionEffect::Create(NULL,
385 false, 387 false,
386 GrConfigConversionEffect::kNone_PMConversio n, 388 GrConfigConversionEffect::kNone_PMConversio n,
387 SkMatrix::I()); 389 SkMatrix::I());
388 SkScalar matrix[20]; 390 SkScalar matrix[20];
389 SkAutoTUnref<SkColorMatrixFilter> cmf(SkColorMatrixFilter::Create(matrix)); 391 SkAutoTUnref<SkColorMatrixFilter> cmf(SkColorMatrixFilter::Create(matrix));
390 } 392 }
391 393
392 #endif 394 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698