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 12 matching lines...) Expand all Loading... |
23 /** | 23 /** |
24 * Class that holds an optimized version of a GrDrawState. It is meant to be an
immutable class, | 24 * 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. | 25 * and contains all data needed to set the state for a gpu draw. |
26 */ | 26 */ |
27 class GrOptDrawState { | 27 class GrOptDrawState { |
28 public: | 28 public: |
29 SK_DECLARE_INST_COUNT(GrOptDrawState) | 29 SK_DECLARE_INST_COUNT(GrOptDrawState) |
30 | 30 |
31 typedef GrClipMaskManager::ScissorState ScissorState; | 31 typedef GrClipMaskManager::ScissorState ScissorState; |
32 | 32 |
33 GrOptDrawState(const GrDrawState& drawState, const GrDrawTargetCaps&, const
ScissorState&, | 33 GrOptDrawState(const GrDrawState& drawState, GrColor, uint8_t coverage, cons
t GrDrawTargetCaps&, |
34 const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType); | 34 const ScissorState&, const GrDeviceCoordTexture* dstCopy, GrG
pu::DrawType); |
35 | 35 |
36 bool operator== (const GrOptDrawState& that) const; | 36 bool operator== (const GrOptDrawState& that) const; |
37 bool operator!= (const GrOptDrawState& that) const { return !(*this == that)
; } | 37 bool operator!= (const GrOptDrawState& that) const { return !(*this == that)
; } |
38 | 38 |
39 /// @} | 39 /// @} |
40 | 40 |
41 /////////////////////////////////////////////////////////////////////////// | 41 /////////////////////////////////////////////////////////////////////////// |
42 /// @name Color | 42 /// @name Color |
43 //// | 43 //// |
44 | 44 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 const GrProcOptInfo& colorPOI, | 199 const GrProcOptInfo& colorPOI, |
200 const GrProcOptInfo& coveragePOI, | 200 const GrProcOptInfo& coveragePOI, |
201 int* firstColorStageIdx, | 201 int* firstColorStageIdx, |
202 int* firstCoverageStageIdx); | 202 int* firstCoverageStageIdx); |
203 | 203 |
204 /** | 204 /** |
205 * Calculates the primary and secondary output types of the shader. For cert
ain output types | 205 * 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 | 206 * 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. | 207 * blend coeffs will represent those used by backend API. |
208 */ | 208 */ |
209 void setOutputStateInfo(const GrDrawState& ds, GrXferProcessor::OptFlags, | 209 void setOutputStateInfo(const GrDrawState& ds, GrColor coverage, GrXferProce
ssor::OptFlags, |
210 const GrDrawTargetCaps&); | 210 const GrDrawTargetCaps&); |
211 | 211 |
212 enum Flags { | 212 enum Flags { |
213 kDither_Flag = 0x1, | 213 kDither_Flag = 0x1, |
214 kHWAA_Flag = 0x2, | 214 kHWAA_Flag = 0x2, |
215 kDisableColorWrite_Flag = 0x4, | 215 kDisableColorWrite_Flag = 0x4, |
216 }; | 216 }; |
217 | 217 |
218 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 218 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
219 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 219 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
(...skipping 21 matching lines...) Expand all Loading... |
241 | 241 |
242 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 242 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
243 int fNumColorStages; | 243 int fNumColorStages; |
244 | 244 |
245 GrProgramDesc fDesc; | 245 GrProgramDesc fDesc; |
246 | 246 |
247 typedef SkRefCnt INHERITED; | 247 typedef SkRefCnt INHERITED; |
248 }; | 248 }; |
249 | 249 |
250 #endif | 250 #endif |
OLD | NEW |