diff options
author | 2014-10-02 09:57:48 -0700 | |
---|---|---|
committer | 2014-10-02 09:57:48 -0700 | |
commit | 3b8af078281a5a20f951b9fd84f38d92b8f6217b (patch) | |
tree | 92c250b9011e2ee5e0e1a2517e7c7ee550853ddc /src/effects/SkMorphologyImageFilter.cpp | |
parent | 8f8c25eabb97da8eda488895f04f2d12cb5ea4cf (diff) |
Add isSingleComponent bool to getConstantColorComponent
Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.
BUG=skia:
Review URL: https://codereview.chromium.org/608253002
Diffstat (limited to 'src/effects/SkMorphologyImageFilter.cpp')
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 397e43193e..4c7f62482c 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -309,7 +309,6 @@ public: typedef GrGLMorphologyEffect GLProcessor; virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; - virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE; protected: @@ -318,6 +317,8 @@ protected: private: virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; + virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE; + GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType); GR_DECLARE_FRAGMENT_PROCESSOR_TEST; @@ -455,10 +456,11 @@ bool GrMorphologyEffect::onIsEqual(const GrProcessor& sBase) const { this->type() == s.type()); } -void GrMorphologyEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const { +void GrMorphologyEffect::onComputeInvariantOutput(InvariantOutput* inout) const { // This is valid because the color components of the result of the kernel all come // exactly from existing values in the source texture. - this->updateConstantColorComponentsForModulation(color, validFlags); + this->updateInvariantOutputForModulation(inout); + inout->fIsSingleComponent = false; } /////////////////////////////////////////////////////////////////////////////// |