OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 /// The input color to the first color-stage is either the constant color or
interpolated | 242 /// The input color to the first color-stage is either the constant color or
interpolated |
243 /// per-vertex colors. The input to the first coverage stage is either a con
stant coverage | 243 /// per-vertex colors. The input to the first coverage stage is either a con
stant coverage |
244 /// (usually full-coverage) or interpolated per-vertex coverage. | 244 /// (usually full-coverage) or interpolated per-vertex coverage. |
245 /// | 245 /// |
246 /// See the documentation of kCoverageDrawing_StateBit for information about
disabling the | 246 /// See the documentation of kCoverageDrawing_StateBit for information about
disabling the |
247 /// the color / coverage distinction. | 247 /// the color / coverage distinction. |
248 //// | 248 //// |
249 | 249 |
250 int numColorStages() const { return fColorStages.count(); } | 250 int numColorStages() const { return fColorStages.count(); } |
251 int numCoverageStages() const { return fCoverageStages.count(); } | 251 int numCoverageStages() const { return fCoverageStages.count(); } |
| 252 int numFragmentStages() const { return this->numColorStages() + this->numCov
erageStages(); } |
252 int numTotalStages() const { | 253 int numTotalStages() const { |
253 return this->numColorStages() + this->numCoverageStages() + | 254 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); |
254 (this->hasGeometryProcessor() ? 1 : 0); | |
255 } | 255 } |
256 | 256 |
257 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } | 257 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } |
258 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } | 258 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } |
259 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id
x]; } | 259 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id
x]; } |
260 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta
ges[idx]; } | 260 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta
ges[idx]; } |
261 | 261 |
262 /** | 262 /** |
263 * Checks whether any of the effects will read the dst pixel color. | 263 * Checks whether any of the effects will read the dst pixel color. |
264 */ | 264 */ |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 mutable uint32_t fCachedCapsID; | 851 mutable uint32_t fCachedCapsID; |
852 | 852 |
853 friend class GrOptDrawState; | 853 friend class GrOptDrawState; |
854 | 854 |
855 typedef SkRefCnt INHERITED; | 855 typedef SkRefCnt INHERITED; |
856 }; | 856 }; |
857 | 857 |
858 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 858 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
859 | 859 |
860 #endif | 860 #endif |
OLD | NEW |