Index: src/effects/SkAlphaThresholdFilter.cpp |
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp |
index 462cfec55eeabb6189debcb09403783c3edd7f37..09cc61851c6c43c071a8eb156c1d6f83995d8a50 100644 |
--- a/src/effects/SkAlphaThresholdFilter.cpp |
+++ b/src/effects/SkAlphaThresholdFilter.cpp |
@@ -76,6 +76,8 @@ |
static const char* Name() { return "Alpha Threshold"; } |
virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; |
+ virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE; |
+ |
float innerThreshold() const { return fInnerThreshold; } |
float outerThreshold() const { return fOuterThreshold; } |
@@ -102,8 +104,6 @@ |
virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; |
- virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE; |
- |
GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
float fInnerThreshold; |
@@ -228,13 +228,13 @@ |
this->fOuterThreshold == s.fOuterThreshold); |
} |
-void AlphaThresholdEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
- if (inout->isOpaque() && GrPixelConfigIsOpaque(this->texture(0)->config())) { |
- inout->fValidFlags = kA_GrColorComponentFlag; |
+void AlphaThresholdEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const { |
+ if ((*validFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUnpackA(*color) && |
+ GrPixelConfigIsOpaque(this->texture(0)->config())) { |
+ *validFlags = kA_GrColorComponentFlag; |
} else { |
- inout->fValidFlags = 0; |
- } |
- inout->fIsSingleComponent = false; |
+ *validFlags = 0; |
+ } |
} |
#endif |