Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: src/gpu/GrOptDrawState.h

Issue 637003003: Opt state takes a GP instead of a GeometryStage (Closed) Base URL: https://skia.googlesource.com/skia.git@builder_cleanup
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
120 //// 120 ////
121 121
122 int numColorStages() const { return fColorStages.count(); } 122 int numColorStages() const { return fColorStages.count(); }
123 int numCoverageStages() const { return fCoverageStages.count(); } 123 int numCoverageStages() const { return fCoverageStages.count(); }
124 int numTotalStages() const { 124 int numTotalStages() const {
125 return this->numColorStages() + this->numCoverageStages() + 125 return this->numColorStages() + this->numCoverageStages() +
126 (this->hasGeometryProcessor() ? 1 : 0); 126 (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 { return fColorStages[id x]; } 131 const GrFragmentStage& getColorStage(int idx) const { return fColorStages[id x]; }
132 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta ges[idx]; } 132 const GrFragmentStage& getCoverageStage(int idx) const { return fCoverageSta ges[idx]; }
133 133
134 /// @} 134 /// @}
135 135
136 /////////////////////////////////////////////////////////////////////////// 136 ///////////////////////////////////////////////////////////////////////////
137 /// @name Blending 137 /// @name Blending
138 //// 138 ////
139 139
140 GrBlendCoeff getSrcBlendCoeff() const { return fSrcBlend; } 140 GrBlendCoeff getSrcBlendCoeff() const { return fSrcBlend; }
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 const GrVertexAttrib* fVAPtr; 427 const GrVertexAttrib* fVAPtr;
428 int fVACount; 428 int fVACount;
429 size_t fVAStride; 429 size_t fVAStride;
430 GrStencilSettings fStencilSettings; 430 GrStencilSettings fStencilSettings;
431 uint8_t fCoverage; 431 uint8_t fCoverage;
432 DrawFace fDrawFace; 432 DrawFace fDrawFace;
433 GrBlendCoeff fSrcBlend; 433 GrBlendCoeff fSrcBlend;
434 GrBlendCoeff fDstBlend; 434 GrBlendCoeff fDstBlend;
435 435
436 typedef SkSTArray<8, GrFragmentStage> FragmentStageArray; 436 typedef SkSTArray<8, GrFragmentStage> FragmentStageArray;
437 SkAutoTDelete<GrGeometryStage> fGeometryProcessor; 437 typedef GrProgramElementRef<const GrGeometryProcessor> ProgramGeometryProces sor;
438 FragmentStageArray fColorStages; 438 ProgramGeometryProcessor fGeometryProcessor;
439 FragmentStageArray fCoverageStages; 439 FragmentStageArray fColorStages;
440 FragmentStageArray fCoverageStages;
440 441
441 // This is simply a different representation of info in fVertexAttribs and t hus does 442 // This is simply a different representation of info in fVertexAttribs and t hus does
442 // not need to be compared in op==. 443 // not need to be compared in op==.
443 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ]; 444 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ];
444 445
445 // These flags are needed to protect the code from creating an unused unifor m color/coverage 446 // These flags are needed to protect the code from creating an unused unifor m color/coverage
446 // which will cause shader compiler errors. 447 // which will cause shader compiler errors.
447 bool fInputColorIsUsed; 448 bool fInputColorIsUsed;
448 bool fInputCoverageIsUsed; 449 bool fInputCoverageIsUsed;
449 450
(...skipping 10 matching lines...) Expand all
460 PrimaryOutputType fPrimaryOutputType : 8; 461 PrimaryOutputType fPrimaryOutputType : 8;
461 SecondaryOutputType fSecondaryOutputType : 8; 462 SecondaryOutputType fSecondaryOutputType : 8;
462 463
463 typedef SkRefCnt INHERITED; 464 typedef SkRefCnt INHERITED;
464 }; 465 };
465 466
466 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); 467 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags);
467 468
468 #endif 469 #endif
469 470
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698