Revert "Fix int overflow issues with clip and path bounds, take 2."
This reverts commit 430ad1f206
.
Reason for revert: Many bad GMs.
Original change's description:
> Fix int overflow issues with clip and path bounds, take 2.
>
> * 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: If8468e46bc74a428c25d466ff3756d0cad385c09
> Reviewed-on: https://skia-review.googlesource.com/66154
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I5b1a651b60340bb4230893ef5f5d2df2ce6fd241
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7239, skia:7240
Reviewed-on: https://skia-review.googlesource.com/67240
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
9d96df1f1f
commit
e3a700522f
@ -74,8 +74,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
template <typename TRect>
|
template <typename TRect>
|
||||||
constexpr static bool IsInsideClip(const TRect& innerClipBounds, const SkRect& queryBounds) {
|
constexpr static bool IsInsideClip(const TRect& innerClipBounds, const SkRect& queryBounds) {
|
||||||
return innerClipBounds.fRight > innerClipBounds.fLeft + kBoundsTolerance &&
|
return innerClipBounds.fRight - innerClipBounds.fLeft > kBoundsTolerance &&
|
||||||
innerClipBounds.fBottom > innerClipBounds.fTop + kBoundsTolerance &&
|
innerClipBounds.fBottom - innerClipBounds.fTop > kBoundsTolerance &&
|
||||||
innerClipBounds.fLeft < queryBounds.fLeft + kBoundsTolerance &&
|
innerClipBounds.fLeft < queryBounds.fLeft + kBoundsTolerance &&
|
||||||
innerClipBounds.fTop < queryBounds.fTop + kBoundsTolerance &&
|
innerClipBounds.fTop < queryBounds.fTop + kBoundsTolerance &&
|
||||||
innerClipBounds.fRight > queryBounds.fRight - kBoundsTolerance &&
|
innerClipBounds.fRight > queryBounds.fRight - kBoundsTolerance &&
|
||||||
|
@ -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))) {
|
if (!shapeDevBounds.intersect(SkRect::MakeLTRB(INT32_MIN, INT32_MIN, kMaxInt, kMaxInt))) {
|
||||||
return false;
|
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);
|
shapeDevBounds.roundOut(devBounds);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user