Update SkModeColorFilter to support an input FP.
This change relies on the Xfermode updates in the prior CL
(http://review.skia.org/299703) to render properly, and requires
slightly different blending behavior in the compose FP which
necessitated a new ComposeBehavior enum.
Eventually we would like to settle on a universal ComposeBehavior which
works well for all call sites, but that will be its own fairly
disruptive change. This work will be tracked at skia:10457.
Change-Id: I3cc0ea5e016fbef82bc63d653d60d0505efaa66f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298821
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
index 7a0858c..9b3b7b7 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
@@ -17,6 +17,7 @@
}
void GrGLSLFragmentProcessor::emitChildFunction(int childIndex, EmitArgs& args) {
+ SkASSERT(childIndex >= 0);
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
while (childIndex >= (int) fFunctionNames.size()) {
fFunctionNames.emplace_back();
@@ -43,6 +44,7 @@
SkString GrGLSLFragmentProcessor::invokeChild(int childIndex, const char* inputColor,
EmitArgs& args, SkSL::String skslCoords) {
+ SkASSERT(childIndex >= 0);
this->emitChildFunction(childIndex, args);
if (skslCoords.empty()) {
@@ -72,6 +74,7 @@
SkString GrGLSLFragmentProcessor::invokeChildWithMatrix(int childIndex, const char* inputColor,
EmitArgs& args,
SkSL::String skslMatrix) {
+ SkASSERT(childIndex >= 0);
this->emitChildFunction(childIndex, args);
const GrFragmentProcessor& childProc = args.fFp.childProcessor(childIndex);