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

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

Issue 25474006: Move VertexBuilder to a GrGLFullShaderBuilder subclass (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 * 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
116 enum CoverageOutput { 127 enum CoverageOutput {
117 // modulate color and coverage, write result as the color output. 128 // modulate color and coverage, write result as the color output.
118 kModulate_CoverageOutput, 129 kModulate_CoverageOutput,
119 // Writes color*coverage as the primary color output and also writes cov erage as the 130 // Writes color*coverage as the primary color output and also writes cov erage as the
120 // secondary output. Only set if dual source blending is supported. 131 // secondary output. Only set if dual source blending is supported.
121 kSecondaryCoverage_CoverageOutput, 132 kSecondaryCoverage_CoverageOutput,
122 // Writes color*coverage as the primary color output and also writes cov erage * (1 - colorA) 133 // Writes color*coverage as the primary color output and also writes cov erage * (1 - colorA)
123 // as the secondary output. Only set if dual source blending is supporte d. 134 // as the secondary output. Only set if dual source blending is supporte d.
124 kSecondaryCoverageISA_CoverageOutput, 135 kSecondaryCoverageISA_CoverageOutput,
125 // Writes color*coverage as the primary color output and also writes cov erage * 136 // Writes color*coverage as the primary color output and also writes cov erage *
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 kPreAllocSize = kEffectKeyOffset + kMaxPreallocEffects * sizeof(EffectK ey), 225 kPreAllocSize = kEffectKeyOffset + kMaxPreallocEffects * sizeof(EffectK ey),
215 }; 226 };
216 227
217 SkAutoSMalloc<kPreAllocSize> fKey; 228 SkAutoSMalloc<kPreAllocSize> fKey;
218 bool fInitialized; 229 bool fInitialized;
219 230
220 // GrGLProgram and GrGLShaderBuilder read the private fields to generate cod e. TODO: Move all 231 // GrGLProgram and GrGLShaderBuilder read the private fields to generate cod e. TODO: Move all
221 // code generation to GrGLShaderBuilder (and maybe add getters rather than f riending). 232 // code generation to GrGLShaderBuilder (and maybe add getters rather than f riending).
222 friend class GrGLProgram; 233 friend class GrGLProgram;
223 friend class GrGLShaderBuilder; 234 friend class GrGLShaderBuilder;
235 friend class GrGLFullShaderBuilder;
224 }; 236 };
225 237
226 #endif 238 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698