OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #include "GrGLSL.h" | 8 #include "GrGLSL.h" |
9 #include "GrGLEffect.h" | 9 #include "GrGLEffect.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 return key; | 32 return key; |
33 } | 33 } |
34 | 34 |
35 GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrEffectStage& stage) { | 35 GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrEffectStage& stage) { |
36 EffectKey key = 0; | 36 EffectKey key = 0; |
37 | 37 |
38 int numAttributes = stage.getVertexAttribIndexCount(); | 38 int numAttributes = stage.getVertexAttribIndexCount(); |
39 GrAssert(numAttributes <= 2); | 39 GrAssert(numAttributes <= 2); |
40 const int* attributeIndices = stage.getVertexAttribIndices(); | 40 const int* attributeIndices = stage.getVertexAttribIndices(); |
41 for (int index = 0; index < numAttributes; ++index) { | 41 for (int index = 0; index < numAttributes; ++index) { |
42 EffectKey value = attributeIndices[index] << 2*index; | 42 EffectKey value = attributeIndices[index] << 3*index; |
43 GrAssert(0 == (value & key)); // keys for each attribute ought not to ov
erlap | 43 GrAssert(0 == (value & key)); // keys for each attribute ought not to ov
erlap |
44 key |= value; | 44 key |= value; |
45 } | 45 } |
46 | 46 |
47 return key; | 47 return key; |
48 } | 48 } |
OLD | NEW |