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 "GrConvolutionEffect.h" | 8 #include "GrConvolutionEffect.h" |
9 #include "gl/GrGLFragmentProcessor.h" | 9 #include "gl/GrGLFragmentProcessor.h" |
10 #include "gl/GrGLTexture.h" | 10 #include "gl/GrGLTexture.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 GrConvolutionEffect::~GrConvolutionEffect() { | 195 GrConvolutionEffect::~GrConvolutionEffect() { |
196 } | 196 } |
197 | 197 |
198 void GrConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, | 198 void GrConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, |
199 GrProcessorKeyBuilder* b) const { | 199 GrProcessorKeyBuilder* b) const { |
200 GrGLConvolutionEffect::GenKey(*this, caps, b); | 200 GrGLConvolutionEffect::GenKey(*this, caps, b); |
201 } | 201 } |
202 | 202 |
203 GrGLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const { | 203 GrGLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const { |
204 return SkNEW_ARGS(GrGLConvolutionEffect, (*this)); | 204 return new GrGLConvolutionEffect(*this); |
205 } | 205 } |
206 | 206 |
207 bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 207 bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
208 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>(); | 208 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>(); |
209 return (this->radius() == s.radius() && | 209 return (this->radius() == s.radius() && |
210 this->direction() == s.direction() && | 210 this->direction() == s.direction() && |
211 this->useBounds() == s.useBounds() && | 211 this->useBounds() == s.useBounds() && |
212 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && | 212 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && |
213 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); | 213 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); |
214 } | 214 } |
(...skipping 18 matching lines...) Expand all Loading... |
233 | 233 |
234 bool useBounds = d->fRandom->nextBool(); | 234 bool useBounds = d->fRandom->nextBool(); |
235 return GrConvolutionEffect::Create(d->fProcDataManager, | 235 return GrConvolutionEffect::Create(d->fProcDataManager, |
236 d->fTextures[texIdx], | 236 d->fTextures[texIdx], |
237 dir, | 237 dir, |
238 radius, | 238 radius, |
239 kernel, | 239 kernel, |
240 useBounds, | 240 useBounds, |
241 bounds); | 241 bounds); |
242 } | 242 } |
OLD | NEW |