diff options
Diffstat (limited to 'src/gpu/GrOptDrawState.h')
-rw-r--r-- | src/gpu/GrOptDrawState.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h index f0a726e954..1f8c442230 100644 --- a/src/gpu/GrOptDrawState.h +++ b/src/gpu/GrOptDrawState.h @@ -8,7 +8,15 @@ #ifndef GrOptDrawState_DEFINED #define GrOptDrawState_DEFINED -#include "GrDrawState.h" +#include "GrColor.h" +#include "GrGpu.h" +#include "GrProcessorStage.h" +#include "GrStencil.h" +#include "GrTypesPriv.h" +#include "SkMatrix.h" +#include "SkRefCnt.h" + +class GrDrawState; /** * Class that holds an optimized version of a GrDrawState. It is meant to be an immutable class, @@ -16,6 +24,15 @@ */ class GrOptDrawState : public SkRefCnt { public: + /** + * Returns a snapshot of the current optimized state. If the current drawState has a valid + * cached optimiezed state it will simply return a pointer to it otherwise it will create a new + * GrOptDrawState. In all cases the GrOptDrawState is reffed and ownership is given to the + * caller. + */ + static GrOptDrawState* Create(const GrDrawState& drawState, const GrDrawTargetCaps& caps, + GrGpu::DrawType drawType); + bool operator== (const GrOptDrawState& that) const; /////////////////////////////////////////////////////////////////////////// @@ -443,7 +460,6 @@ private: PrimaryOutputType fPrimaryOutputType : 8; SecondaryOutputType fSecondaryOutputType : 8; - friend GrOptDrawState* GrDrawState::createOptState(const GrDrawTargetCaps&) const; typedef SkRefCnt INHERITED; }; |