OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkMorphologyImageFilter.h" | 8 #include "SkMorphologyImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 const char* name() const override { return "Morphology"; } | 230 const char* name() const override { return "Morphology"; } |
231 | 231 |
232 protected: | 232 protected: |
233 | 233 |
234 MorphologyType fType; | 234 MorphologyType fType; |
235 bool fUseRange; | 235 bool fUseRange; |
236 float fRange[2]; | 236 float fRange[2]; |
237 | 237 |
238 private: | 238 private: |
239 GrGLSLFragmentProcessor* onCreateGLInstance() const override; | 239 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
240 | 240 |
241 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov
erride; | 241 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const
override; |
242 | 242 |
243 bool onIsEqual(const GrFragmentProcessor&) const override; | 243 bool onIsEqual(const GrFragmentProcessor&) const override; |
244 | 244 |
245 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 245 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
246 | 246 |
247 GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType); | 247 GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType); |
248 GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType, | 248 GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType, |
249 float bounds[2]); | 249 float bounds[2]); |
250 | 250 |
251 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 251 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 : INHERITED(texture, direction, radius) | 416 : INHERITED(texture, direction, radius) |
417 , fType(type), fUseRange(true) { | 417 , fType(type), fUseRange(true) { |
418 this->initClassID<GrMorphologyEffect>(); | 418 this->initClassID<GrMorphologyEffect>(); |
419 fRange[0] = range[0]; | 419 fRange[0] = range[0]; |
420 fRange[1] = range[1]; | 420 fRange[1] = range[1]; |
421 } | 421 } |
422 | 422 |
423 GrMorphologyEffect::~GrMorphologyEffect() { | 423 GrMorphologyEffect::~GrMorphologyEffect() { |
424 } | 424 } |
425 | 425 |
426 void GrMorphologyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessor
KeyBuilder* b) const { | 426 void GrMorphologyEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
| 427 GrProcessorKeyBuilder* b) const { |
427 GrGLMorphologyEffect::GenKey(*this, caps, b); | 428 GrGLMorphologyEffect::GenKey(*this, caps, b); |
428 } | 429 } |
429 | 430 |
430 GrGLSLFragmentProcessor* GrMorphologyEffect::onCreateGLInstance() const { | 431 GrGLSLFragmentProcessor* GrMorphologyEffect::onCreateGLSLInstance() const { |
431 return new GrGLMorphologyEffect(*this); | 432 return new GrGLMorphologyEffect(*this); |
432 } | 433 } |
433 bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 434 bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
434 const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>(); | 435 const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>(); |
435 return (this->radius() == s.radius() && | 436 return (this->radius() == s.radius() && |
436 this->direction() == s.direction() && | 437 this->direction() == s.direction() && |
437 this->useRange() == s.useRange() && | 438 this->useRange() == s.useRange() && |
438 this->type() == s.type()); | 439 this->type() == s.type()); |
439 } | 440 } |
440 | 441 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 SkBitmap* result, SkIPoint* offset) con
st { | 671 SkBitmap* result, SkIPoint* offset) con
st { |
671 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 672 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
672 } | 673 } |
673 | 674 |
674 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 675 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
675 SkBitmap* result, SkIPoint* offset) cons
t { | 676 SkBitmap* result, SkIPoint* offset) cons
t { |
676 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 677 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
677 } | 678 } |
678 | 679 |
679 #endif | 680 #endif |
OLD | NEW |