| 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 "GrProcessorStage.h" | 13 #include "GrProcessorStage.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 | 22 |
| 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. If the current drawSta
te has a valid | 30 * Returns a snapshot of the current optimized state. The GrOptDrawState is
reffed and ownership |
| 31 * cached optimiezed state it will simply return a pointer to it otherwise i
t will create a new | 31 * is given to the caller. |
| 32 * GrOptDrawState. In all cases the GrOptDrawState is reffed and ownership i
s given to the | |
| 33 * caller. | |
| 34 */ | 32 */ |
| 35 static GrOptDrawState* Create(const GrDrawState& drawState, GrGpu*, | 33 static GrOptDrawState* Create(const GrDrawState& drawState, GrGpu*, |
| 36 const GrDeviceCoordTexture* dstCopy, GrGpu::Dr
awType drawType); | 34 const GrDeviceCoordTexture* dstCopy, GrGpu::Dr
awType drawType); |
| 37 | 35 |
| 38 bool operator== (const GrOptDrawState& that) const; | 36 bool operator== (const GrOptDrawState& that) const; |
| 39 | 37 |
| 40 /////////////////////////////////////////////////////////////////////////// | 38 /////////////////////////////////////////////////////////////////////////// |
| 41 /// @name Vertex Attributes | 39 /// @name Vertex Attributes |
| 42 //// | 40 //// |
| 43 | 41 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 389 |
| 392 GrProgramDesc fDesc; | 390 GrProgramDesc fDesc; |
| 393 | 391 |
| 394 typedef SkRefCnt INHERITED; | 392 typedef SkRefCnt INHERITED; |
| 395 }; | 393 }; |
| 396 | 394 |
| 397 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); | 395 GR_MAKE_BITFIELD_OPS(GrOptDrawState::BlendOptFlags); |
| 398 | 396 |
| 399 #endif | 397 #endif |
| 400 | 398 |
| OLD | NEW |