OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
11 | 11 |
12 #include "GrBlend.h" | 12 #include "GrBlend.h" |
13 #include "GrDrawTargetCaps.h" | 13 #include "GrDrawTargetCaps.h" |
14 #include "GrGeometryProcessor.h" | 14 #include "GrGeometryProcessor.h" |
15 #include "GrGpuResourceRef.h" | 15 #include "GrGpuResourceRef.h" |
16 #include "GrProcessorStage.h" | 16 #include "GrProcessorStage.h" |
17 #include "GrProcOptInfo.h" | 17 #include "GrProcOptInfo.h" |
18 #include "GrRenderTarget.h" | 18 #include "GrRenderTarget.h" |
19 #include "GrStencil.h" | 19 #include "GrStencil.h" |
20 #include "SkMatrix.h" | 20 #include "SkMatrix.h" |
21 #include "effects/GrSimpleTextureEffect.h" | 21 #include "effects/GrSimpleTextureEffect.h" |
22 | 22 |
23 class GrDrawTargetCaps; | 23 class GrDrawTargetCaps; |
24 class GrOptDrawState; | 24 class GrOptDrawState; |
25 class GrPaint; | 25 class GrPaint; |
26 class GrTexture; | 26 class GrTexture; |
27 | 27 |
28 class GrDrawState : public SkRefCnt { | 28 class GrDrawState { |
29 public: | 29 public: |
30 SK_DECLARE_INST_COUNT(GrDrawState) | |
31 | |
32 GrDrawState() { | 30 GrDrawState() { |
33 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) | 31 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) |
34 this->reset(); | 32 this->reset(); |
35 } | 33 } |
36 | 34 |
37 GrDrawState(const SkMatrix& initialViewMatrix) { | 35 GrDrawState(const SkMatrix& initialViewMatrix) { |
38 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) | 36 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) |
39 this->reset(initialViewMatrix); | 37 this->reset(initialViewMatrix); |
40 } | 38 } |
41 | 39 |
42 /** | 40 /** |
43 * Copies another draw state. | 41 * Copies another draw state. |
44 **/ | 42 **/ |
45 GrDrawState(const GrDrawState& state) : INHERITED() { | 43 GrDrawState(const GrDrawState& state) { |
46 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) | 44 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) |
47 *this = state; | 45 *this = state; |
48 } | 46 } |
49 | 47 |
50 /** | 48 /** |
51 * Copies another draw state with a preconcat to the view matrix. | 49 * Copies another draw state with a preconcat to the view matrix. |
52 **/ | 50 **/ |
53 GrDrawState(const GrDrawState& state, const SkMatrix& preConcatMatrix); | 51 GrDrawState(const GrDrawState& state, const SkMatrix& preConcatMatrix); |
54 | 52 |
55 virtual ~GrDrawState(); | 53 virtual ~GrDrawState(); |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 // This is simply a different representation of info in fVertexAttribs and t
hus does | 863 // This is simply a different representation of info in fVertexAttribs and t
hus does |
866 // not need to be compared in op==. | 864 // not need to be compared in op==. |
867 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; | 865 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt
]; |
868 | 866 |
869 mutable GrProcOptInfo fColorProcInfo; | 867 mutable GrProcOptInfo fColorProcInfo; |
870 mutable GrProcOptInfo fCoverageProcInfo; | 868 mutable GrProcOptInfo fCoverageProcInfo; |
871 mutable bool fColorProcInfoValid; | 869 mutable bool fColorProcInfoValid; |
872 mutable bool fCoverageProcInfoValid; | 870 mutable bool fCoverageProcInfoValid; |
873 | 871 |
874 friend class GrOptDrawState; | 872 friend class GrOptDrawState; |
875 | |
876 typedef SkRefCnt INHERITED; | |
877 }; | 873 }; |
878 | 874 |
879 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 875 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
880 | 876 |
881 #endif | 877 #endif |
OLD | NEW |