| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 virtual ~GrMorphologyEffect(); | 313 virtual ~GrMorphologyEffect(); |
| 314 | 314 |
| 315 MorphologyType type() const { return fType; } | 315 MorphologyType type() const { return fType; } |
| 316 bool useRange() const { return fUseRange; } | 316 bool useRange() const { return fUseRange; } |
| 317 const float* range() const { return fRange; } | 317 const float* range() const { return fRange; } |
| 318 | 318 |
| 319 const char* name() const override { return "Morphology"; } | 319 const char* name() const override { return "Morphology"; } |
| 320 | 320 |
| 321 void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const over
ride; | |
| 322 | |
| 323 GrGLFragmentProcessor* createGLInstance() const override; | 321 GrGLFragmentProcessor* createGLInstance() const override; |
| 324 | 322 |
| 325 protected: | 323 protected: |
| 326 | 324 |
| 327 MorphologyType fType; | 325 MorphologyType fType; |
| 328 bool fUseRange; | 326 bool fUseRange; |
| 329 float fRange[2]; | 327 float fRange[2]; |
| 330 | 328 |
| 331 private: | 329 private: |
| 330 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov
erride; |
| 331 |
| 332 bool onIsEqual(const GrFragmentProcessor&) const override; | 332 bool onIsEqual(const GrFragmentProcessor&) const override; |
| 333 | 333 |
| 334 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 334 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
| 335 | 335 |
| 336 GrMorphologyEffect(GrProcessorDataManager*, GrTexture*, Direction, int radiu
s, MorphologyType); | 336 GrMorphologyEffect(GrProcessorDataManager*, GrTexture*, Direction, int radiu
s, MorphologyType); |
| 337 GrMorphologyEffect(GrProcessorDataManager*, GrTexture*, Direction, int radiu
s, MorphologyType, | 337 GrMorphologyEffect(GrProcessorDataManager*, GrTexture*, Direction, int radiu
s, MorphologyType, |
| 338 float bounds[2]); | 338 float bounds[2]); |
| 339 | 339 |
| 340 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 340 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 341 | 341 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 : INHERITED(procDataManager, texture, direction, radius) | 506 : INHERITED(procDataManager, texture, direction, radius) |
| 507 , fType(type), fUseRange(true) { | 507 , fType(type), fUseRange(true) { |
| 508 this->initClassID<GrMorphologyEffect>(); | 508 this->initClassID<GrMorphologyEffect>(); |
| 509 fRange[0] = range[0]; | 509 fRange[0] = range[0]; |
| 510 fRange[1] = range[1]; | 510 fRange[1] = range[1]; |
| 511 } | 511 } |
| 512 | 512 |
| 513 GrMorphologyEffect::~GrMorphologyEffect() { | 513 GrMorphologyEffect::~GrMorphologyEffect() { |
| 514 } | 514 } |
| 515 | 515 |
| 516 void GrMorphologyEffect::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b) const { | 516 void GrMorphologyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessor
KeyBuilder* b) const { |
| 517 GrGLMorphologyEffect::GenKey(*this, caps, b); | 517 GrGLMorphologyEffect::GenKey(*this, caps, b); |
| 518 } | 518 } |
| 519 | 519 |
| 520 GrGLFragmentProcessor* GrMorphologyEffect::createGLInstance() const { | 520 GrGLFragmentProcessor* GrMorphologyEffect::createGLInstance() const { |
| 521 return SkNEW_ARGS(GrGLMorphologyEffect, (*this)); | 521 return SkNEW_ARGS(GrGLMorphologyEffect, (*this)); |
| 522 } | 522 } |
| 523 bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 523 bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
| 524 const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>(); | 524 const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>(); |
| 525 return (this->radius() == s.radius() && | 525 return (this->radius() == s.radius() && |
| 526 this->direction() == s.direction() && | 526 this->direction() == s.direction() && |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 SkBitmap* result, SkIPoint* offset) con
st { | 757 SkBitmap* result, SkIPoint* offset) con
st { |
| 758 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 758 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
| 759 } | 759 } |
| 760 | 760 |
| 761 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 761 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 762 SkBitmap* result, SkIPoint* offset) cons
t { | 762 SkBitmap* result, SkIPoint* offset) cons
t { |
| 763 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 763 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
| 764 } | 764 } |
| 765 | 765 |
| 766 #endif | 766 #endif |
| OLD | NEW |