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

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: address review comments Created 7 years, 1 month 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') | tests/GpuColorFilterTest.cpp » ('j') | 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 do { 55 do {
56 header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>( 56 header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>(
57 random->nextULessThan(kColorInputCnt)); 57 random->nextULessThan(kColorInputCnt));
58 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && 58 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
59 kAttribute_ColorInput == header->fCoverageInput); 59 kAttribute_ColorInput == header->fCoverageInput);
60 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ? 60 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ?
61 currAttribIndex++ : 61 currAttribIndex++ :
62 -1; 62 -1;
63 63
64 header->fColorFilterXfermode = static_cast<SkXfermode::Mode>(
65 random->nextULessThan(SkXfermode::kLastCo effMode + 1));
66
67 #if GR_GL_EXPERIMENTAL_GS 64 #if GR_GL_EXPERIMENTAL_GS
68 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool(); 65 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool();
69 #endif 66 #endif
70 67
71 header->fDiscardIfZeroCoverage = random->nextBool(); 68 header->fDiscardIfZeroCoverage = random->nextBool();
72 69
73 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt; 70 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt;
74 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1; 71 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1;
75 72
76 header->fColorEffectCnt = numColorStages; 73 header->fColorEffectCnt = numColorStages;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 GrConfigConversionEffect::Create(NULL, 264 GrConfigConversionEffect::Create(NULL,
268 false, 265 false,
269 GrConfigConversionEffect::kNone_PMConversio n, 266 GrConfigConversionEffect::kNone_PMConversio n,
270 SkMatrix::I()); 267 SkMatrix::I());
271 SkScalar matrix[20]; 268 SkScalar matrix[20];
272 SkColorMatrixFilter cmf(matrix); 269 SkColorMatrixFilter cmf(matrix);
273 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80); 270 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80);
274 } 271 }
275 272
276 #endif 273 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698