OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
11 #ifndef GrEffectStage_DEFINED | 11 #ifndef GrEffectStage_DEFINED |
12 #define GrEffectStage_DEFINED | 12 #define GrEffectStage_DEFINED |
13 | 13 |
14 #include "GrBackendEffectFactory.h" | 14 #include "GrBackendEffectFactory.h" |
15 #include "GrEffect.h" | 15 #include "GrEffect.h" |
16 #include "SkMatrix.h" | 16 #include "SkMatrix.h" |
17 #include "GrTypes.h" | 17 #include "GrTypes.h" |
18 | 18 |
19 #include "SkShader.h" | 19 #include "SkShader.h" |
20 | 20 |
21 class GrEffectStage { | 21 class GrEffectStage : public SkRefCnt { |
22 public: | 22 public: |
| 23 SK_DECLARE_INST_COUNT(GrEffectStage); |
| 24 |
23 explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attr
Index1 = -1) | 25 explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attr
Index1 = -1) |
24 : fEffect(SkRef(effect)) { | 26 : fEffect(SkRef(effect)) { |
25 fCoordChangeMatrixSet = false; | 27 fCoordChangeMatrixSet = false; |
26 fVertexAttribIndices[0] = attrIndex0; | 28 fVertexAttribIndices[0] = attrIndex0; |
27 fVertexAttribIndices[1] = attrIndex1; | 29 fVertexAttribIndices[1] = attrIndex1; |
28 } | 30 } |
29 | 31 |
30 GrEffectStage(const GrEffectStage& other) { | 32 GrEffectStage(const GrEffectStage& other) { |
31 *this = other; | 33 *this = other; |
32 } | 34 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 const GrEffect* getEffect() const { return fEffect.get(); } | 136 const GrEffect* getEffect() const { return fEffect.get(); } |
135 | 137 |
136 const int* getVertexAttribIndices() const { return fVertexAttribIndices; } | 138 const int* getVertexAttribIndices() const { return fVertexAttribIndices; } |
137 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs();
} | 139 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs();
} |
138 | 140 |
139 private: | 141 private: |
140 bool fCoordChangeMatrixSet; | 142 bool fCoordChangeMatrixSet; |
141 SkMatrix fCoordChangeMatrix; | 143 SkMatrix fCoordChangeMatrix; |
142 SkAutoTUnref<const GrEffect> fEffect; | 144 SkAutoTUnref<const GrEffect> fEffect; |
143 int fVertexAttribIndices[2]; | 145 int fVertexAttribIndices[2]; |
| 146 |
| 147 typedef SkRefCnt INHERITED; |
144 }; | 148 }; |
145 | 149 |
146 #endif | 150 #endif |
OLD | NEW |