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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 const GrTextureDomain& textureDomain, | 90 const GrTextureDomain& textureDomain, |
91 const char* outColor, | 91 const char* outColor, |
92 const SkString& inCoords, | 92 const SkString& inCoords, |
93 const GrGLEffect::TextureSampler sampler, | 93 const GrGLEffect::TextureSampler sampler, |
94 const char* inModulateColor = NULL); | 94 const char* inModulateColor = NULL); |
95 | 95 |
96 /** | 96 /** |
97 * Call this from GrGLEffect::setData() to upload uniforms necessary for the texture domain. | 97 * Call this from GrGLEffect::setData() to upload uniforms necessary for the texture domain. |
98 * The rectangle is automatically adjusted to account for the texture's origin. | 98 * The rectangle is automatically adjusted to account for the texture's origin. |
99 */ | 99 */ |
100 void setData(const GrGLUniformManager& uman, const GrTextureDomain& text ureDomain, | 100 void setData(const GrGLProgramResourceManager& prman, const GrTextureDom ain& textureDomain, |
101 GrSurfaceOrigin textureOrigin); | 101 GrSurfaceOrigin textureOrigin); |
102 | 102 |
103 enum { | 103 enum { |
104 kDomainKeyBits = 2, // See DomainKey(). | 104 kDomainKeyBits = 2, // See DomainKey(). |
105 }; | 105 }; |
106 | 106 |
107 /** | 107 /** |
108 * GrGLEffect::GenKey() must call this and include the returned value in it's computed key. | 108 * GrGLEffect::GenKey() must call this and include the returned value in it's computed key. |
109 * The returned will be limited to the lower kDomainKeyBits bits. | 109 * The returned will be limited to the lower kDomainKeyBits bits. |
110 */ | 110 */ |
111 static uint32_t DomainKey(const GrTextureDomain& domain) { | 111 static uint32_t DomainKey(const GrTextureDomain& domain) { |
112 GR_STATIC_ASSERT(kModeCount <= 4); | 112 GR_STATIC_ASSERT(kModeCount <= 4); |
113 return domain.mode(); | 113 return domain.mode(); |
114 } | 114 } |
115 | 115 |
116 private: | 116 private: |
117 SkDEBUGCODE(Mode fMode;) | 117 SkDEBUGCODE(Mode fMode;) |
118 GrGLUniformManager::UniformHandle fDomainUni; | 118 GrGLProgramResourceManager::UniformHandle fDomainUni; |
bsalomon
2014/07/29 13:08:18
align
| |
119 SkString fDomainName; | 119 SkString fDomainName; |
120 GrGLfloat fPrevDomain[4]; | 120 GrGLfloat fPrevDomain[4]; |
121 }; | 121 }; |
122 | 122 |
123 protected: | 123 protected: |
124 Mode fMode; | 124 Mode fMode; |
125 SkRect fDomain; | 125 SkRect fDomain; |
126 int fIndex; | 126 int fIndex; |
127 | 127 |
128 typedef GrSingleTextureEffect INHERITED; | 128 typedef GrSingleTextureEffect INHERITED; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 GrCoordSet); | 166 GrCoordSet); |
167 | 167 |
168 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; | 168 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; |
169 | 169 |
170 GR_DECLARE_EFFECT_TEST; | 170 GR_DECLARE_EFFECT_TEST; |
171 | 171 |
172 typedef GrSingleTextureEffect INHERITED; | 172 typedef GrSingleTextureEffect INHERITED; |
173 }; | 173 }; |
174 | 174 |
175 #endif | 175 #endif |
OLD | NEW |