OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrGLProgramBuilder_DEFINED | 8 #ifndef GrGLProgramBuilder_DEFINED |
9 #define GrGLProgramBuilder_DEFINED | 9 #define GrGLProgramBuilder_DEFINED |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 GrGLuint fProgramID; | 177 GrGLuint fProgramID; |
178 GrGLFragmentShaderBuilder fFS; | 178 GrGLFragmentShaderBuilder fFS; |
179 SeparableVaryingInfoArray fSeparableVaryingInfos; | 179 SeparableVaryingInfoArray fSeparableVaryingInfos; |
180 | 180 |
181 class CodeStage : SkNoncopyable { | 181 class CodeStage : SkNoncopyable { |
182 public: | 182 public: |
183 CodeStage() : fNextIndex(0), fCurrentIndex(-1), fEffectStage(NULL) {} | 183 CodeStage() : fNextIndex(0), fCurrentIndex(-1), fEffectStage(NULL) {} |
184 | 184 |
185 bool inStageCode() const { | 185 bool inStageCode() const { |
186 this->validate(); | 186 this->validate(); |
187 return NULL != fEffectStage; | 187 return SkToBool(fEffectStage); |
188 } | 188 } |
189 | 189 |
190 const GrEffectStage* effectStage() const { | 190 const GrEffectStage* effectStage() const { |
191 this->validate(); | 191 this->validate(); |
192 return fEffectStage; | 192 return fEffectStage; |
193 } | 193 } |
194 | 194 |
195 int stageIndex() const { | 195 int stageIndex() const { |
196 this->validate(); | 196 this->validate(); |
197 return fCurrentIndex; | 197 return fCurrentIndex; |
198 } | 198 } |
199 | 199 |
200 class AutoStageRestore : SkNoncopyable { | 200 class AutoStageRestore : SkNoncopyable { |
201 public: | 201 public: |
202 AutoStageRestore(CodeStage* codeStage, const GrEffectStage* newStage
) { | 202 AutoStageRestore(CodeStage* codeStage, const GrEffectStage* newStage
) { |
203 SkASSERT(NULL != codeStage); | 203 SkASSERT(codeStage); |
204 fSavedIndex = codeStage->fCurrentIndex; | 204 fSavedIndex = codeStage->fCurrentIndex; |
205 fSavedEffectStage = codeStage->fEffectStage; | 205 fSavedEffectStage = codeStage->fEffectStage; |
206 | 206 |
207 if (NULL == newStage) { | 207 if (NULL == newStage) { |
208 codeStage->fCurrentIndex = -1; | 208 codeStage->fCurrentIndex = -1; |
209 } else { | 209 } else { |
210 codeStage->fCurrentIndex = codeStage->fNextIndex++; | 210 codeStage->fCurrentIndex = codeStage->fNextIndex++; |
211 } | 211 } |
212 codeStage->fEffectStage = newStage; | 212 codeStage->fEffectStage = newStage; |
213 | 213 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 int effectCnt, | 367 int effectCnt, |
368 const GrGLProgramDesc::Effe
ctKeyProvider&, | 368 const GrGLProgramDesc::Effe
ctKeyProvider&, |
369 GrGLSLExpr4* inOutFSColor)
SK_OVERRIDE; | 369 GrGLSLExpr4* inOutFSColor)
SK_OVERRIDE; |
370 | 370 |
371 virtual void emitCodeAfterEffects() SK_OVERRIDE {} | 371 virtual void emitCodeAfterEffects() SK_OVERRIDE {} |
372 | 372 |
373 typedef GrGLProgramBuilder INHERITED; | 373 typedef GrGLProgramBuilder INHERITED; |
374 }; | 374 }; |
375 | 375 |
376 #endif | 376 #endif |
OLD | NEW |