Index: src/effects/SkColorFilters.cpp |
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp |
index ba62817f568beb7cee92aba584f5a2276e5e2442..bd0d2aa6c89cfe96e5306302ac8af3b8b09da265 100644 |
--- a/src/effects/SkColorFilters.cpp |
+++ b/src/effects/SkColorFilters.cpp |
@@ -195,6 +195,8 @@ |
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; |
@@ -290,8 +292,6 @@ |
const ModeColorFilterEffect& s = other.cast<ModeColorFilterEffect>(); |
return fMode == s.fMode && fColor == s.fColor; |
} |
- |
- virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE; |
SkXfermode::Mode fMode; |
GrColor fColor; |
@@ -382,19 +382,18 @@ |
} |
-void ModeColorFilterEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
+void ModeColorFilterEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const { |
float inputColor[4]; |
- GrColorToRGBAFloat(inout->fColor, inputColor); |
+ GrColorToRGBAFloat(*color, inputColor); |
float filterColor[4]; |
GrColorToRGBAFloat(fColor, filterColor); |
MaskedColorExpr result = |
color_filter_expression(fMode, |
MaskedColorExpr(filterColor, kRGBA_GrColorComponentFlags), |
- MaskedColorExpr(inputColor, inout->fValidFlags)); |
- |
- inout->fColor = result.getColor(); |
- inout->fValidFlags = result.getValidComponents(); |
- inout->fIsSingleComponent = false; |
+ MaskedColorExpr(inputColor, *validFlags)); |
+ |
+ *color = result.getColor(); |
+ *validFlags = result.getValidComponents(); |
} |
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ModeColorFilterEffect); |