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 #include "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
9 #include "GrConvolutionEffect.h" | 9 #include "GrConvolutionEffect.h" |
10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 memcpy(fBounds, bounds, sizeof(fBounds)); | 193 memcpy(fBounds, bounds, sizeof(fBounds)); |
194 } | 194 } |
195 | 195 |
196 GrConvolutionEffect::~GrConvolutionEffect() { | 196 GrConvolutionEffect::~GrConvolutionEffect() { |
197 } | 197 } |
198 | 198 |
199 const GrBackendFragmentProcessorFactory& GrConvolutionEffect::getFactory() const
{ | 199 const GrBackendFragmentProcessorFactory& GrConvolutionEffect::getFactory() const
{ |
200 return GrTBackendFragmentProcessorFactory<GrConvolutionEffect>::getInstance(
); | 200 return GrTBackendFragmentProcessorFactory<GrConvolutionEffect>::getInstance(
); |
201 } | 201 } |
202 | 202 |
203 bool GrConvolutionEffect::onIsEqual(const GrProcessor& sBase) const { | 203 bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
204 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>(); | 204 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>(); |
205 return (this->texture(0) == s.texture(0) && | 205 return (this->texture(0) == s.texture(0) && |
206 this->radius() == s.radius() && | 206 this->radius() == s.radius() && |
207 this->direction() == s.direction() && | 207 this->direction() == s.direction() && |
208 this->useBounds() == s.useBounds() && | 208 this->useBounds() == s.useBounds() && |
209 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && | 209 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && |
210 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); | 210 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); |
211 } | 211 } |
212 | 212 |
213 /////////////////////////////////////////////////////////////////////////////// | 213 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 18 matching lines...) Expand all Loading... |
232 } | 232 } |
233 | 233 |
234 bool useBounds = random->nextBool(); | 234 bool useBounds = random->nextBool(); |
235 return GrConvolutionEffect::Create(textures[texIdx], | 235 return GrConvolutionEffect::Create(textures[texIdx], |
236 dir, | 236 dir, |
237 radius, | 237 radius, |
238 kernel, | 238 kernel, |
239 useBounds, | 239 useBounds, |
240 bounds); | 240 bounds); |
241 } | 241 } |
OLD | NEW |