Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9f2a333

Browse files
johnstiles-googleSkia Commit-Bot
authored and
Skia Commit-Bot
committed
Update SkColorFilterShader to use an inputFP instead of RunInSeries.
Change-Id: I22a6b110c414fe3d8942b2c890c1339de45c39e6 Bug: skia:10217 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298984 Reviewed-by: Michael Ludwig <[email protected]> Commit-Queue: John Stiles <[email protected]>
1 parent c7ed7e6 commit 9f2a333

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/shaders/SkColorFilterShader.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,19 @@ skvm::Color SkColorFilterShader::onProgram(skvm::Builder* p,
9393

9494
std::unique_ptr<GrFragmentProcessor> SkColorFilterShader::asFragmentProcessor(
9595
const GrFPArgs& args) const {
96-
auto fp1 = as_SB(fShader)->asFragmentProcessor(args);
97-
if (!fp1) {
96+
auto shaderFP = as_SB(fShader)->asFragmentProcessor(args);
97+
if (!shaderFP) {
9898
return nullptr;
9999
}
100100

101101
// TODO I guess, but it shouldn't come up as used today.
102102
SkASSERT(fAlpha == 1.0f);
103103

104-
auto fp2 = fFilter->asFragmentProcessor(args.fContext, *args.fDstColorInfo);
105-
if (!fp2) {
106-
return fp1;
107-
}
108-
109-
std::unique_ptr<GrFragmentProcessor> fpSeries[] = { std::move(fp1), std::move(fp2) };
110-
return GrFragmentProcessor::RunInSeries(fpSeries, 2);
104+
auto [success, fp] = fFilter->asFragmentProcessor(std::move(shaderFP), args.fContext,
105+
*args.fDstColorInfo);
106+
// If the filter FP could not be created, we still want to return the shader FP, so checking
107+
// success can be omitted here.
108+
return std::move(fp);
111109
}
112110
#endif
113111

0 commit comments

Comments
 (0)