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 |
(...skipping 25 matching lines...) Expand all Loading... |
36 if (other.fCoordChangeMatrixSet) { | 36 if (other.fCoordChangeMatrixSet) { |
37 fCoordChangeMatrix = other.fCoordChangeMatrix; | 37 fCoordChangeMatrix = other.fCoordChangeMatrix; |
38 } | 38 } |
39 fEffect.reset(SkRef(other.fEffect.get())); | 39 fEffect.reset(SkRef(other.fEffect.get())); |
40 memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexA
ttribIndices)); | 40 memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexA
ttribIndices)); |
41 return *this; | 41 return *this; |
42 } | 42 } |
43 | 43 |
44 static bool AreCompatible(const GrEffectStage& a, const GrEffectStage& b, | 44 static bool AreCompatible(const GrEffectStage& a, const GrEffectStage& b, |
45 bool usingExplicitLocalCoords) { | 45 bool usingExplicitLocalCoords) { |
46 SkASSERT(NULL != a.fEffect.get()); | 46 SkASSERT(a.fEffect.get()); |
47 SkASSERT(NULL != b.fEffect.get()); | 47 SkASSERT(b.fEffect.get()); |
48 | 48 |
49 if (!a.getEffect()->isEqual(*b.getEffect())) { | 49 if (!a.getEffect()->isEqual(*b.getEffect())) { |
50 return false; | 50 return false; |
51 } | 51 } |
52 | 52 |
53 // We always track the coord change matrix, but it has no effect when ex
plicit local coords | 53 // We always track the coord change matrix, but it has no effect when ex
plicit local coords |
54 // are used. | 54 // are used. |
55 if (usingExplicitLocalCoords) { | 55 if (usingExplicitLocalCoords) { |
56 return true; | 56 return true; |
57 } | 57 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs();
} | 137 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs();
} |
138 | 138 |
139 private: | 139 private: |
140 bool fCoordChangeMatrixSet; | 140 bool fCoordChangeMatrixSet; |
141 SkMatrix fCoordChangeMatrix; | 141 SkMatrix fCoordChangeMatrix; |
142 SkAutoTUnref<const GrEffect> fEffect; | 142 SkAutoTUnref<const GrEffect> fEffect; |
143 int fVertexAttribIndices[2]; | 143 int fVertexAttribIndices[2]; |
144 }; | 144 }; |
145 | 145 |
146 #endif | 146 #endif |
OLD | NEW |