| 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 GrBackendEffectFactory_DEFINED | 8 #ifndef GrBackendEffectFactory_DEFINED |
| 9 #define GrBackendEffectFactory_DEFINED | 9 #define GrBackendEffectFactory_DEFINED |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 typedef uint32_t EffectKey; | 33 typedef uint32_t EffectKey; |
| 34 enum { | 34 enum { |
| 35 kNoEffectKey = 0, | 35 kNoEffectKey = 0, |
| 36 kEffectKeyBits = 12, | 36 kEffectKeyBits = 12, |
| 37 /** | 37 /** |
| 38 * Some aspects of the generated code may be determined by the particula
r textures that are | 38 * Some aspects of the generated code may be determined by the particula
r textures that are |
| 39 * associated with the effect. These manipulations are performed by GrGL
ShaderBuilder beyond | 39 * associated with the effect. These manipulations are performed by GrGL
ShaderBuilder beyond |
| 40 * GrGLEffects' control. So there is a dedicated part of the key which i
s combined | 40 * GrGLEffects' control. So there is a dedicated part of the key which i
s combined |
| 41 * automatically with the bits produced by GrGLEffect::GenKey(). | 41 * automatically with the bits produced by GrGLEffect::GenKey(). |
| 42 */ | 42 */ |
| 43 kTextureKeyBits = 6 | 43 kTextureKeyBits = 6, |
| 44 kAttribKeyBits = 4 |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 virtual EffectKey glEffectKey(const GrEffectStage&, const GrGLCaps&) const =
0; | 47 virtual EffectKey glEffectKey(const GrEffectStage&, const GrGLCaps&) const =
0; |
| 47 virtual GrGLEffect* createGLInstance(const GrEffectRef&) const = 0; | 48 virtual GrGLEffect* createGLInstance(const GrEffectRef&) const = 0; |
| 48 | 49 |
| 49 bool operator ==(const GrBackendEffectFactory& b) const { | 50 bool operator ==(const GrBackendEffectFactory& b) const { |
| 50 return fEffectClassID == b.fEffectClassID; | 51 return fEffectClassID == b.fEffectClassID; |
| 51 } | 52 } |
| 52 bool operator !=(const GrBackendEffectFactory& b) const { | 53 bool operator !=(const GrBackendEffectFactory& b) const { |
| 53 return !(*this == b); | 54 return !(*this == b); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 77 return static_cast<EffectKey>(id); | 78 return static_cast<EffectKey>(id); |
| 78 } | 79 } |
| 79 | 80 |
| 80 EffectKey fEffectClassID; | 81 EffectKey fEffectClassID; |
| 81 | 82 |
| 82 private: | 83 private: |
| 83 static int32_t fCurrEffectClassID; | 84 static int32_t fCurrEffectClassID; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 #endif | 87 #endif |
| OLD | NEW |