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

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

Issue 509153002: Initial change to create GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: last warning Created 6 years, 3 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/GrOvalRenderer.cpp ('k') | src/gpu/GrRODrawState.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 GrRODrawState_DEFINED 8 #ifndef GrRODrawState_DEFINED
9 #define GrRODrawState_DEFINED 9 #define GrRODrawState_DEFINED
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 /// The input color to the first color-stage is either the constant color or interpolated 114 /// The input color to the first color-stage is either the constant color or interpolated
115 /// per-vertex colors. The input to the first coverage stage is either a con stant coverage 115 /// per-vertex colors. The input to the first coverage stage is either a con stant coverage
116 /// (usually full-coverage) or interpolated per-vertex coverage. 116 /// (usually full-coverage) or interpolated per-vertex coverage.
117 /// 117 ///
118 /// See the documentation of kCoverageDrawing_StateBit for information about disabling the 118 /// See the documentation of kCoverageDrawing_StateBit for information about disabling the
119 /// the color / coverage distinction. 119 /// the color / coverage distinction.
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 { return this->numColorStages() + this->numCovera geStages(); } 124 int numTotalStages() const {
125 return this->numColorStages() + this->numCoverageStages() +
126 (this->hasGeometryProcessor() ? 1 : 0);
127 }
125 128
129 bool hasGeometryProcessor() const { return NULL != fGeometryProcessor.get(); }
130 const GrEffectStage* getGeometryProcessor() const { return fGeometryProcesso r.get(); }
126 const GrEffectStage& getColorStage(int stageIdx) const { return fColorStages [stageIdx]; } 131 const GrEffectStage& getColorStage(int stageIdx) const { return fColorStages [stageIdx]; }
127 const GrEffectStage& getCoverageStage(int stageIdx) const { return fCoverage Stages[stageIdx]; } 132 const GrEffectStage& getCoverageStage(int stageIdx) const { return fCoverage Stages[stageIdx]; }
128 133
129 /** 134 /**
130 * Checks whether any of the effects will read the dst pixel color. 135 * Checks whether any of the effects will read the dst pixel color.
131 */ 136 */
132 bool willEffectReadDstColor() const; 137 bool willEffectReadDstColor() const;
133 138
134 /// @} 139 /// @}
135 140
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 const GrVertexAttrib* fVAPtr; 356 const GrVertexAttrib* fVAPtr;
352 int fVACount; 357 int fVACount;
353 size_t fVAStride; 358 size_t fVAStride;
354 GrStencilSettings fStencilSettings; 359 GrStencilSettings fStencilSettings;
355 uint8_t fCoverage; 360 uint8_t fCoverage;
356 DrawFace fDrawFace; 361 DrawFace fDrawFace;
357 GrBlendCoeff fSrcBlend; 362 GrBlendCoeff fSrcBlend;
358 GrBlendCoeff fDstBlend; 363 GrBlendCoeff fDstBlend;
359 364
360 typedef SkSTArray<4, GrEffectStage> EffectStageArray; 365 typedef SkSTArray<4, GrEffectStage> EffectStageArray;
366 SkAutoTDelete<GrEffectStage> fGeometryProcessor;
361 EffectStageArray fColorStages; 367 EffectStageArray fColorStages;
362 EffectStageArray fCoverageStages; 368 EffectStageArray fCoverageStages;
363 369
364 mutable GrBlendCoeff fOptSrcBlend; 370 mutable GrBlendCoeff fOptSrcBlend;
365 mutable GrBlendCoeff fOptDstBlend; 371 mutable GrBlendCoeff fOptDstBlend;
366 mutable BlendOptFlags fBlendOptFlags; 372 mutable BlendOptFlags fBlendOptFlags;
367 373
368 // This is simply a different representation of info in fVertexAttribs and t hus does 374 // This is simply a different representation of info in fVertexAttribs and t hus does
369 // not need to be compared in op==. 375 // not need to be compared in op==.
370 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ]; 376 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ];
371 377
372 private: 378 private:
373 typedef SkRefCnt INHERITED; 379 typedef SkRefCnt INHERITED;
374 }; 380 };
375 381
376 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags); 382 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags);
377 383
378 #endif 384 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrRODrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698