OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 const GrRenderTarget* dummyDstRenderTarget, | 48 const GrRenderTarget* dummyDstRenderTarget, |
49 const GrTexture* dummyDstCopyTexture, | 49 const GrTexture* dummyDstCopyTexture, |
50 const GrEffectStage* stages[], | 50 const GrEffectStage* stages[], |
51 int numColorStages, | 51 int numColorStages, |
52 int numCoverageStages, | 52 int numCoverageStages, |
53 int currAttribIndex); | 53 int currAttribIndex); |
54 | 54 |
55 /** | 55 /** |
56 * Builds a program descriptor from a GrDrawState. Whether the primitive typ
e is points, the | 56 * Builds a program descriptor from a GrDrawState. Whether the primitive typ
e is points, the |
57 * output of GrDrawState::getBlendOpts, and the caps of the GrGpuGL are also
inputs. It also | 57 * output of GrDrawState::getBlendOpts, and the caps of the GrGpuGL are also
inputs. It also |
58 * writes a tightly packed array of GrEffectStage* from the drawState. | 58 * outputs the color and coverage stages referenced by the generated descrip
tor. This may |
| 59 * not contain all stages from the draw state and coverage stages from the d
rawState may |
| 60 * be treated as color stages in the output. |
59 */ | 61 */ |
60 static void Build(const GrDrawState&, | 62 static void Build(const GrDrawState&, |
61 bool isPoints, | 63 bool isPoints, |
62 GrDrawState::BlendOptFlags, | 64 GrDrawState::BlendOptFlags, |
63 GrBlendCoeff srcCoeff, | 65 GrBlendCoeff srcCoeff, |
64 GrBlendCoeff dstCoeff, | 66 GrBlendCoeff dstCoeff, |
65 const GrGpuGL* gpu, | 67 const GrGpuGL* gpu, |
66 const GrDeviceCoordTexture* dstCopy, | 68 const GrDeviceCoordTexture* dstCopy, |
67 const GrEffectStage* outStages[GrDrawState::kNumStages], | 69 SkTArray<const GrEffectStage*, true>* outColorStages, |
| 70 SkTArray<const GrEffectStage*, true>* outCoverageStages, |
68 GrGLProgramDesc* outDesc); | 71 GrGLProgramDesc* outDesc); |
69 | 72 |
70 int numColorEffects() const { | 73 int numColorEffects() const { |
71 GrAssert(fInitialized); | 74 GrAssert(fInitialized); |
72 return this->getHeader().fColorEffectCnt; | 75 return this->getHeader().fColorEffectCnt; |
73 } | 76 } |
74 | 77 |
75 int numCoverageEffects() const { | 78 int numCoverageEffects() const { |
76 GrAssert(fInitialized); | 79 GrAssert(fInitialized); |
77 return this->getHeader().fCoverageEffectCnt; | 80 return this->getHeader().fCoverageEffectCnt; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 SkAutoSMalloc<kPreAllocSize> fKey; | 212 SkAutoSMalloc<kPreAllocSize> fKey; |
210 bool fInitialized; | 213 bool fInitialized; |
211 | 214 |
212 // GrGLProgram and GrGLShaderBuilder read the private fields to generate cod
e. TODO: Move all | 215 // GrGLProgram and GrGLShaderBuilder read the private fields to generate cod
e. TODO: Move all |
213 // code generation to GrGLShaderBuilder (and maybe add getters rather than f
riending). | 216 // code generation to GrGLShaderBuilder (and maybe add getters rather than f
riending). |
214 friend class GrGLProgram; | 217 friend class GrGLProgram; |
215 friend class GrGLShaderBuilder; | 218 friend class GrGLShaderBuilder; |
216 }; | 219 }; |
217 | 220 |
218 #endif | 221 #endif |
OLD | NEW |