Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: src/effects/SkAlphaThresholdFilter.cpp

Issue 608253002: Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix isSolidWhite Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkAlphaThresholdFilter.cpp
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index 09cc61851c6c43c071a8eb156c1d6f83995d8a50..462cfec55eeabb6189debcb09403783c3edd7f37 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -76,8 +76,6 @@ public:
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; }
@@ -104,6 +102,8 @@ private:
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 @@ bool AlphaThresholdEffect::onIsEqual(const GrProcessor& sBase) const {
this->fOuterThreshold == s.fOuterThreshold);
}
-void AlphaThresholdEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const {
- if ((*validFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUnpackA(*color) &&
- GrPixelConfigIsOpaque(this->texture(0)->config())) {
- *validFlags = kA_GrColorComponentFlag;
+void AlphaThresholdEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
+ if (inout->isOpaque() && GrPixelConfigIsOpaque(this->texture(0)->config())) {
+ inout->fValidFlags = kA_GrColorComponentFlag;
} else {
- *validFlags = 0;
+ inout->fValidFlags = 0;
}
+ inout->fIsSingleComponent = false;
}
#endif
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698