Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: include/gpu/GrClip.h

Issue 2222873002: Encapsulate GrReducedClip result in class members (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrClipStackClip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrClip.h
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h
index 03b9f65b9c4a99287a6cf87a893fe818cbdf6fcf..5f0a881653cf04a007434e68d5cc9af7312ed378 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;
csmartdalton 2016/08/08 05:26:55 Switching to <= and >= ought to remove the case wh
}
/**
« no previous file with comments | « no previous file | src/gpu/GrClipStackClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698