aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-08-08 09:55:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-08 09:55:06 -0700
commit77f2fae49ec969f0771921f1c1886c12289c7bfe (patch)
tree55a1383dc7e7874e7f0dc66a0d6a13933ff195d1 /include/gpu
parent0652baa23ec2ea9e1bcdf686bf1e1118b186b42c (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.h24
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;
}
/**