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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 253 |
254 int numColorStages() const { return fColorStages.count(); } | 254 int numColorStages() const { return fColorStages.count(); } |
255 int numCoverageStages() const { return fCoverageStages.count(); } | 255 int numCoverageStages() const { return fCoverageStages.count(); } |
256 int numFragmentStages() const { return this->numColorStages() + this->numCov
erageStages(); } | 256 int numFragmentStages() const { return this->numColorStages() + this->numCov
erageStages(); } |
257 int numTotalStages() const { | 257 int numTotalStages() const { |
258 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); | 258 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); |
259 } | 259 } |
260 | 260 |
261 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } | 261 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } |
262 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } | 262 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } |
| 263 |
| 264 const GrXPFactory* getXPFactory() const { return fXPFactory.get(); } |
| 265 |
263 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id
x]; } | 266 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id
x]; } |
264 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta
ges[idx]; } | 267 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta
ges[idx]; } |
265 | 268 |
266 /** | 269 /** |
267 * Checks whether any of the effects will read the dst pixel color. | 270 * Checks whether any of the effects will read the dst pixel color. |
268 */ | 271 */ |
269 bool willEffectReadDstColor() const; | 272 bool willEffectReadDstColor() const; |
270 | 273 |
271 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effe
ct) { | 274 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effe
ct) { |
272 SkASSERT(effect); | 275 SkASSERT(effect); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 uint32_t fFlagBits; | 779 uint32_t fFlagBits; |
777 const GrVertexAttrib* fVAPtr; | 780 const GrVertexAttrib* fVAPtr; |
778 int fVACount; | 781 int fVACount; |
779 size_t fVAStride; | 782 size_t fVAStride; |
780 GrStencilSettings fStencilSettings; | 783 GrStencilSettings fStencilSettings; |
781 uint8_t fCoverage; | 784 uint8_t fCoverage; |
782 DrawFace fDrawFace; | 785 DrawFace fDrawFace; |
783 GrBlendCoeff fSrcBlend; | 786 GrBlendCoeff fSrcBlend; |
784 GrBlendCoeff fDstBlend; | 787 GrBlendCoeff fDstBlend; |
785 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 788 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
| 789 SkAutoTUnref<const GrXPFactory> fXPFactory; |
786 FragmentStageArray fColorStages; | 790 FragmentStageArray fColorStages; |
787 FragmentStageArray fCoverageStages; | 791 FragmentStageArray fCoverageStages; |
788 uint32_t fHints; | 792 uint32_t fHints; |
789 | 793 |
790 // This is simply a different representation of info in fVertexAttribs and t
hus does | 794 // This is simply a different representation of info in fVertexAttribs and t
hus does |
791 // not need to be compared in op==. | 795 // not need to be compared in op==. |
792 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; | 796 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; |
793 | 797 |
794 mutable GrProcOptInfo fColorProcInfo; | 798 mutable GrProcOptInfo fColorProcInfo; |
795 mutable GrProcOptInfo fCoverageProcInfo; | 799 mutable GrProcOptInfo fCoverageProcInfo; |
796 mutable bool fColorProcInfoValid; | 800 mutable bool fColorProcInfoValid; |
797 mutable bool fCoverageProcInfoValid; | 801 mutable bool fCoverageProcInfoValid; |
798 | 802 |
799 friend class GrOptDrawState; | 803 friend class GrOptDrawState; |
800 }; | 804 }; |
801 | 805 |
802 #endif | 806 #endif |
OLD | NEW |