| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 //// | 78 //// |
| 79 | 79 |
| 80 int numColorStages() const { return fNumColorStages; } | 80 int numColorStages() const { return fNumColorStages; } |
| 81 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } | 81 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } |
| 82 int numFragmentStages() const { return fFragmentStages.count(); } | 82 int numFragmentStages() const { return fFragmentStages.count(); } |
| 83 int numTotalStages() const { | 83 int numTotalStages() const { |
| 84 // the + 1 at the end is for the xferProcessor which will always be pres
ent | 84 // the + 1 at the end is for the xferProcessor which will always be pres
ent |
| 85 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 : 0
) + 1; | 85 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 : 0
) + 1; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // TODO hack |
| 89 bool newStyle() const { return hasGeometryProcessor() && getGeometryProcesso
r()->fNewStyle; } |
| 90 |
| 88 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } | 91 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } |
| 89 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } | 92 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } |
| 90 const GrBatchTracker& getBatchTracker() const { return fBatchTracker; } | 93 const GrBatchTracker& getBatchTracker() const { return fBatchTracker; } |
| 91 | 94 |
| 92 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get(
); } | 95 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get(
); } |
| 93 | 96 |
| 94 const GrPendingFragmentStage& getColorStage(int idx) const { | 97 const GrPendingFragmentStage& getColorStage(int idx) const { |
| 95 SkASSERT(idx < this->numColorStages()); | 98 SkASSERT(idx < this->numColorStages()); |
| 96 return fFragmentStages[idx]; | 99 return fFragmentStages[idx]; |
| 97 } | 100 } |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 249 |
| 247 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 250 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
| 248 int fNumColorStages; | 251 int fNumColorStages; |
| 249 | 252 |
| 250 GrProgramDesc fDesc; | 253 GrProgramDesc fDesc; |
| 251 | 254 |
| 252 typedef SkRefCnt INHERITED; | 255 typedef SkRefCnt INHERITED; |
| 253 }; | 256 }; |
| 254 | 257 |
| 255 #endif | 258 #endif |
| OLD | NEW |