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

Unified Diff: src/effects/SkColorFilters.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/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorFilters.cpp
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index bd0d2aa6c89cfe96e5306302ac8af3b8b09da265..ba62817f568beb7cee92aba584f5a2276e5e2442 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -195,8 +195,6 @@ public:
return SkNEW_ARGS(ModeColorFilterEffect, (c, mode));
}
- virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE;
-
bool willUseFilterColor() const {
SkXfermode::Coeff dstCoeff;
SkXfermode::Coeff srcCoeff;
@@ -293,6 +291,8 @@ private:
return fMode == s.fMode && fColor == s.fColor;
}
+ virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE;
+
SkXfermode::Mode fMode;
GrColor fColor;
@@ -382,18 +382,19 @@ private:
}
-void ModeColorFilterEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const {
+void ModeColorFilterEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
float inputColor[4];
- GrColorToRGBAFloat(*color, inputColor);
+ GrColorToRGBAFloat(inout->fColor, inputColor);
float filterColor[4];
GrColorToRGBAFloat(fColor, filterColor);
MaskedColorExpr result =
color_filter_expression(fMode,
MaskedColorExpr(filterColor, kRGBA_GrColorComponentFlags),
- MaskedColorExpr(inputColor, *validFlags));
+ MaskedColorExpr(inputColor, inout->fValidFlags));
- *color = result.getColor();
- *validFlags = result.getValidComponents();
+ inout->fColor = result.getColor();
+ inout->fValidFlags = result.getValidComponents();
+ inout->fIsSingleComponent = false;
}
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ModeColorFilterEffect);
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698