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 #ifndef GrGLEffectMatrix_DEFINED | 8 #ifndef GrGLEffectMatrix_DEFINED |
9 #define GrGLEffectMatrix_DEFINED | 9 #define GrGLEffectMatrix_DEFINED |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 * The matrix uses kKeyBits of the effect's EffectKey. A GrGLEffect may plac
e these bits at an | 52 * The matrix uses kKeyBits of the effect's EffectKey. A GrGLEffect may plac
e these bits at an |
53 * arbitrary shift in its final key. However, when GrGLEffectMatrix::emitCod
e*() code is called | 53 * arbitrary shift in its final key. However, when GrGLEffectMatrix::emitCod
e*() code is called |
54 * the relevant bits must be in the lower kKeyBits of the key parameter. | 54 * the relevant bits must be in the lower kKeyBits of the key parameter. |
55 */ | 55 */ |
56 enum { | 56 enum { |
57 kKeyBits = kKeyBitsPrivate, | 57 kKeyBits = kKeyBitsPrivate, |
58 kKeyMask = (1 << kKeyBits) - 1, | 58 kKeyMask = (1 << kKeyBits) - 1, |
59 }; | 59 }; |
60 | 60 |
61 GrGLEffectMatrix(CoordsType coordsType) | 61 GrGLEffectMatrix(CoordsType coordsType) |
62 : fCoordsType(coordsType) { | 62 : fCoordsType(coordsType) |
| 63 , fTexGenUnit(-1) |
| 64 , fNumTexGenComponents(0) { |
63 SkASSERT(GrEffect::kLocal_CoordsType == coordsType || | 65 SkASSERT(GrEffect::kLocal_CoordsType == coordsType || |
64 GrEffect::kPosition_CoordsType == coordsType); | 66 GrEffect::kPosition_CoordsType == coordsType); |
65 fPrevMatrix = SkMatrix::InvalidMatrix(); | 67 fPrevMatrix = SkMatrix::InvalidMatrix(); |
66 } | 68 } |
67 | 69 |
68 /** | 70 /** |
69 * Generates the key for the portion of the code emitted by this class's emi
tCode() function. | 71 * Generates the key for the portion of the code emitted by this class's emi
tCode() function. |
70 * Pass a texture to make GrGLEffectMatrix automatically adjust for the text
ure's origin. Pass | 72 * Pass a texture to make GrGLEffectMatrix automatically adjust for the text
ure's origin. Pass |
71 * NULL when not using the EffectMatrix for a texture lookup, or if the GrGL
Effect subclass | 73 * NULL when not using the EffectMatrix for a texture lookup, or if the GrGL
Effect subclass |
72 * wants to handle origin adjustments in some other manner. The coords type
param must match the | 74 * wants to handle origin adjustments in some other manner. The coords type
param must match the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 */ | 110 */ |
109 void setData(const GrGLUniformManager& uniformManager, | 111 void setData(const GrGLUniformManager& uniformManager, |
110 const SkMatrix& effectMatrix, | 112 const SkMatrix& effectMatrix, |
111 const GrDrawEffect& drawEffect, | 113 const GrDrawEffect& drawEffect, |
112 const GrTexture*); | 114 const GrTexture*); |
113 | 115 |
114 GrGLUniformManager::UniformHandle fUni; | 116 GrGLUniformManager::UniformHandle fUni; |
115 GrSLType fUniType; | 117 GrSLType fUniType; |
116 SkMatrix fPrevMatrix; | 118 SkMatrix fPrevMatrix; |
117 CoordsType fCoordsType; | 119 CoordsType fCoordsType; |
| 120 int fTexGenUnit; |
| 121 int fNumTexGenComponents; |
118 }; | 122 }; |
119 | 123 |
120 #endif | 124 #endif |
OLD | NEW |