| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 typedef GrGLMorphologyEffect GLProcessor; | 309 typedef GrGLMorphologyEffect GLProcessor; |
| 310 | 310 |
| 311 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; | 311 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; |
| 312 | 312 |
| 313 protected: | 313 protected: |
| 314 | 314 |
| 315 MorphologyType fType; | 315 MorphologyType fType; |
| 316 | 316 |
| 317 private: | 317 private: |
| 318 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; | 318 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; |
| 319 | 319 |
| 320 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; | 320 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; |
| 321 | 321 |
| 322 GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType); | 322 GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType); |
| 323 | 323 |
| 324 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 324 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 325 | 325 |
| 326 typedef Gr1DKernelEffect INHERITED; | 326 typedef Gr1DKernelEffect INHERITED; |
| 327 }; | 327 }; |
| 328 | 328 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 , fType(type) { | 441 , fType(type) { |
| 442 } | 442 } |
| 443 | 443 |
| 444 GrMorphologyEffect::~GrMorphologyEffect() { | 444 GrMorphologyEffect::~GrMorphologyEffect() { |
| 445 } | 445 } |
| 446 | 446 |
| 447 const GrBackendFragmentProcessorFactory& GrMorphologyEffect::getFactory() const
{ | 447 const GrBackendFragmentProcessorFactory& GrMorphologyEffect::getFactory() const
{ |
| 448 return GrTBackendFragmentProcessorFactory<GrMorphologyEffect>::getInstance()
; | 448 return GrTBackendFragmentProcessorFactory<GrMorphologyEffect>::getInstance()
; |
| 449 } | 449 } |
| 450 | 450 |
| 451 bool GrMorphologyEffect::onIsEqual(const GrProcessor& sBase) const { | 451 bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
| 452 const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>(); | 452 const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>(); |
| 453 return (this->texture(0) == s.texture(0) && | 453 return (this->texture(0) == s.texture(0) && |
| 454 this->radius() == s.radius() && | 454 this->radius() == s.radius() && |
| 455 this->direction() == s.direction() && | 455 this->direction() == s.direction() && |
| 456 this->type() == s.type()); | 456 this->type() == s.type()); |
| 457 } | 457 } |
| 458 | 458 |
| 459 void GrMorphologyEffect::onComputeInvariantOutput(InvariantOutput* inout) const
{ | 459 void GrMorphologyEffect::onComputeInvariantOutput(InvariantOutput* inout) const
{ |
| 460 // This is valid because the color components of the result of the kernel al
l come | 460 // This is valid because the color components of the result of the kernel al
l come |
| 461 // exactly from existing values in the source texture. | 461 // exactly from existing values in the source texture. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 SkBitmap* result, SkIPoint* offset) con
st { | 601 SkBitmap* result, SkIPoint* offset) con
st { |
| 602 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 602 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
| 603 } | 603 } |
| 604 | 604 |
| 605 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 605 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 606 SkBitmap* result, SkIPoint* offset) cons
t { | 606 SkBitmap* result, SkIPoint* offset) cons
t { |
| 607 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 607 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
| 608 } | 608 } |
| 609 | 609 |
| 610 #endif | 610 #endif |
| OLD | NEW |