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 11 matching lines...) Expand all Loading... |
22 class GrPathProcessor; | 22 class GrPathProcessor; |
23 | 23 |
24 /** | 24 /** |
25 * 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, |
26 * 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. |
27 */ | 27 */ |
28 class GrOptDrawState { | 28 class GrOptDrawState { |
29 public: | 29 public: |
30 SK_DECLARE_INST_COUNT(GrOptDrawState) | 30 SK_DECLARE_INST_COUNT(GrOptDrawState) |
31 | 31 |
32 typedef GrClipMaskManager::ScissorState ScissorState; | |
33 | |
34 GrOptDrawState(const GrDrawState& drawState, const GrGeometryProcessor*, con
st GrPathProcessor*, | 32 GrOptDrawState(const GrDrawState& drawState, const GrGeometryProcessor*, con
st GrPathProcessor*, |
35 const GrDrawTargetCaps&, const ScissorState&, | 33 const GrDrawTargetCaps&, const GrScissorState&, |
36 const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType); | 34 const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType); |
37 | 35 |
38 /* | 36 /* |
39 * Returns true if it is possible to combine the two GrOptDrawStates and it
will update 'this' | 37 * Returns true if it is possible to combine the two GrOptDrawStates and it
will update 'this' |
40 * to subsume 'that''s draw. | 38 * to subsume 'that''s draw. |
41 */ | 39 */ |
42 bool combineIfPossible(const GrOptDrawState& that); | 40 bool combineIfPossible(const GrOptDrawState& that); |
43 | 41 |
44 /// @} | 42 /// @} |
45 | 43 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 //// | 114 //// |
117 | 115 |
118 const GrStencilSettings& getStencil() const { return fStencilSettings; } | 116 const GrStencilSettings& getStencil() const { return fStencilSettings; } |
119 | 117 |
120 /// @} | 118 /// @} |
121 | 119 |
122 /////////////////////////////////////////////////////////////////////////// | 120 /////////////////////////////////////////////////////////////////////////// |
123 /// @name ScissorState | 121 /// @name ScissorState |
124 //// | 122 //// |
125 | 123 |
126 const ScissorState& getScissorState() const { return fScissorState; } | 124 const GrScissorState& getScissorState() const { return fScissorState; } |
127 | 125 |
128 /// @} | 126 /// @} |
129 | 127 |
130 | 128 |
131 /////////////////////////////////////////////////////////////////////////// | 129 /////////////////////////////////////////////////////////////////////////// |
132 /// @name Boolean Queries | 130 /// @name Boolean Queries |
133 //// | 131 //// |
134 | 132 |
135 bool isDitherState() const { return SkToBool(fFlags & kDither_Flag); } | 133 bool isDitherState() const { return SkToBool(fFlags & kDither_Flag); } |
136 bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); } | 134 bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 kHWAA_Flag = 0x2, | 181 kHWAA_Flag = 0x2, |
184 kDisableColorWrite_Flag = 0x4, | 182 kDisableColorWrite_Flag = 0x4, |
185 }; | 183 }; |
186 | 184 |
187 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 185 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
188 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 186 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
189 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; | 187 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; |
190 typedef GrPendingProgramElement<const GrPrimitiveProcessor> ProgramPrimitive
Processor; | 188 typedef GrPendingProgramElement<const GrPrimitiveProcessor> ProgramPrimitive
Processor; |
191 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; | 189 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; |
192 RenderTarget fRenderTarget; | 190 RenderTarget fRenderTarget; |
193 ScissorState fScissorState; | 191 GrScissorState fScissorState; |
194 SkMatrix fViewMatrix; | 192 SkMatrix fViewMatrix; |
195 GrStencilSettings fStencilSettings; | 193 GrStencilSettings fStencilSettings; |
196 GrDrawState::DrawFace fDrawFace; | 194 GrDrawState::DrawFace fDrawFace; |
197 GrDeviceCoordTexture fDstCopy; | 195 GrDeviceCoordTexture fDstCopy; |
198 uint32_t fFlags; | 196 uint32_t fFlags; |
199 ProgramGeometryProcessor fGeometryProcessor; | 197 ProgramGeometryProcessor fGeometryProcessor; |
200 ProgramPrimitiveProcessor fPrimitiveProcessor; | 198 ProgramPrimitiveProcessor fPrimitiveProcessor; |
201 GrBatchTracker fBatchTracker; | 199 GrBatchTracker fBatchTracker; |
202 ProgramXferProcessor fXferProcessor; | 200 ProgramXferProcessor fXferProcessor; |
203 FragmentStageArray fFragmentStages; | 201 FragmentStageArray fFragmentStages; |
204 GrGpu::DrawType fDrawType; | 202 GrGpu::DrawType fDrawType; |
205 GrProgramDesc::DescInfo fDescInfo; | 203 GrProgramDesc::DescInfo fDescInfo; |
206 bool fFinalized; | 204 bool fFinalized; |
207 | 205 |
208 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 206 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
209 int fNumColorStages; | 207 int fNumColorStages; |
210 | 208 |
211 GrProgramDesc fDesc; | 209 GrProgramDesc fDesc; |
212 | 210 |
213 typedef SkRefCnt INHERITED; | 211 typedef SkRefCnt INHERITED; |
214 }; | 212 }; |
215 | 213 |
216 #endif | 214 #endif |
OLD | NEW |