summaryrefslogtreecommitdiffstats
path: root/include/ui/Region.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ui/Region.h')
-rw-r--r--include/ui/Region.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/ui/Region.h b/include/ui/Region.h
index 0d1c68c..2a14918 100644
--- a/include/ui/Region.h
+++ b/include/ui/Region.h
@@ -35,6 +35,8 @@ class String8;
class Region : public LightFlattenable<Region>
{
public:
+ static const Region INVALID_REGION;
+
Region();
Region(const Region& rhs);
explicit Region(const Rect& rhs);
@@ -55,11 +57,12 @@ public:
// the region becomes its bounds
Region& makeBoundsSelf();
-
+
void clear();
void set(const Rect& r);
+ void set(int32_t w, int32_t h);
void set(uint32_t w, uint32_t h);
-
+
Region& orSelf(const Rect& rhs);
Region& xorSelf(const Rect& rhs);
Region& andSelf(const Rect& rhs);
@@ -110,14 +113,14 @@ public:
inline Region& operator -= (const Region& rhs);
inline Region& operator += (const Point& pt);
-
+
// returns true if the regions share the same underlying storage
bool isTriviallyEqual(const Region& region) const;
/* various ways to access the rectangle list */
-
+
// STL-like iterators
typedef Rect const* const_iterator;
const_iterator begin() const;
@@ -133,7 +136,7 @@ public:
SharedBuffer const* getSharedBuffer(size_t* count) const;
/* no user serviceable parts here... */
-
+
// add a rectangle to the internal list. This rectangle must
// be sorted in Y and X and must not make the region invalid.
void addRectUnchecked(int l, int t, int r, int b);
@@ -149,7 +152,7 @@ public:
private:
class rasterizer;
friend class rasterizer;
-
+
Region& operationSelf(const Rect& r, int op);
Region& operationSelf(const Region& r, int op);
Region& operationSelf(const Region& r, int dx, int dy, int op);
@@ -172,7 +175,7 @@ private:
static bool validate(const Region& reg,
const char* name, bool silent = false);
-
+
// mStorage is a (manually) sorted array of Rects describing the region
// with an extra Rect as the last element which is set to the
// bounds of the region. However, if the region is