| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 GrFragmentProcessor& 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->radius() == s.radius() && |
| 206 this->radius() == s.radius() && | |
| 207 this->direction() == s.direction() && | 206 this->direction() == s.direction() && |
| 208 this->useBounds() == s.useBounds() && | 207 this->useBounds() == s.useBounds() && |
| 209 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && | 208 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && |
| 210 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); | 209 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); |
| 211 } | 210 } |
| 212 | 211 |
| 213 /////////////////////////////////////////////////////////////////////////////// | 212 /////////////////////////////////////////////////////////////////////////////// |
| 214 | 213 |
| 215 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvolutionEffect); | 214 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvolutionEffect); |
| 216 | 215 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 232 } | 231 } |
| 233 | 232 |
| 234 bool useBounds = random->nextBool(); | 233 bool useBounds = random->nextBool(); |
| 235 return GrConvolutionEffect::Create(textures[texIdx], | 234 return GrConvolutionEffect::Create(textures[texIdx], |
| 236 dir, | 235 dir, |
| 237 radius, | 236 radius, |
| 238 kernel, | 237 kernel, |
| 239 useBounds, | 238 useBounds, |
| 240 bounds); | 239 bounds); |
| 241 } | 240 } |
| OLD | NEW |