aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar dvonbeck <dvonbeck@google.com>2016-07-06 12:00:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-06 12:00:06 -0700
commitca9eeab0eaa32fc8f61be9003fafc3fe1afe78e4 (patch)
tree6111bd7a8c2edf63361b4827b4004bda16cb9e4a /src/gpu
parent61457a6b80397256cbe24fa8927d6ed296cb5824 (diff)
Fixed crash when RunInSeriesFP's color input is nil
SeriesFragmentProcessor would call emitChild with "" input color as opposed to nil input color when ginven a nil input color. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2106893003 Review-Url: https://codereview.chromium.org/2106893003
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrFragmentProcessor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 96a0f716c9..bad7ebe036 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;