diff options
author | Mike Reed <reed@google.com> | 2017-12-29 04:35:23 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-29 04:35:31 +0000 |
commit | 6f1151140f331c78d99ede3cac10462dc8b32cde (patch) | |
tree | decc8655a4ff7d570da3427fd1971daab2994c1d /src/shaders | |
parent | f3504d430cec35330017aa2af3a51083801c7dd9 (diff) |
Revert "remove legacy support for old old picture versions"
This reverts commit f3504d430cec35330017aa2af3a51083801c7dd9.
Reason for revert: breaks unittest in Printing unittest in chrome
Original change's description:
> remove legacy support for old old picture versions
>
> Bug: skia:
> Change-Id: Ieb97eabdb18e8c7bfa86e6a1fc6e0389cd096daa
> Reviewed-on: https://skia-review.googlesource.com/89860
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I9f90da5dcfb9543f2f575fa7dc3b9c82996b041d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/90020
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/shaders')
-rw-r--r-- | src/shaders/SkComposeShader.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/shaders/SkComposeShader.cpp b/src/shaders/SkComposeShader.cpp index 2feae7788e..34e54863b7 100644 --- a/src/shaders/SkComposeShader.cpp +++ b/src/shaders/SkComposeShader.cpp @@ -43,12 +43,17 @@ sk_sp<SkFlattenable> SkComposeShader::CreateProc(SkReadBuffer& buffer) { sk_sp<SkShader> dst(buffer.readShader()); sk_sp<SkShader> src(buffer.readShader()); unsigned mode = buffer.read32(); - float lerp = buffer.readScalar(); + + float lerp = 1; + if (!buffer.isVersionLT(SkReadBuffer::kComposeShaderCanLerp_Version)) { + lerp = buffer.readScalar(); + } // check for valid mode before we cast to the enum type - if (!buffer.validate(mode <= (unsigned)SkBlendMode::kLastMode)) { + if (mode > (unsigned)SkBlendMode::kLastMode) { return nullptr; } + return MakeCompose(std::move(dst), std::move(src), static_cast<SkBlendMode>(mode), lerp); } |