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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 23875048: Use explicitly-sized enums in GrGLProgramDesc::KeyHeader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix build error with tests Created 7 years, 2 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/GrGLProgramDesc.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 26 matching lines...) Expand all
37 memset(this->header(), 0, kHeaderSize); 37 memset(this->header(), 0, kHeaderSize);
38 38
39 KeyHeader* header = this->header(); 39 KeyHeader* header = this->header();
40 header->fEmitsPointSize = random->nextBool(); 40 header->fEmitsPointSize = random->nextBool();
41 41
42 header->fPositionAttributeIndex = 0; 42 header->fPositionAttributeIndex = 0;
43 43
44 // if the effects have used up all off the available attributes, 44 // if the effects have used up all off the available attributes,
45 // don't try to use color or coverage attributes as input 45 // don't try to use color or coverage attributes as input
46 do { 46 do {
47 header->fColorInput = random->nextULessThan(kColorInputCnt); 47 header->fColorInput = static_cast<GrGLProgramDesc::ColorInput>(
48 random->nextULessThan(kColorInputCnt));
48 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && 49 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
49 kAttribute_ColorInput == header->fColorInput); 50 kAttribute_ColorInput == header->fColorInput);
50 header->fColorAttributeIndex = (header->fColorInput == kAttribute_ColorInput ) ? 51 header->fColorAttributeIndex = (header->fColorInput == kAttribute_ColorInput ) ?
51 currAttribIndex++ : 52 currAttribIndex++ :
52 -1; 53 -1;
53 54
54 do { 55 do {
55 header->fCoverageInput = random->nextULessThan(kColorInputCnt); 56 header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>(
57 random->nextULessThan(kColorInputCnt));
56 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && 58 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
57 kAttribute_ColorInput == header->fCoverageInput); 59 kAttribute_ColorInput == header->fCoverageInput);
58 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ? 60 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ?
59 currAttribIndex++ : 61 currAttribIndex++ :
60 -1; 62 -1;
61 63
62 header->fColorFilterXfermode = random->nextULessThan(SkXfermode::kLastCoeffM ode + 1); 64 header->fColorFilterXfermode = static_cast<SkXfermode::Mode>(
65 random->nextULessThan(SkXfermode::kLastCo effMode + 1));
63 66
64 #if GR_GL_EXPERIMENTAL_GS 67 #if GR_GL_EXPERIMENTAL_GS
65 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool(); 68 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool();
66 #endif 69 #endif
67 70
68 header->fDiscardIfZeroCoverage = random->nextBool(); 71 header->fDiscardIfZeroCoverage = random->nextBool();
69 72
70 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt; 73 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt;
71 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1; 74 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1;
72 75
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 GrConfigConversionEffect::Create(NULL, 241 GrConfigConversionEffect::Create(NULL,
239 false, 242 false,
240 GrConfigConversionEffect::kNone_PMConversio n, 243 GrConfigConversionEffect::kNone_PMConversio n,
241 SkMatrix::I()); 244 SkMatrix::I());
242 SkScalar matrix[20]; 245 SkScalar matrix[20];
243 SkColorMatrixFilter cmf(matrix); 246 SkColorMatrixFilter cmf(matrix);
244 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80); 247 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80);
245 } 248 }
246 249
247 #endif 250 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698