Update ConstColor FP to support an input FP.
In the "ignore input" mode, the input FP contributes nothing and is
never sampled. In the "modulate input" cases, the input FP is sampled
as one would expect.
Change-Id: I96717d63d8e3d7ef6aa4eaaf88154c6e5ce47e55
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296299
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index ced8b4a..c71ac77 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -105,14 +105,14 @@
// skip the draw or omit the clip element.
if (!SkPathPriv::CheapComputeFirstDirection(path, &dir)) {
if (GrProcessorEdgeTypeIsInverseFill(type)) {
- return GrConstColorProcessor::Make(SK_PMColor4fWHITE,
+ return GrConstColorProcessor::Make(/*inputFP=*/nullptr, SK_PMColor4fWHITE,
GrConstColorProcessor::InputMode::kModulateRGBA);
}
// This could use kIgnore instead of kModulateRGBA but it would trigger a debug print
// about a coverage processor not being compatible with the alpha-as-coverage optimization.
// We don't really care about this unlikely case so we just use kModulateRGBA to suppress
// the print.
- return GrConstColorProcessor::Make(SK_PMColor4fTRANSPARENT,
+ return GrConstColorProcessor::Make(/*inputFP=*/nullptr, SK_PMColor4fTRANSPARENT,
GrConstColorProcessor::InputMode::kModulateRGBA);
}