Region now has its own implementation instead of relying on SkRegion, which allows us to break libui's dependency on libcorecg.
diff --git a/include/ui/Rect.h b/include/ui/Rect.h
index d232847..902324d 100644
--- a/include/ui/Rect.h
+++ b/include/ui/Rect.h
@@ -30,6 +30,8 @@
     int right;
     int bottom;
 
+    typedef int value_type;
+    
     // we don't provide copy-ctor and operator= on purpose
     // because we want the compiler generated versions
 
@@ -54,6 +56,10 @@
 
     void makeInvalid();
     
+    inline void clear() {
+        left = top = right = bottom = 0;
+    }
+    
     // a valid rectangle has a non negative width and height
     inline bool isValid() const {
         return (width()>=0) && (height()>=0);
@@ -78,28 +84,29 @@
         return bottom-top;
     }
 
-    // returns left-top Point non-const reference, can be assigned
-    inline Point& leftTop() {
-        return reinterpret_cast<Point&>(left);
-    }
-    // returns right bottom non-const reference, can be assigned
-    inline Point& rightBottom() {
-        return reinterpret_cast<Point&>(right);
-    }
-    
     // the following 4 functions return the 4 corners of the rect as Point
-    inline const Point& leftTop() const {
-        return reinterpret_cast<const Point&>(left);
+    inline Point leftTop() const {
+        return Point(left, top);
     }
-    inline const Point& rightBottom() const {
-        return reinterpret_cast<const Point&>(right);
+    inline Point rightBottom() const {
+        return Point(right, bottom);
     }
-    Point rightTop() const {
+    inline Point rightTop() const {
         return Point(right, top);
     }
-    Point leftBottom() const {
+    inline Point leftBottom() const {
         return Point(left, bottom);
     }
+    
+    inline void setLeftTop(const Point& p) {
+        left = p.x;
+        top  = p.y;
+    }
+
+    inline void setRightBottom(const Point& p) {
+        right  = p.x;
+        bottom = p.y;
+    }
 
     // comparisons
     inline bool operator == (const Rect& rhs) const {