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->hasGeometryProcessor() ? 1 : 0); |
| 127 } |
125 | 128 |
| 129 bool hasGeometryProcessor() const { return NULL != fGeometryProcessor.get();
} |
| 130 const GrEffectStage* getGeometryProcessor() const { return fGeometryProcesso
r.get(); } |
126 const GrEffectStage& getColorStage(int stageIdx) const { return fColorStages
[stageIdx]; } | 131 const GrEffectStage& getColorStage(int stageIdx) const { return fColorStages
[stageIdx]; } |
127 const GrEffectStage& getCoverageStage(int stageIdx) const { return fCoverage
Stages[stageIdx]; } | 132 const GrEffectStage& getCoverageStage(int stageIdx) const { return fCoverage
Stages[stageIdx]; } |
128 | 133 |
129 /** | 134 /** |
130 * Checks whether any of the effects will read the dst pixel color. | 135 * Checks whether any of the effects will read the dst pixel color. |
131 */ | 136 */ |
132 bool willEffectReadDstColor() const; | 137 bool willEffectReadDstColor() const; |
133 | 138 |
134 /// @} | 139 /// @} |
135 | 140 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 const GrVertexAttrib* fVAPtr; | 357 const GrVertexAttrib* fVAPtr; |
353 int fVACount; | 358 int fVACount; |
354 size_t fVAStride; | 359 size_t fVAStride; |
355 GrStencilSettings fStencilSettings; | 360 GrStencilSettings fStencilSettings; |
356 uint8_t fCoverage; | 361 uint8_t fCoverage; |
357 DrawFace fDrawFace; | 362 DrawFace fDrawFace; |
358 GrBlendCoeff fSrcBlend; | 363 GrBlendCoeff fSrcBlend; |
359 GrBlendCoeff fDstBlend; | 364 GrBlendCoeff fDstBlend; |
360 | 365 |
361 typedef SkSTArray<4, GrEffectStage> EffectStageArray; | 366 typedef SkSTArray<4, GrEffectStage> EffectStageArray; |
| 367 SkAutoTDelete<GrEffectStage> fGeometryProcessor; |
362 EffectStageArray fColorStages; | 368 EffectStageArray fColorStages; |
363 EffectStageArray fCoverageStages; | 369 EffectStageArray fCoverageStages; |
364 | 370 |
365 mutable GrBlendCoeff fOptSrcBlend; | 371 mutable GrBlendCoeff fOptSrcBlend; |
366 mutable GrBlendCoeff fOptDstBlend; | 372 mutable GrBlendCoeff fOptDstBlend; |
367 mutable BlendOptFlags fBlendOptFlags; | 373 mutable BlendOptFlags fBlendOptFlags; |
368 | 374 |
369 // This is simply a different representation of info in fVertexAttribs and t
hus does | 375 // This is simply a different representation of info in fVertexAttribs and t
hus does |
370 // not need to be compared in op==. | 376 // not need to be compared in op==. |
371 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; | 377 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; |
372 | 378 |
373 private: | 379 private: |
374 typedef SkRefCnt INHERITED; | 380 typedef SkRefCnt INHERITED; |
375 }; | 381 }; |
376 | 382 |
377 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags); | 383 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags); |
378 | 384 |
379 #endif | 385 #endif |
OLD | NEW |