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

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

Issue 647183002: Revert of 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
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr ocessor.get(); } 130 const GrGeometryStage* getGeometryProcessor() const { return fGeometryProces sor.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
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 typedef GrProgramElementRef<const GrGeometryProcessor> ProgramGeometryProces sor; 444 SkAutoTDelete<GrGeometryStage> fGeometryProcessor;
445 ProgramGeometryProcessor fGeometryProcessor; 445 FragmentStageArray fFragmentStages;
446 FragmentStageArray fFragmentStages;
447 446
448 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin. 447 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin.
449 int fNumColorStages; 448 int fNumColorStages;
450 449
451 // This is simply a different representation of info in fVertexAttribs and t hus does 450 // This is simply a different representation of info in fVertexAttribs and t hus does
452 // not need to be compared in op==. 451 // not need to be compared in op==.
453 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ]; 452 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ];
454 453
455 // These flags are needed to protect the code from creating an unused unifor m color/coverage 454 // These flags are needed to protect the code from creating an unused unifor m color/coverage
456 // which will cause shader compiler errors. 455 // which will cause shader compiler errors.
457 bool fInputColorIsUsed; 456 bool fInputColorIsUsed;
458 bool fInputCoverageIsUsed; 457 bool fInputCoverageIsUsed;
459 458
(...skipping 10 matching lines...) Expand all
470 PrimaryOutputType fPrimaryOutputType : 8; 469 PrimaryOutputType fPrimaryOutputType : 8;
471 SecondaryOutputType fSecondaryOutputType : 8; 470 SecondaryOutputType fSecondaryOutputType : 8;
472 471
473 typedef SkRefCnt INHERITED; 472 typedef SkRefCnt INHERITED;
474 }; 473 };
475 474
476 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); 475 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags);
477 476
478 #endif 477 #endif
479 478
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698