| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 * shaders they require. | 202 * shaders they require. |
| 203 */ | 203 */ |
| 204 void getStageStats(const GrDrawState& ds, int firstColorStageIdx, int firstC
overageStageIdx, | 204 void getStageStats(const GrDrawState& ds, int firstColorStageIdx, int firstC
overageStageIdx, |
| 205 bool hasLocalCoords); | 205 bool hasLocalCoords); |
| 206 | 206 |
| 207 /** | 207 /** |
| 208 * Calculates the primary and secondary output types of the shader. For cert
ain output types | 208 * Calculates the primary and secondary output types of the shader. For cert
ain output types |
| 209 * the function may adjust the blend coefficients. After this function is ca
lled the src and dst | 209 * the function may adjust the blend coefficients. After this function is ca
lled the src and dst |
| 210 * blend coeffs will represent those used by backend API. | 210 * blend coeffs will represent those used by backend API. |
| 211 */ | 211 */ |
| 212 void setOutputStateInfo(const GrDrawState& ds, GrDrawState::BlendOpt, const
GrDrawTargetCaps&); | 212 void setOutputStateInfo(const GrDrawState& ds, GrColor coverage, GrDrawState
::BlendOpt, |
| 213 const GrDrawTargetCaps&); |
| 213 | 214 |
| 214 enum Flags { | 215 enum Flags { |
| 215 kDither_Flag = 0x1, | 216 kDither_Flag = 0x1, |
| 216 kHWAA_Flag = 0x2, | 217 kHWAA_Flag = 0x2, |
| 217 kDisableColorWrite_Flag = 0x4, | 218 kDisableColorWrite_Flag = 0x4, |
| 218 }; | 219 }; |
| 219 | 220 |
| 220 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 221 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
| 221 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 222 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
| 222 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; | 223 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 243 | 244 |
| 244 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 245 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
| 245 int fNumColorStages; | 246 int fNumColorStages; |
| 246 | 247 |
| 247 GrProgramDesc fDesc; | 248 GrProgramDesc fDesc; |
| 248 | 249 |
| 249 typedef SkRefCnt INHERITED; | 250 typedef SkRefCnt INHERITED; |
| 250 }; | 251 }; |
| 251 | 252 |
| 252 #endif | 253 #endif |
| OLD | NEW |