diff options
author | 2016-08-08 09:55:06 -0700 | |
---|---|---|
committer | 2016-08-08 09:55:06 -0700 | |
commit | 77f2fae49ec969f0771921f1c1886c12289c7bfe (patch) | |
tree | 55a1383dc7e7874e7f0dc66a0d6a13933ff195d1 /include/gpu | |
parent | 0652baa23ec2ea9e1bcdf686bf1e1118b186b42c (diff) |
Encapsulate GrReducedClip result in class members
Updates GrReducedClip to store its result in class members instead of
various pointer arguments. This helps clean up calling code and will
make it easier to reduce the clip higher in the stack.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2222873002
Review-Url: https://codereview.chromium.org/2222873002
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrClip.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h index 03b9f65b9c..5f0a881653 100644 --- a/include/gpu/GrClip.h +++ b/include/gpu/GrClip.h @@ -129,12 +129,12 @@ 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 && - innerClipBounds.fLeft <= queryBounds.fLeft + kBoundsTolerance && - innerClipBounds.fTop <= queryBounds.fTop + kBoundsTolerance && - innerClipBounds.fRight >= queryBounds.fRight - kBoundsTolerance && - innerClipBounds.fBottom >= queryBounds.fBottom - 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 && + innerClipBounds.fBottom > queryBounds.fBottom - kBoundsTolerance; } /** @@ -145,12 +145,12 @@ public: */ template<typename TRect> constexpr static bool IsOutsideClip(const TRect& outerClipBounds, const SkRect& queryBounds) { - return outerClipBounds.fRight - outerClipBounds.fLeft < kBoundsTolerance || - outerClipBounds.fBottom - outerClipBounds.fTop < kBoundsTolerance || - outerClipBounds.fLeft > queryBounds.fRight - kBoundsTolerance || - outerClipBounds.fTop > queryBounds.fBottom - kBoundsTolerance || - outerClipBounds.fRight < queryBounds.fLeft + kBoundsTolerance || - outerClipBounds.fBottom < queryBounds.fTop + kBoundsTolerance; + return outerClipBounds.fRight - outerClipBounds.fLeft <= kBoundsTolerance || + outerClipBounds.fBottom - outerClipBounds.fTop <= kBoundsTolerance || + outerClipBounds.fLeft >= queryBounds.fRight - kBoundsTolerance || + outerClipBounds.fTop >= queryBounds.fBottom - kBoundsTolerance || + outerClipBounds.fRight <= queryBounds.fLeft + kBoundsTolerance || + outerClipBounds.fBottom <= queryBounds.fTop + kBoundsTolerance; } /** |