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 GrTextureDomainEffect_DEFINED | 8 #ifndef GrTextureDomainEffect_DEFINED |
9 #define GrTextureDomainEffect_DEFINED | 9 #define GrTextureDomainEffect_DEFINED |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const GrTextureDomain& textureDomain, | 97 const GrTextureDomain& textureDomain, |
98 const char* outColor, | 98 const char* outColor, |
99 const SkString& inCoords, | 99 const SkString& inCoords, |
100 const GrGLEffect::TextureSampler sampler, | 100 const GrGLEffect::TextureSampler sampler, |
101 const char* inModulateColor = NULL); | 101 const char* inModulateColor = NULL); |
102 | 102 |
103 /** | 103 /** |
104 * Call this from GrGLEffect::setData() to upload uniforms necessary for
the texture domain. | 104 * Call this from GrGLEffect::setData() to upload uniforms necessary for
the texture domain. |
105 * The rectangle is automatically adjusted to account for the texture's
origin. | 105 * The rectangle is automatically adjusted to account for the texture's
origin. |
106 */ | 106 */ |
107 void setData(const GrGLUniformManager& uman, const GrTextureDomain& text
ureDomain, | 107 void setData(const GrGLProgramDataManager& pdman, const GrTextureDomain&
textureDomain, |
108 GrSurfaceOrigin textureOrigin); | 108 GrSurfaceOrigin textureOrigin); |
109 | 109 |
110 enum { | 110 enum { |
111 kDomainKeyBits = 2, // See DomainKey(). | 111 kDomainKeyBits = 2, // See DomainKey(). |
112 }; | 112 }; |
113 | 113 |
114 /** | 114 /** |
115 * GrGLEffect::GenKey() must call this and include the returned value in
it's computed key. | 115 * GrGLEffect::GenKey() must call this and include the returned value in
it's computed key. |
116 * The returned will be limited to the lower kDomainKeyBits bits. | 116 * The returned will be limited to the lower kDomainKeyBits bits. |
117 */ | 117 */ |
118 static uint32_t DomainKey(const GrTextureDomain& domain) { | 118 static uint32_t DomainKey(const GrTextureDomain& domain) { |
119 GR_STATIC_ASSERT(kModeCount <= 4); | 119 GR_STATIC_ASSERT(kModeCount <= 4); |
120 return domain.mode(); | 120 return domain.mode(); |
121 } | 121 } |
122 | 122 |
123 private: | 123 private: |
124 SkDEBUGCODE(Mode fMode;) | 124 SkDEBUGCODE(Mode fMode;) |
125 GrGLUniformManager::UniformHandle fDomainUni; | 125 GrGLProgramDataManager::UniformHandle fDomainUni; |
126 SkString fDomainName; | 126 SkString fDomainName; |
127 GrGLfloat fPrevDomain[4]; | 127 GrGLfloat fPrevDomain[4]; |
128 }; | 128 }; |
129 | 129 |
130 protected: | 130 protected: |
131 Mode fMode; | 131 Mode fMode; |
132 SkRect fDomain; | 132 SkRect fDomain; |
133 int fIndex; | 133 int fIndex; |
134 | 134 |
135 typedef GrSingleTextureEffect INHERITED; | 135 typedef GrSingleTextureEffect INHERITED; |
136 }; | 136 }; |
137 | 137 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 GrCoordSet); | 173 GrCoordSet); |
174 | 174 |
175 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; | 175 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; |
176 | 176 |
177 GR_DECLARE_EFFECT_TEST; | 177 GR_DECLARE_EFFECT_TEST; |
178 | 178 |
179 typedef GrSingleTextureEffect INHERITED; | 179 typedef GrSingleTextureEffect INHERITED; |
180 }; | 180 }; |
181 | 181 |
182 #endif | 182 #endif |
OLD | NEW |