Add GrFragmentProcessor::Compose for composing two processors.
This is functionally equivalent to RunInSeries, but the implementation
can be simpler, because it doesn't support an arbitrary number of
processors.
In practice, Ganesh no longer calls RunInSeries with more than two
inputs at once, so all existing calls to RunInSeries have been replaced
with Compose.
Change-Id: I719d0a11ed747775af4e99fb9de33323d43e7874
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305400
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/src/gpu/GrAppliedClip.h b/src/gpu/GrAppliedClip.h
index c02f815..a7347ea 100644
--- a/src/gpu/GrAppliedClip.h
+++ b/src/gpu/GrAppliedClip.h
@@ -121,12 +121,8 @@
if (fCoverageFP == nullptr) {
fCoverageFP = std::move(fp);
} else {
- // Run this coverage FP in series with the previously-added coverage.
- std::unique_ptr<GrFragmentProcessor> series[] = {
- std::move(fCoverageFP),
- std::move(fp),
- };
- fCoverageFP = GrFragmentProcessor::RunInSeries(series, SK_ARRAY_COUNT(series));
+ // Compose this coverage FP with the previously-added coverage.
+ fCoverageFP = GrFragmentProcessor::Compose(std::move(fCoverageFP), std::move(fp));
}
}