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 GrRODrawState_DEFINED | 8 #ifndef GrRODrawState_DEFINED |
9 #define GrRODrawState_DEFINED | 9 #define GrRODrawState_DEFINED |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 /// The input color to the first color-stage is either the constant color or
interpolated | 114 /// The input color to the first color-stage is either the constant color or
interpolated |
115 /// per-vertex colors. The input to the first coverage stage is either a con
stant coverage | 115 /// per-vertex colors. The input to the first coverage stage is either a con
stant coverage |
116 /// (usually full-coverage) or interpolated per-vertex coverage. | 116 /// (usually full-coverage) or interpolated per-vertex coverage. |
117 /// | 117 /// |
118 /// See the documentation of kCoverageDrawing_StateBit for information about
disabling the | 118 /// See the documentation of kCoverageDrawing_StateBit for information about
disabling the |
119 /// the color / coverage distinction. | 119 /// the color / coverage distinction. |
120 //// | 120 //// |
121 | 121 |
122 int numColorStages() const { return fColorStages.count(); } | 122 int numColorStages() const { return fColorStages.count(); } |
123 int numCoverageStages() const { return fCoverageStages.count(); } | 123 int numCoverageStages() const { return fCoverageStages.count(); } |
124 int numTotalStages() const { return this->numColorStages() + this->numCovera
geStages(); } | 124 int numTotalStages() const { |
| 125 return this->numColorStages() + this->numCoverageStages() + |
| 126 (this->getGeometryProcessor() ? 1 : 0); |
| 127 } |
125 | 128 |
| 129 const GrEffectStage* getGeometryProcessor() const { return fGeometryProcesso
r.get(); } |
126 const GrEffectStage& getColorStage(int stageIdx) const { return fColorStages
[stageIdx]; } | 130 const GrEffectStage& getColorStage(int stageIdx) const { return fColorStages
[stageIdx]; } |
127 const GrEffectStage& getCoverageStage(int stageIdx) const { return fCoverage
Stages[stageIdx]; } | 131 const GrEffectStage& getCoverageStage(int stageIdx) const { return fCoverage
Stages[stageIdx]; } |
128 | 132 |
129 /** | 133 /** |
130 * Checks whether any of the effects will read the dst pixel color. | 134 * Checks whether any of the effects will read the dst pixel color. |
131 */ | 135 */ |
132 bool willEffectReadDstColor() const; | 136 bool willEffectReadDstColor() const; |
133 | 137 |
134 /// @} | 138 /// @} |
135 | 139 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 const GrVertexAttrib* fVAPtr; | 356 const GrVertexAttrib* fVAPtr; |
353 int fVACount; | 357 int fVACount; |
354 size_t fVAStride; | 358 size_t fVAStride; |
355 GrStencilSettings fStencilSettings; | 359 GrStencilSettings fStencilSettings; |
356 uint8_t fCoverage; | 360 uint8_t fCoverage; |
357 DrawFace fDrawFace; | 361 DrawFace fDrawFace; |
358 GrBlendCoeff fSrcBlend; | 362 GrBlendCoeff fSrcBlend; |
359 GrBlendCoeff fDstBlend; | 363 GrBlendCoeff fDstBlend; |
360 | 364 |
361 typedef SkSTArray<4, GrEffectStage> EffectStageArray; | 365 typedef SkSTArray<4, GrEffectStage> EffectStageArray; |
| 366 SkAutoTUnref<GrEffectStage> fGeometryProcessor; |
362 EffectStageArray fColorStages; | 367 EffectStageArray fColorStages; |
363 EffectStageArray fCoverageStages; | 368 EffectStageArray fCoverageStages; |
364 | 369 |
365 mutable GrBlendCoeff fOptSrcBlend; | 370 mutable GrBlendCoeff fOptSrcBlend; |
366 mutable GrBlendCoeff fOptDstBlend; | 371 mutable GrBlendCoeff fOptDstBlend; |
367 mutable BlendOptFlags fBlendOptFlags; | 372 mutable BlendOptFlags fBlendOptFlags; |
368 | 373 |
369 // This is simply a different representation of info in fVertexAttribs and t
hus does | 374 // This is simply a different representation of info in fVertexAttribs and t
hus does |
370 // not need to be compared in op==. | 375 // not need to be compared in op==. |
371 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; | 376 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; |
372 | 377 |
373 private: | 378 private: |
374 typedef SkRefCnt INHERITED; | 379 typedef SkRefCnt INHERITED; |
375 }; | 380 }; |
376 | 381 |
377 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags); | 382 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags); |
378 | 383 |
379 #endif | 384 #endif |
OLD | NEW |