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 GrOptDrawState_DEFINED | 8 #ifndef GrOptDrawState_DEFINED |
9 #define GrOptDrawState_DEFINED | 9 #define GrOptDrawState_DEFINED |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 /// | 72 /// |
73 /// The input color to the first color-stage is either the constant color or
interpolated | 73 /// The input color to the first color-stage is either the constant color or
interpolated |
74 /// per-vertex colors. The input to the first coverage stage is either a con
stant coverage | 74 /// per-vertex colors. The input to the first coverage stage is either a con
stant coverage |
75 /// (usually full-coverage) or interpolated per-vertex coverage. | 75 /// (usually full-coverage) or interpolated per-vertex coverage. |
76 //// | 76 //// |
77 | 77 |
78 int numColorStages() const { return fNumColorStages; } | 78 int numColorStages() const { return fNumColorStages; } |
79 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } | 79 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } |
80 int numFragmentStages() const { return fFragmentStages.count(); } | 80 int numFragmentStages() const { return fFragmentStages.count(); } |
81 int numTotalStages() const { | 81 int numTotalStages() const { |
82 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); | 82 // the + 1 at the end is for the xferProcessor which will always be pres
ent |
| 83 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 : 0
) + 1; |
83 } | 84 } |
84 | 85 |
85 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } | 86 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } |
86 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } | 87 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } |
87 const GrBatchTracker& getBatchTracker() const { return fBatchTracker; } | 88 const GrBatchTracker& getBatchTracker() const { return fBatchTracker; } |
88 | 89 |
89 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get(
); } | 90 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get(
); } |
90 | 91 |
91 const GrPendingFragmentStage& getColorStage(int idx) const { | 92 const GrPendingFragmentStage& getColorStage(int idx) const { |
92 SkASSERT(idx < this->numColorStages()); | 93 SkASSERT(idx < this->numColorStages()); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 242 |
242 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 243 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
243 int fNumColorStages; | 244 int fNumColorStages; |
244 | 245 |
245 GrProgramDesc fDesc; | 246 GrProgramDesc fDesc; |
246 | 247 |
247 typedef SkRefCnt INHERITED; | 248 typedef SkRefCnt INHERITED; |
248 }; | 249 }; |
249 | 250 |
250 #endif | 251 #endif |
OLD | NEW |