diff options
author | Florin Malita <fmalita@chromium.org> | 2017-02-03 18:21:17 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-03 18:21:33 +0000 |
commit | 8d3ffad8116b53b26483195e651a8c34857b3061 (patch) | |
tree | 5245bcfccd19841dc5ff815a32eab28fe58278b6 /src/effects | |
parent | 8d3196bdfcf478982bec9885d21e1d664ab9a72b (diff) |
Revert "Revert "Don't instantiate shaders with non-invertible local matrix""
This reverts commit 0e86725ba4f667056ff1ef65275165853a47303b.
Reason for revert: landed Blink fix, should pass layout tests now
Original change's description:
> Revert "Don't instantiate shaders with non-invertible local matrix"
>
> This reverts commit ebfbba9bbdacd754c8ad7429ee066f53f17bc66b.
>
> Reason for revert: breaks chrome blink tests for linux_trusty_blink_rel
>
> Original change's description:
> > Don't instantiate shaders with non-invertible local matrix
> >
> > Change-Id: If11f7d57cbf45929632d858f91c02d8f5fa9f442
> > Reviewed-on: https://skia-review.googlesource.com/7885
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> >
>
> TBR=fmalita@chromium.org,reed@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I41c5513523c27dc4bad68008f08369185897b7a2
> Reviewed-on: https://skia-review.googlesource.com/7948
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Hal Canary <halcanary@google.com>
>
TBR=halcanary@google.com,reviews@skia.org,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I373ea6c61a256fd8cfbfb34f8b2d39a3ff8109db
Reviewed-on: https://skia-review.googlesource.com/8003
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index 7b91a60f75..03a2db0995 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -944,6 +944,9 @@ sk_sp<SkShader> SkGradientShader::MakeLinear(const SkPoint pts[2], if (1 == colorCount) { return SkShader::MakeColorShader(colors[0], std::move(colorSpace)); } + if (localMatrix && !localMatrix->invert(nullptr)) { + return nullptr; + } ColorStopOptimizer opt(colors, pos, colorCount, mode); @@ -980,6 +983,9 @@ sk_sp<SkShader> SkGradientShader::MakeRadial(const SkPoint& center, SkScalar rad if (1 == colorCount) { return SkShader::MakeColorShader(colors[0], std::move(colorSpace)); } + if (localMatrix && !localMatrix->invert(nullptr)) { + return nullptr; + } ColorStopOptimizer opt(colors, pos, colorCount, mode); @@ -1026,6 +1032,9 @@ sk_sp<SkShader> SkGradientShader::MakeTwoPointConical(const SkPoint& start, return SkShader::MakeEmptyShader(); } } + if (localMatrix && !localMatrix->invert(nullptr)) { + return nullptr; + } EXPAND_1_COLOR(colorCount); ColorStopOptimizer opt(colors, pos, colorCount, mode); @@ -1086,6 +1095,9 @@ sk_sp<SkShader> SkGradientShader::MakeSweep(SkScalar cx, SkScalar cy, if (1 == colorCount) { return SkShader::MakeColorShader(colors[0], std::move(colorSpace)); } + if (localMatrix && !localMatrix->invert(nullptr)) { + return nullptr; + } auto mode = SkShader::kClamp_TileMode; |