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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 //// | 120 //// |
121 | 121 |
122 int numColorStages() const { return fNumColorStages; } | 122 int numColorStages() const { return fNumColorStages; } |
123 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } | 123 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } |
124 int numFragmentStages() const { return fFragmentStages.count(); } | 124 int numFragmentStages() const { return fFragmentStages.count(); } |
125 int numTotalStages() const { | 125 int numTotalStages() const { |
126 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); | 126 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); |
127 } | 127 } |
128 | 128 |
129 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } | 129 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } |
130 const GrGeometryStage* getGeometryProcessor() const { return fGeometryProces
sor.get(); } | 130 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } |
131 const GrFragmentStage& getColorStage(int idx) const { | 131 const GrFragmentStage& getColorStage(int idx) const { |
132 SkASSERT(idx < this->numColorStages()); | 132 SkASSERT(idx < this->numColorStages()); |
133 return fFragmentStages[idx]; | 133 return fFragmentStages[idx]; |
134 } | 134 } |
135 const GrFragmentStage& getCoverageStage(int idx) const { | 135 const GrFragmentStage& getCoverageStage(int idx) const { |
136 SkASSERT(idx < this->numCoverageStages()); | 136 SkASSERT(idx < this->numCoverageStages()); |
137 return fFragmentStages[fNumColorStages + idx]; | 137 return fFragmentStages[fNumColorStages + idx]; |
138 } | 138 } |
139 const GrFragmentStage& getFragmentStage(int idx) const { return fFragmentSta
ges[idx]; } | 139 const GrFragmentStage& getFragmentStage(int idx) const { return fFragmentSta
ges[idx]; } |
140 | 140 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 const GrVertexAttrib* fVAPtr; | 434 const GrVertexAttrib* fVAPtr; |
435 int fVACount; | 435 int fVACount; |
436 size_t fVAStride; | 436 size_t fVAStride; |
437 GrStencilSettings fStencilSettings; | 437 GrStencilSettings fStencilSettings; |
438 uint8_t fCoverage; | 438 uint8_t fCoverage; |
439 DrawFace fDrawFace; | 439 DrawFace fDrawFace; |
440 GrBlendCoeff fSrcBlend; | 440 GrBlendCoeff fSrcBlend; |
441 GrBlendCoeff fDstBlend; | 441 GrBlendCoeff fDstBlend; |
442 | 442 |
443 typedef SkSTArray<8, GrFragmentStage> FragmentStageArray; | 443 typedef SkSTArray<8, GrFragmentStage> FragmentStageArray; |
444 SkAutoTDelete<GrGeometryStage> fGeometryProcessor; | 444 typedef GrProgramElementRef<const GrGeometryProcessor> ProgramGeometryProces
sor; |
445 FragmentStageArray fFragmentStages; | 445 ProgramGeometryProcessor fGeometryProcessor; |
| 446 FragmentStageArray fFragmentStages; |
446 | 447 |
447 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 448 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
448 int fNumColorStages; | 449 int fNumColorStages; |
449 | 450 |
450 // This is simply a different representation of info in fVertexAttribs and t
hus does | 451 // This is simply a different representation of info in fVertexAttribs and t
hus does |
451 // not need to be compared in op==. | 452 // not need to be compared in op==. |
452 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; | 453 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; |
453 | 454 |
454 // These flags are needed to protect the code from creating an unused unifor
m color/coverage | 455 // These flags are needed to protect the code from creating an unused unifor
m color/coverage |
455 // which will cause shader compiler errors. | 456 // which will cause shader compiler errors. |
456 bool fInputColorIsUsed; | 457 bool fInputColorIsUsed; |
457 bool fInputCoverageIsUsed; | 458 bool fInputCoverageIsUsed; |
458 | 459 |
(...skipping 10 matching lines...) Expand all Loading... |
469 PrimaryOutputType fPrimaryOutputType : 8; | 470 PrimaryOutputType fPrimaryOutputType : 8; |
470 SecondaryOutputType fSecondaryOutputType : 8; | 471 SecondaryOutputType fSecondaryOutputType : 8; |
471 | 472 |
472 typedef SkRefCnt INHERITED; | 473 typedef SkRefCnt INHERITED; |
473 }; | 474 }; |
474 | 475 |
475 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); | 476 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); |
476 | 477 |
477 #endif | 478 #endif |
478 | 479 |
OLD | NEW |