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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 25023003: Implement color filter as GrGLEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix a small thinko 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
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 -1; 52 -1;
53 53
54 do { 54 do {
55 header->fCoverageInput = random->nextULessThan(kColorInputCnt); 55 header->fCoverageInput = random->nextULessThan(kColorInputCnt);
56 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && 56 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
57 kAttribute_ColorInput == header->fCoverageInput); 57 kAttribute_ColorInput == header->fCoverageInput);
58 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ? 58 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ?
59 currAttribIndex++ : 59 currAttribIndex++ :
60 -1; 60 -1;
61 61
62 header->fColorFilterXfermode = random->nextULessThan(SkXfermode::kLastCoeffM ode + 1);
63
64 #if GR_GL_EXPERIMENTAL_GS 62 #if GR_GL_EXPERIMENTAL_GS
65 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool(); 63 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool();
66 #endif 64 #endif
67 65
68 header->fDiscardIfZeroCoverage = random->nextBool(); 66 header->fDiscardIfZeroCoverage = random->nextBool();
69 67
70 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt; 68 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt;
71 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1; 69 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1;
72 70
73 header->fColorEffectCnt = numColorStages; 71 header->fColorEffectCnt = numColorStages;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 GrConfigConversionEffect::Create(NULL, 236 GrConfigConversionEffect::Create(NULL,
239 false, 237 false,
240 GrConfigConversionEffect::kNone_PMConversio n, 238 GrConfigConversionEffect::kNone_PMConversio n,
241 SkMatrix::I()); 239 SkMatrix::I());
242 SkScalar matrix[20]; 240 SkScalar matrix[20];
243 SkColorMatrixFilter cmf(matrix); 241 SkColorMatrixFilter cmf(matrix);
244 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80); 242 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80);
245 } 243 }
246 244
247 #endif 245 #endif
OLDNEW
« src/effects/SkColorFilters.cpp ('K') | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698