diff options
author | robertphillips <robertphillips@google.com> | 2014-12-30 13:53:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-30 13:53:51 -0800 |
commit | c187a3c8849ba5e409f79ead21cd5bc82173d9f8 (patch) | |
tree | 4d44c7d9b76bf1303833cb90419665081be285e2 /src | |
parent | 7775c85611c734a2af709b3a9c127939a4296c48 (diff) |
Fix computation of bound in FillBounds::updateSaveBounds
intersect doesn't change the bounds when the two bounds do not intersect. This is definitely not the intended behavior.
With the SKPs captured on 12/23/14, Chrome began passing Skia drawPicture ops that did not intersect the current clip - which revealed this bug.
Review URL: https://codereview.chromium.org/817483004
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkRecordDraw.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp index 6a2a5e3677..3d6f3a0321 100644 --- a/src/core/SkRecordDraw.cpp +++ b/src/core/SkRecordDraw.cpp @@ -220,7 +220,10 @@ public: // Nothing can draw outside the current clip. // (Only bounded ops call into this method, so oddballs like Clear don't matter here.) - rect.intersect(fCurrentClipBounds); + if (!rect.intersect(fCurrentClipBounds)) { + return Bounds::MakeEmpty(); + } + return rect; } |