| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 int numColorStages() const { return fNumColorStages; } | 91 int numColorStages() const { return fNumColorStages; } |
| 92 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } | 92 int numCoverageStages() const { return fFragmentStages.count() - fNumColorSt
ages; } |
| 93 int numFragmentStages() const { return fFragmentStages.count(); } | 93 int numFragmentStages() const { return fFragmentStages.count(); } |
| 94 int numTotalStages() const { | 94 int numTotalStages() const { |
| 95 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); | 95 return this->numFragmentStages() + (this->hasGeometryProcessor() ? 1 :
0); |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } | 98 bool hasGeometryProcessor() const { return SkToBool(fGeometryProcessor.get()
); } |
| 99 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } | 99 const GrGeometryProcessor* getGeometryProcessor() const { return fGeometryPr
ocessor.get(); } |
| 100 |
| 101 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get(
); } |
| 102 |
| 100 const GrPendingFragmentStage& getColorStage(int idx) const { | 103 const GrPendingFragmentStage& getColorStage(int idx) const { |
| 101 SkASSERT(idx < this->numColorStages()); | 104 SkASSERT(idx < this->numColorStages()); |
| 102 return fFragmentStages[idx]; | 105 return fFragmentStages[idx]; |
| 103 } | 106 } |
| 104 const GrPendingFragmentStage& getCoverageStage(int idx) const { | 107 const GrPendingFragmentStage& getCoverageStage(int idx) const { |
| 105 SkASSERT(idx < this->numCoverageStages()); | 108 SkASSERT(idx < this->numCoverageStages()); |
| 106 return fFragmentStages[fNumColorStages + idx]; | 109 return fFragmentStages[fNumColorStages + idx]; |
| 107 } | 110 } |
| 108 const GrPendingFragmentStage& getFragmentStage(int idx) const { | 111 const GrPendingFragmentStage& getFragmentStage(int idx) const { |
| 109 return fFragmentStages[idx]; | 112 return fFragmentStages[idx]; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 247 |
| 245 enum Flags { | 248 enum Flags { |
| 246 kDither_Flag = 0x1, | 249 kDither_Flag = 0x1, |
| 247 kHWAA_Flag = 0x2, | 250 kHWAA_Flag = 0x2, |
| 248 kDisableColorWrite_Flag = 0x4, | 251 kDisableColorWrite_Flag = 0x4, |
| 249 }; | 252 }; |
| 250 | 253 |
| 251 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 254 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
| 252 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 255 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
| 253 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; | 256 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; |
| 257 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; |
| 254 RenderTarget fRenderTarget; | 258 RenderTarget fRenderTarget; |
| 255 ScissorState fScissorState; | 259 ScissorState fScissorState; |
| 256 GrColor fColor; | 260 GrColor fColor; |
| 257 SkMatrix fViewMatrix; | 261 SkMatrix fViewMatrix; |
| 258 GrColor fBlendConstant; | 262 GrColor fBlendConstant; |
| 259 const GrVertexAttrib* fVAPtr; | 263 const GrVertexAttrib* fVAPtr; |
| 260 int fVACount; | 264 int fVACount; |
| 261 size_t fVAStride; | 265 size_t fVAStride; |
| 262 GrStencilSettings fStencilSettings; | 266 GrStencilSettings fStencilSettings; |
| 263 uint8_t fCoverage; | 267 uint8_t fCoverage; |
| 264 GrDrawState::DrawFace fDrawFace; | 268 GrDrawState::DrawFace fDrawFace; |
| 265 GrDeviceCoordTexture fDstCopy; | 269 GrDeviceCoordTexture fDstCopy; |
| 266 GrBlendCoeff fSrcBlend; | 270 GrBlendCoeff fSrcBlend; |
| 267 GrBlendCoeff fDstBlend; | 271 GrBlendCoeff fDstBlend; |
| 268 uint32_t fFlags; | 272 uint32_t fFlags; |
| 269 ProgramGeometryProcessor fGeometryProcessor; | 273 ProgramGeometryProcessor fGeometryProcessor; |
| 274 ProgramXferProcessor fXferProcessor; |
| 270 FragmentStageArray fFragmentStages; | 275 FragmentStageArray fFragmentStages; |
| 271 | 276 |
| 272 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 277 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
| 273 int fNumColorStages; | 278 int fNumColorStages; |
| 274 | 279 |
| 275 SkAutoSTArray<4, GrVertexAttrib> fOptVA; | 280 SkAutoSTArray<4, GrVertexAttrib> fOptVA; |
| 276 | 281 |
| 277 GrProgramDesc fDesc; | 282 GrProgramDesc fDesc; |
| 278 | 283 |
| 279 typedef SkRefCnt INHERITED; | 284 typedef SkRefCnt INHERITED; |
| 280 }; | 285 }; |
| 281 | 286 |
| 282 #endif | 287 #endif |
| OLD | NEW |