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

Unified Diff: cc/region.cc

Issue 11368149: cc: Define Region::Contains() to be A contains B if all points in B are also in A. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « cc/occlusion_tracker.cc ('k') | cc/region_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/region.cc
diff --git a/cc/region.cc b/cc/region.cc
index 7a5e83cd60fbce38d8f627c82f90fc06ce9e2cae..f0fddc5857b1f5c5e91a638f8e6f3ca379e9e9c2 100644
--- a/cc/region.cc
+++ b/cc/region.cc
@@ -47,10 +47,14 @@ bool Region::Contains(gfx::Point point) const {
}
bool Region::Contains(gfx::Rect rect) const {
+ if (rect.IsEmpty())
+ return true;
return skregion_.contains(ToSkIRect(rect));
}
bool Region::Contains(const Region& region) const {
+ if (region.IsEmpty())
+ return true;
return skregion_.contains(region.skregion_);
}
« no previous file with comments | « cc/occlusion_tracker.cc ('k') | cc/region_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698