diff options
author | caryclark <caryclark@google.com> | 2016-02-23 10:32:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-23 10:32:40 -0800 |
commit | 5a70bc7f3cd32aaccc137c7d650cea613baa2443 (patch) | |
tree | 9557cbfbd10ff3d368e840d1790ebd046ec2b5f8 /src | |
parent | 9ca27f39ddf7dafdc8ce97dba0fc9c4d1f07b7ed (diff) |
make transformed rrect radii fit rectangle
one more case caught by 1M skps
R=herb@google.com,reed@google.com
BUG=skia:4413
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1722483003
Review URL: https://codereview.chromium.org/1722483003
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkRRect.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp index 2e03f81200..2195dcfb13 100644 --- a/src/core/SkRRect.cpp +++ b/src/core/SkRRect.cpp @@ -158,6 +158,11 @@ void SkRRect::setRectRadii(const SkRect& rect, const SkVector radii[4]) { return; } + this->scaleRadii(); +} + +void SkRRect::scaleRadii() { + // Proportionally scale down all radii to fit. Find the minimum ratio // of a side and the radii on that side (for all four sides) and use // that to scale down _all_ the radii. This algorithm is from the @@ -420,7 +425,7 @@ bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const { SkTSwap(dst->fRadii[kUpperRight_Corner], dst->fRadii[kLowerRight_Corner]); } - SkDEBUGCODE(dst->validate();) + dst->scaleRadii(); return true; } |