| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 int numColorStages() const { return fColorStages.count(); } | 197 int numColorStages() const { return fColorStages.count(); } |
| 198 int numCoverageStages() const { return fCoverageStages.count(); } | 198 int numCoverageStages() const { return fCoverageStages.count(); } |
| 199 int numFragmentStages() const { return this->numColorStages() + this->numCov
erageStages(); } | 199 int numFragmentStages() const { return this->numColorStages() + this->numCov
erageStages(); } |
| 200 int numTotalStages() const { | 200 int numTotalStages() const { |
| 201 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); | 201 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); |
| 202 } | 202 } |
| 203 | 203 |
| 204 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } | 204 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } |
| 205 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } | 205 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } |
| 206 |
| 207 const GrXPFactory* getXPFactory() const { return fXPFactory.get(); } |
| 208 |
| 206 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id
x]; } | 209 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id
x]; } |
| 207 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta
ges[idx]; } | 210 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta
ges[idx]; } |
| 208 | 211 |
| 209 /** | 212 /** |
| 210 * Checks whether any of the effects will read the dst pixel color. | 213 * Checks whether any of the effects will read the dst pixel color. |
| 211 */ | 214 */ |
| 212 bool willEffectReadDstColor() const; | 215 bool willEffectReadDstColor() const; |
| 213 | 216 |
| 214 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effe
ct) { | 217 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effe
ct) { |
| 215 SkASSERT(effect); | 218 SkASSERT(effect); |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 GrColor fColor; | 717 GrColor fColor; |
| 715 SkMatrix fViewMatrix; | 718 SkMatrix fViewMatrix; |
| 716 GrColor fBlendConstant; | 719 GrColor fBlendConstant; |
| 717 uint32_t fFlagBits; | 720 uint32_t fFlagBits; |
| 718 GrStencilSettings fStencilSettings; | 721 GrStencilSettings fStencilSettings; |
| 719 uint8_t fCoverage; | 722 uint8_t fCoverage; |
| 720 DrawFace fDrawFace; | 723 DrawFace fDrawFace; |
| 721 GrBlendCoeff fSrcBlend; | 724 GrBlendCoeff fSrcBlend; |
| 722 GrBlendCoeff fDstBlend; | 725 GrBlendCoeff fDstBlend; |
| 723 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 726 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
| 727 SkAutoTUnref<const GrXPFactory> fXPFactory; |
| 724 FragmentStageArray fColorStages; | 728 FragmentStageArray fColorStages; |
| 725 FragmentStageArray fCoverageStages; | 729 FragmentStageArray fCoverageStages; |
| 726 uint32_t fHints; | 730 uint32_t fHints; |
| 727 | 731 |
| 728 mutable GrProcOptInfo fColorProcInfo; | 732 mutable GrProcOptInfo fColorProcInfo; |
| 729 mutable GrProcOptInfo fCoverageProcInfo; | 733 mutable GrProcOptInfo fCoverageProcInfo; |
| 730 mutable bool fColorProcInfoValid; | 734 mutable bool fColorProcInfoValid; |
| 731 mutable bool fCoverageProcInfoValid; | 735 mutable bool fCoverageProcInfoValid; |
| 732 | 736 |
| 733 friend class GrOptDrawState; | 737 friend class GrOptDrawState; |
| 734 }; | 738 }; |
| 735 | 739 |
| 736 #endif | 740 #endif |
| OLD | NEW |