Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: src/gpu/GrFragmentProcessor.cpp

Issue 2106893003: Fixed crash when RunInSeriesFP's color input is nil (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrFragmentProcessor.cpp
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 96a0f716c93749f4b7a7698d10f05be84c47f357..bad7ebe0360cd046262d39b4fa639aeecb874445 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -310,9 +310,11 @@ sk_sp<GrFragmentProcessor> GrFragmentProcessor::RunInSeries(sk_sp<GrFragmentProc
class GLFP : public GrGLSLFragmentProcessor {
public:
void emitCode(EmitArgs& args) override {
- SkString input(args.fInputColor);
- for (int i = 0; i < this->numChildProcessors() - 1; ++i) {
- SkString temp;
+ // First guy's input might be nil.
+ SkString temp("out0");
+ this->emitChild(0, args.fInputColor, &temp, args);
+ SkString input = temp;
+ for (int i = 1; i < this->numChildProcessors() - 1; ++i) {
temp.printf("out%d", i);
this->emitChild(i, input.c_str(), &temp, args);
input = temp;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698