diff options
author | Mike Klein <mtklein@chromium.org> | 2017-10-31 20:56:54 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-31 20:57:06 +0000 |
commit | e26062a169e2ff15436b715ea237a0342a4abf55 (patch) | |
tree | 6504a5444d2090b520f3f8b586844c3f5acbe67b /src | |
parent | bef063af14d0608a5c40fe4473fbfaf1db591603 (diff) |
Revert "Fix int overflow issues with clip and path bounds."
This reverts commit b1fc36829de69da5376019403fdd649c06f4cf1b.
Reason for revert:
I hate to revert this, but I think it's caused some layout test diffs that are holding up the roll.
https://storage.googleapis.com/chromium-layout-test-archives/linux_trusty_blink_rel/17909/layout-test-results/results.html
Original change's description:
> Fix int overflow issues with clip and path bounds.
>
> * Clamp scissor clip bounds to query bounds (which are RT bounds)
> * Change IsInsideClip test to be more int overflow friendly
> * Check to make sure path bounds can have representable width and height
>
> Bug: skia:7239
> Bug: skia:7240
> Change-Id: I4c512d05c5609a5a466393408282101697ebea83
> Reviewed-on: https://skia-review.googlesource.com/65506
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,csmartdalton@google.com
Change-Id: Ic5c15219cdbe92811284130bce1e984823f0c4d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7239, skia:7240
Reviewed-on: https://skia-review.googlesource.com/65920
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrClip.h | 4 | ||||
-rw-r--r-- | src/gpu/GrReducedClip.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrSoftwarePathRenderer.cpp | 5 |
3 files changed, 3 insertions, 10 deletions
diff --git a/src/gpu/GrClip.h b/src/gpu/GrClip.h index bd7d8a1d96..2e247c82f2 100644 --- a/src/gpu/GrClip.h +++ b/src/gpu/GrClip.h @@ -74,8 +74,8 @@ public: */ template <typename TRect> constexpr static bool IsInsideClip(const TRect& innerClipBounds, const SkRect& queryBounds) { - return innerClipBounds.fRight > innerClipBounds.fLeft + kBoundsTolerance && - innerClipBounds.fBottom > innerClipBounds.fTop + kBoundsTolerance && + return innerClipBounds.fRight - innerClipBounds.fLeft > kBoundsTolerance && + innerClipBounds.fBottom - innerClipBounds.fTop > kBoundsTolerance && innerClipBounds.fLeft < queryBounds.fLeft + kBoundsTolerance && innerClipBounds.fTop < queryBounds.fTop + kBoundsTolerance && innerClipBounds.fRight > queryBounds.fRight - kBoundsTolerance && diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp index f22444895b..29f483022b 100644 --- a/src/gpu/GrReducedClip.cpp +++ b/src/gpu/GrReducedClip.cpp @@ -57,9 +57,7 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart); if (!iter.prev()->isAA() || GrClip::IsPixelAligned(stackBounds)) { // The clip is a non-aa rect. Here we just implement the entire thing using fScissor. - SkRect tightBounds; - SkAssertResult(tightBounds.intersect(stackBounds, queryBounds)); - tightBounds.round(&fScissor); + stackBounds.round(&fScissor); fHasScissor = true; fInitialState = fScissor.isEmpty() ? InitialState::kAllOut : InitialState::kAllIn; return; diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index ef7fa9078e..4b0f363fee 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -52,11 +52,6 @@ static bool get_unclipped_shape_dev_bounds(const GrShape& shape, const SkMatrix& if (!shapeDevBounds.intersect(SkRect::MakeLTRB(INT32_MIN, INT32_MIN, kMaxInt, kMaxInt))) { return false; } - // Make sure that the resulting SkIRect can have representable width and height - if (SkScalarRoundToInt(shapeDevBounds.width()) > kMaxInt || - SkScalarRoundToInt(shapeDevBounds.height()) > kMaxInt) { - return false; - } shapeDevBounds.roundOut(devBounds); return true; } |