| 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 : fUni(GrGLUniformManager::kInvalidUniformHandle) | 62 : fCoordsType(coordsType) { |
| 63 , fCoordsType(coordsType) { | |
| 64 GrAssert(GrEffect::kLocal_CoordsType == coordsType || | 63 GrAssert(GrEffect::kLocal_CoordsType == coordsType || |
| 65 GrEffect::kPosition_CoordsType == coordsType); | 64 GrEffect::kPosition_CoordsType == coordsType); |
| 66 fPrevMatrix = SkMatrix::InvalidMatrix(); | 65 fPrevMatrix = SkMatrix::InvalidMatrix(); |
| 67 } | 66 } |
| 68 | 67 |
| 69 /** | 68 /** |
| 70 * Generates the key for the portion of the code emitted by this class's emi
tCode() function. | 69 * Generates the key for the portion of the code emitted by this class's emi
tCode() function. |
| 71 * Pass a texture to make GrGLEffectMatrix automatically adjust for the text
ure's origin. Pass | 70 * Pass a texture to make GrGLEffectMatrix automatically adjust for the text
ure's origin. Pass |
| 72 * NULL when not using the EffectMatrix for a texture lookup, or if the GrGL
Effect subclass | 71 * NULL when not using the EffectMatrix for a texture lookup, or if the GrGL
Effect subclass |
| 73 * wants to handle origin adjustments in some other manner. The coords type
param must match the | 72 * wants to handle origin adjustments in some other manner. The coords type
param must match the |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const GrDrawEffect& drawEffect, | 111 const GrDrawEffect& drawEffect, |
| 113 const GrTexture*); | 112 const GrTexture*); |
| 114 | 113 |
| 115 GrGLUniformManager::UniformHandle fUni; | 114 GrGLUniformManager::UniformHandle fUni; |
| 116 GrSLType fUniType; | 115 GrSLType fUniType; |
| 117 SkMatrix fPrevMatrix; | 116 SkMatrix fPrevMatrix; |
| 118 CoordsType fCoordsType; | 117 CoordsType fCoordsType; |
| 119 }; | 118 }; |
| 120 | 119 |
| 121 #endif | 120 #endif |
| OLD | NEW |