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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 * initial value (after construction or reset()) is 0xff. The constant | 208 * initial value (after construction or reset()) is 0xff. The constant |
209 * coverage is ignored when per-vertex coverage is provided. | 209 * coverage is ignored when per-vertex coverage is provided. |
210 */ | 210 */ |
211 void setCoverage(uint8_t coverage) { | 211 void setCoverage(uint8_t coverage) { |
212 if (coverage != fCoverage) { | 212 if (coverage != fCoverage) { |
213 fCoverage = coverage; | 213 fCoverage = coverage; |
214 fCoverageProcInfoValid = false; | 214 fCoverageProcInfoValid = false; |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 /** | |
219 * Determines whether the output of the coverage stages will be single compo nent. | |
220 */ | |
221 bool coverageWillBeSingleComponent() const; | |
bsalomon
2014/11/26 21:02:45
needs to be public?
egdaniel
2014/12/01 18:18:24
It is a query used by PD-XPF for checking RGBCover
bsalomon
2014/12/01 19:24:39
I don't think PD-XPF should be allowed to see GrDr
| |
222 | |
218 /// @} | 223 /// @} |
219 | 224 |
220 /** | 225 /** |
221 * The geometry processor is the sole element of the skia pipeline which can use the vertex, | 226 * The geometry processor is the sole element of the skia pipeline which can use the vertex, |
222 * geometry, and tesselation shaders. The GP may also compute a coverage in its fragment shader | 227 * geometry, and tesselation shaders. The GP may also compute a coverage in its fragment shader |
223 * but is never put in the color processing pipeline. | 228 * but is never put in the color processing pipeline. |
224 */ | 229 */ |
225 | 230 |
226 const GrGeometryProcessor* setGeometryProcessor(const GrGeometryProcessor* g eometryProcessor) { | 231 const GrGeometryProcessor* setGeometryProcessor(const GrGeometryProcessor* g eometryProcessor) { |
227 SkASSERT(geometryProcessor); | 232 SkASSERT(geometryProcessor); |
(...skipping 25 matching lines...) Expand all Loading... | |
253 | 258 |
254 int numColorStages() const { return fColorStages.count(); } | 259 int numColorStages() const { return fColorStages.count(); } |
255 int numCoverageStages() const { return fCoverageStages.count(); } | 260 int numCoverageStages() const { return fCoverageStages.count(); } |
256 int numFragmentStages() const { return this->numColorStages() + this->numCov erageStages(); } | 261 int numFragmentStages() const { return this->numColorStages() + this->numCov erageStages(); } |
257 int numTotalStages() const { | 262 int numTotalStages() const { |
258 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 : 0); | 263 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 : 0); |
259 } | 264 } |
260 | 265 |
261 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get() ); } | 266 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get() ); } |
262 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr ocessor.get(); } | 267 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr ocessor.get(); } |
268 | |
269 bool hasXPFactory() const { return SkToBool(fXPFactory.get()); } | |
270 const GrXPFactory* getXPFactory() const { return fXPFactory.get(); } | |
271 | |
263 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id x]; } | 272 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id x]; } |
264 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta ges[idx]; } | 273 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta ges[idx]; } |
265 | 274 |
266 /** | 275 /** |
267 * Checks whether any of the effects will read the dst pixel color. | 276 * Checks whether any of the effects will read the dst pixel color. |
268 */ | 277 */ |
269 bool willEffectReadDstColor() const; | 278 bool willEffectReadDstColor() const; |
270 | 279 |
271 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effe ct) { | 280 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effe ct) { |
272 SkASSERT(effect); | 281 SkASSERT(effect); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
776 uint32_t fFlagBits; | 785 uint32_t fFlagBits; |
777 const GrVertexAttrib* fVAPtr; | 786 const GrVertexAttrib* fVAPtr; |
778 int fVACount; | 787 int fVACount; |
779 size_t fVAStride; | 788 size_t fVAStride; |
780 GrStencilSettings fStencilSettings; | 789 GrStencilSettings fStencilSettings; |
781 uint8_t fCoverage; | 790 uint8_t fCoverage; |
782 DrawFace fDrawFace; | 791 DrawFace fDrawFace; |
783 GrBlendCoeff fSrcBlend; | 792 GrBlendCoeff fSrcBlend; |
784 GrBlendCoeff fDstBlend; | 793 GrBlendCoeff fDstBlend; |
785 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 794 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
795 SkAutoTUnref<const GrXPFactory> fXPFactory; | |
786 FragmentStageArray fColorStages; | 796 FragmentStageArray fColorStages; |
787 FragmentStageArray fCoverageStages; | 797 FragmentStageArray fCoverageStages; |
788 uint32_t fHints; | 798 uint32_t fHints; |
789 | 799 |
790 // This is simply a different representation of info in fVertexAttribs and t hus does | 800 // This is simply a different representation of info in fVertexAttribs and t hus does |
791 // not need to be compared in op==. | 801 // not need to be compared in op==. |
792 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ]; | 802 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ]; |
793 | 803 |
794 mutable GrProcOptInfo fColorProcInfo; | 804 mutable GrProcOptInfo fColorProcInfo; |
795 mutable GrProcOptInfo fCoverageProcInfo; | 805 mutable GrProcOptInfo fCoverageProcInfo; |
796 mutable bool fColorProcInfoValid; | 806 mutable bool fColorProcInfoValid; |
797 mutable bool fCoverageProcInfoValid; | 807 mutable bool fCoverageProcInfoValid; |
798 | 808 |
799 friend class GrOptDrawState; | 809 friend class GrOptDrawState; |
800 }; | 810 }; |
801 | 811 |
802 #endif | 812 #endif |
OLD | NEW |