Add contains point method to Region

Change-Id: I553433ff7ac39f14ffca8278960d2abc95b4dd63
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index e5abcf5..7de48a4 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -221,6 +221,22 @@
     return *this;
 }
 
+bool Region::contains(const Point& point) const {
+    return contains(point.x, point.y);
+}
+
+bool Region::contains(int x, int y) const {
+    const_iterator cur = begin();
+    const_iterator const tail = end();
+    while (cur != tail) {
+        if (y >= cur->top && y < cur->bottom && x >= cur->left && x < cur->right) {
+            return true;
+        }
+        cur++;
+    }
+    return false;
+}
+
 void Region::clear()
 {
     mStorage.clear();