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

Side by Side Diff: src/gpu/gl/GrGLProgramDesc.h

Issue 25048002: Express (GLSL expression, possibly known value) pairs as a class (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: addressing review comments 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/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLSL.h » ('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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrGLProgramDesc_DEFINED 8 #ifndef GrGLProgramDesc_DEFINED
9 #define GrGLProgramDesc_DEFINED 9 #define GrGLProgramDesc_DEFINED
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Specifies where the initial color comes from before the stages are applie d. 106 // Specifies where the initial color comes from before the stages are applie d.
107 enum ColorInput { 107 enum ColorInput {
108 kSolidWhite_ColorInput, 108 kSolidWhite_ColorInput,
109 kTransBlack_ColorInput, 109 kTransBlack_ColorInput,
110 kAttribute_ColorInput, 110 kAttribute_ColorInput,
111 kUniform_ColorInput, 111 kUniform_ColorInput,
112 112
113 kColorInputCnt 113 kColorInputCnt
114 }; 114 };
115 115
116 static GrSLConstantVec KnownColorInputValue(ColorInput ci) {
117 switch (ci) {
118 case GrGLProgramDesc::kTransBlack_ColorInput:
119 return kZeros_GrSLConstantVec;
120 case GrGLProgramDesc::kSolidWhite_ColorInput:
121 return kOnes_GrSLConstantVec;
122 default:
123 return kNone_GrSLConstantVec;
124 }
125 }
126
127 enum CoverageOutput { 116 enum CoverageOutput {
128 // modulate color and coverage, write result as the color output. 117 // modulate color and coverage, write result as the color output.
129 kModulate_CoverageOutput, 118 kModulate_CoverageOutput,
130 // Writes color*coverage as the primary color output and also writes cov erage as the 119 // Writes color*coverage as the primary color output and also writes cov erage as the
131 // secondary output. Only set if dual source blending is supported. 120 // secondary output. Only set if dual source blending is supported.
132 kSecondaryCoverage_CoverageOutput, 121 kSecondaryCoverage_CoverageOutput,
133 // Writes color*coverage as the primary color output and also writes cov erage * (1 - colorA) 122 // Writes color*coverage as the primary color output and also writes cov erage * (1 - colorA)
134 // as the secondary output. Only set if dual source blending is supporte d. 123 // as the secondary output. Only set if dual source blending is supporte d.
135 kSecondaryCoverageISA_CoverageOutput, 124 kSecondaryCoverageISA_CoverageOutput,
136 // Writes color*coverage as the primary color output and also writes cov erage * 125 // Writes color*coverage as the primary color output and also writes cov erage *
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 219
231 // GrGLProgram and GrGLShaderBuilder read the private fields to generate cod e. TODO: Move all 220 // GrGLProgram and GrGLShaderBuilder read the private fields to generate cod e. TODO: Move all
232 // code generation to GrGLShaderBuilder (and maybe add getters rather than f riending). 221 // code generation to GrGLShaderBuilder (and maybe add getters rather than f riending).
233 friend class GrGLProgram; 222 friend class GrGLProgram;
234 friend class GrGLShaderBuilder; 223 friend class GrGLShaderBuilder;
235 friend class GrGLFullShaderBuilder; 224 friend class GrGLFullShaderBuilder;
236 friend class GrGLFragmentOnlyShaderBuilder; 225 friend class GrGLFragmentOnlyShaderBuilder;
237 }; 226 };
238 227
239 #endif 228 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLSL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698