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 |
11 #include "GrColor.h" | 11 #include "GrColor.h" |
12 #include "GrGpu.h" | 12 #include "GrGpu.h" |
13 #include "GrPendingFragmentStage.h" | 13 #include "GrPendingFragmentStage.h" |
14 #include "GrProgramDesc.h" | 14 #include "GrProgramDesc.h" |
15 #include "GrStencil.h" | 15 #include "GrStencil.h" |
16 #include "GrTypesPriv.h" | 16 #include "GrTypesPriv.h" |
17 #include "SkMatrix.h" | 17 #include "SkMatrix.h" |
18 #include "SkRefCnt.h" | 18 #include "SkRefCnt.h" |
19 | 19 |
20 class GrDeviceCoordTexture; | 20 class GrDeviceCoordTexture; |
21 class GrDrawState; | 21 class GrDrawState; |
22 class GrPathProcessor; | |
22 | 23 |
23 /** | 24 /** |
24 * Class that holds an optimized version of a GrDrawState. It is meant to be an immutable class, | 25 * Class that holds an optimized version of a GrDrawState. It is meant to be an immutable class, |
25 * and contains all data needed to set the state for a gpu draw. | 26 * and contains all data needed to set the state for a gpu draw. |
26 */ | 27 */ |
27 class GrOptDrawState { | 28 class GrOptDrawState { |
28 public: | 29 public: |
29 SK_DECLARE_INST_COUNT(GrOptDrawState) | 30 SK_DECLARE_INST_COUNT(GrOptDrawState) |
30 | 31 |
31 typedef GrClipMaskManager::ScissorState ScissorState; | 32 typedef GrClipMaskManager::ScissorState ScissorState; |
32 | 33 |
33 GrOptDrawState(const GrDrawState& drawState, GrColor, uint8_t coverage, cons t GrDrawTargetCaps&, | 34 GrOptDrawState(const GrDrawState& drawState, const GrGeometryProcessor*, con st GrPathProcessor*, |
34 const ScissorState&, const GrDeviceCoordTexture* dstCopy, GrG pu::DrawType); | 35 const GrDrawTargetCaps&, const ScissorState&, |
36 const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType); | |
35 | 37 |
36 bool operator== (const GrOptDrawState& that) const; | 38 bool operator== (const GrOptDrawState& that) const; |
37 bool operator!= (const GrOptDrawState& that) const { return !(*this == that) ; } | 39 bool operator!= (const GrOptDrawState& that) const { return !(*this == that) ; } |
38 | 40 |
39 /// @} | 41 /// @} |
40 | 42 |
41 /////////////////////////////////////////////////////////////////////////// | 43 /////////////////////////////////////////////////////////////////////////// |
42 /// @name Color | 44 /// @name Color |
43 //// | 45 //// |
44 | 46 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 const GrProcOptInfo& colorPOI, | 201 const GrProcOptInfo& colorPOI, |
200 const GrProcOptInfo& coveragePOI, | 202 const GrProcOptInfo& coveragePOI, |
201 int* firstColorStageIdx, | 203 int* firstColorStageIdx, |
202 int* firstCoverageStageIdx); | 204 int* firstCoverageStageIdx); |
203 | 205 |
204 /** | 206 /** |
205 * Calculates the primary and secondary output types of the shader. For cert ain output types | 207 * Calculates the primary and secondary output types of the shader. For cert ain output types |
206 * the function may adjust the blend coefficients. After this function is ca lled the src and dst | 208 * the function may adjust the blend coefficients. After this function is ca lled the src and dst |
207 * blend coeffs will represent those used by backend API. | 209 * blend coeffs will represent those used by backend API. |
208 */ | 210 */ |
209 void setOutputStateInfo(const GrDrawState& ds, GrColor coverage, GrXferProce ssor::OptFlags, | 211 void setOutputStateInfo(const GrDrawState& ds, GrXferProcessor::OptFlags, |
egdaniel
2014/12/10 15:54:30
this function is being removed in cl landing now
| |
210 const GrDrawTargetCaps&); | 212 const GrDrawTargetCaps&); |
211 | 213 |
212 enum Flags { | 214 enum Flags { |
213 kDither_Flag = 0x1, | 215 kDither_Flag = 0x1, |
214 kHWAA_Flag = 0x2, | 216 kHWAA_Flag = 0x2, |
215 kDisableColorWrite_Flag = 0x4, | 217 kDisableColorWrite_Flag = 0x4, |
216 }; | 218 }; |
217 | 219 |
218 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 220 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
219 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 221 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
220 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr ocessor; | 222 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr ocessor; |
223 typedef GrPendingProgramElement<const GrPrimitiveProcessor> ProgramPrimitive Processor; | |
221 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; | 224 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; |
222 RenderTarget fRenderTarget; | 225 RenderTarget fRenderTarget; |
223 ScissorState fScissorState; | 226 ScissorState fScissorState; |
224 GrColor fColor; | 227 GrColor fColor; |
225 SkMatrix fViewMatrix; | 228 SkMatrix fViewMatrix; |
226 GrColor fBlendConstant; | 229 GrColor fBlendConstant; |
227 GrStencilSettings fStencilSettings; | 230 GrStencilSettings fStencilSettings; |
228 uint8_t fCoverage; | 231 uint8_t fCoverage; |
229 GrDrawState::DrawFace fDrawFace; | 232 GrDrawState::DrawFace fDrawFace; |
230 GrDeviceCoordTexture fDstCopy; | 233 GrDeviceCoordTexture fDstCopy; |
231 GrBlendCoeff fSrcBlend; | 234 GrBlendCoeff fSrcBlend; |
232 GrBlendCoeff fDstBlend; | 235 GrBlendCoeff fDstBlend; |
233 uint32_t fFlags; | 236 uint32_t fFlags; |
234 ProgramGeometryProcessor fGeometryProcessor; | 237 ProgramGeometryProcessor fGeometryProcessor; |
238 ProgramPrimitiveProcessor fPrimitiveProcessor; | |
235 GrBatchTracker fBatchTracker; | 239 GrBatchTracker fBatchTracker; |
236 ProgramXferProcessor fXferProcessor; | 240 ProgramXferProcessor fXferProcessor; |
237 FragmentStageArray fFragmentStages; | 241 FragmentStageArray fFragmentStages; |
238 GrGpu::DrawType fDrawType; | 242 GrGpu::DrawType fDrawType; |
239 GrProgramDesc::DescInfo fDescInfo; | 243 GrProgramDesc::DescInfo fDescInfo; |
240 bool fFinalized; | 244 bool fFinalized; |
241 | 245 |
242 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin. | 246 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin. |
243 int fNumColorStages; | 247 int fNumColorStages; |
244 | 248 |
245 GrProgramDesc fDesc; | 249 GrProgramDesc fDesc; |
246 | 250 |
247 typedef SkRefCnt INHERITED; | 251 typedef SkRefCnt INHERITED; |
248 }; | 252 }; |
249 | 253 |
250 #endif | 254 #endif |
OLD | NEW |