| 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 : public SkRefCnt { | 27 class GrOptDrawState : public SkRefCnt { |
| 28 public: | 28 public: |
| 29 /** | 29 /** |
| 30 * Returns a snapshot of the current optimized state. The GrOptDrawState is
reffed and ownership | 30 * Returns a snapshot of the current optimized state. The GrOptDrawState is
reffed and ownership |
| 31 * is given to the caller. | 31 * is given to the caller. |
| 32 */ | 32 */ |
| 33 static GrOptDrawState* Create(const GrDrawState& drawState, GrGpu*, | 33 static GrOptDrawState* Create(GrGpu*, |
| 34 const GrDeviceCoordTexture* dstCopy, GrGpu::Dr
awType drawType); | 34 const GrDrawState& drawState, |
| 35 const GrDeviceCoordTexture* dstCopy, |
| 36 GrGpu::DrawType drawType); |
| 35 | 37 |
| 36 bool operator== (const GrOptDrawState& that) const; | 38 bool operator== (const GrOptDrawState& that) const; |
| 37 | 39 |
| 38 /////////////////////////////////////////////////////////////////////////// | 40 /////////////////////////////////////////////////////////////////////////// |
| 39 /// @name Vertex Attributes | 41 /// @name Vertex Attributes |
| 40 //// | 42 //// |
| 41 | 43 |
| 42 enum { | 44 enum { |
| 43 kMaxVertexAttribCnt = kLast_GrVertexAttribBinding + 4, | 45 kMaxVertexAttribCnt = kLast_GrVertexAttribBinding + 4, |
| 44 }; | 46 }; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 * Emit transparent black instead of the src color, no need to compute c
overage. | 301 * Emit transparent black instead of the src color, no need to compute c
overage. |
| 300 */ | 302 */ |
| 301 kEmitTransBlack_BlendOptFlag = 0x8, | 303 kEmitTransBlack_BlendOptFlag = 0x8, |
| 302 }; | 304 }; |
| 303 GR_DECL_BITFIELD_OPS_FRIENDS(BlendOptFlags); | 305 GR_DECL_BITFIELD_OPS_FRIENDS(BlendOptFlags); |
| 304 | 306 |
| 305 /** | 307 /** |
| 306 * Constructs and optimized drawState out of a GrRODrawState. | 308 * Constructs and optimized drawState out of a GrRODrawState. |
| 307 */ | 309 */ |
| 308 GrOptDrawState(const GrDrawState& drawState, BlendOptFlags blendOptFlags, | 310 GrOptDrawState(const GrDrawState& drawState, BlendOptFlags blendOptFlags, |
| 309 GrBlendCoeff optSrcCoeff, GrBlendCoeff optDstCoeff, | 311 GrBlendCoeff optSrcCoeff, GrBlendCoeff optDstCoeff, GrGpu*, |
| 310 GrGpu*, const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType)
; | 312 const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType); |
| 311 | 313 |
| 312 /** | 314 /** |
| 313 * Loops through all the color stage effects to check if the stage will igno
re color input or | 315 * Loops through all the color stage effects to check if the stage will igno
re color input or |
| 314 * always output a constant color. In the ignore color input case we can ign
ore all previous | 316 * always output a constant color. In the ignore color input case we can ign
ore all previous |
| 315 * stages. In the constant color case, we can ignore all previous stages and | 317 * stages. In the constant color case, we can ignore all previous stages and |
| 316 * the current one and set the state color to the constant color. | 318 * the current one and set the state color to the constant color. |
| 317 */ | 319 */ |
| 318 void computeEffectiveColorStages(const GrDrawState& ds, GrProgramDesc::DescI
nfo*, | 320 void computeEffectiveColorStages(const GrDrawState& ds, GrProgramDesc::DescI
nfo*, |
| 319 int* firstColorStageIdx, uint8_t* fixFuncti
onVAToRemove); | 321 int* firstColorStageIdx, uint8_t* fixFuncti
onVAToRemove); |
| 320 | 322 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 390 |
| 389 GrProgramDesc fDesc; | 391 GrProgramDesc fDesc; |
| 390 | 392 |
| 391 typedef SkRefCnt INHERITED; | 393 typedef SkRefCnt INHERITED; |
| 392 }; | 394 }; |
| 393 | 395 |
| 394 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); | 396 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); |
| 395 | 397 |
| 396 #endif | 398 #endif |
| 397 | 399 |
| OLD | NEW |