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

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

Issue 751283002: Add XferProcessor factory in GrPaint and GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comiple bug Created 6 years 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/GrDrawState.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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 int numColorStages() const { return fNumColorStages; } 78 int numColorStages() const { return fNumColorStages; }
79 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt ages; } 79 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt ages; }
80 int numFragmentStages() const { return fFragmentStages.count(); } 80 int numFragmentStages() const { return fFragmentStages.count(); }
81 int numTotalStages() const { 81 int numTotalStages() const {
82 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 : 0); 82 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 : 0);
83 } 83 }
84 84
85 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get() ); } 85 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get() ); }
86 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr ocessor.get(); } 86 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr ocessor.get(); }
87
88 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get( ); }
89
87 const GrPendingFragmentStage& getColorStage(int idx) const { 90 const GrPendingFragmentStage& getColorStage(int idx) const {
88 SkASSERT(idx < this->numColorStages()); 91 SkASSERT(idx < this->numColorStages());
89 return fFragmentStages[idx]; 92 return fFragmentStages[idx];
90 } 93 }
91 const GrPendingFragmentStage& getCoverageStage(int idx) const { 94 const GrPendingFragmentStage& getCoverageStage(int idx) const {
92 SkASSERT(idx < this->numCoverageStages()); 95 SkASSERT(idx < this->numCoverageStages());
93 return fFragmentStages[fNumColorStages + idx]; 96 return fFragmentStages[fNumColorStages + idx];
94 } 97 }
95 const GrPendingFragmentStage& getFragmentStage(int idx) const { 98 const GrPendingFragmentStage& getFragmentStage(int idx) const {
96 return fFragmentStages[idx]; 99 return fFragmentStages[idx];
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 226
224 enum Flags { 227 enum Flags {
225 kDither_Flag = 0x1, 228 kDither_Flag = 0x1,
226 kHWAA_Flag = 0x2, 229 kHWAA_Flag = 0x2,
227 kDisableColorWrite_Flag = 0x4, 230 kDisableColorWrite_Flag = 0x4,
228 }; 231 };
229 232
230 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; 233 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget;
231 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; 234 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray;
232 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr ocessor; 235 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr ocessor;
236 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor;
233 RenderTarget fRenderTarget; 237 RenderTarget fRenderTarget;
234 ScissorState fScissorState; 238 ScissorState fScissorState;
235 GrColor fColor; 239 GrColor fColor;
236 SkMatrix fViewMatrix; 240 SkMatrix fViewMatrix;
237 GrColor fBlendConstant; 241 GrColor fBlendConstant;
238 GrStencilSettings fStencilSettings; 242 GrStencilSettings fStencilSettings;
239 uint8_t fCoverage; 243 uint8_t fCoverage;
240 GrDrawState::DrawFace fDrawFace; 244 GrDrawState::DrawFace fDrawFace;
241 GrDeviceCoordTexture fDstCopy; 245 GrDeviceCoordTexture fDstCopy;
242 GrBlendCoeff fSrcBlend; 246 GrBlendCoeff fSrcBlend;
243 GrBlendCoeff fDstBlend; 247 GrBlendCoeff fDstBlend;
244 uint32_t fFlags; 248 uint32_t fFlags;
245 ProgramGeometryProcessor fGeometryProcessor; 249 ProgramGeometryProcessor fGeometryProcessor;
250 ProgramXferProcessor fXferProcessor;
246 FragmentStageArray fFragmentStages; 251 FragmentStageArray fFragmentStages;
247 252
248 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin. 253 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin.
249 int fNumColorStages; 254 int fNumColorStages;
250 255
251 GrProgramDesc fDesc; 256 GrProgramDesc fDesc;
252 257
253 typedef SkRefCnt INHERITED; 258 typedef SkRefCnt INHERITED;
254 }; 259 };
255 260
256 #endif 261 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698