summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-02-07 17:04:34 -0800
committerRomain Guy <romainguy@google.com>2012-02-07 17:04:34 -0800
commitb8a2e98cd7edbe7513543670c94f6b5efa74462f (patch)
treec8de431884bab413f199a61d30ffd32c703a4ad5 /include
parent78b3490a9a1c507a0f9b887639d1d56bd35dda86 (diff)
downloadframeworks_native-b8a2e98cd7edbe7513543670c94f6b5efa74462f.zip
frameworks_native-b8a2e98cd7edbe7513543670c94f6b5efa74462f.tar.gz
frameworks_native-b8a2e98cd7edbe7513543670c94f6b5efa74462f.tar.bz2
Preliminary support for clipRect(Rect, Op)
This adds basic support for clip regions. It is currently disabled at compile time. Enabling clip regions will require setting up a stencil buffer. Change-Id: I638616a972276e38737f8ac0633692c3845eaa74
Diffstat (limited to 'include')
-rw-r--r--include/ui/Region.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/ui/Region.h b/include/ui/Region.h
index 6c9a620..f242f18 100644
--- a/include/ui/Region.h
+++ b/include/ui/Region.h
@@ -55,43 +55,51 @@ public:
void set(uint32_t w, uint32_t h);
Region& orSelf(const Rect& rhs);
+ Region& xorSelf(const Rect& rhs);
Region& andSelf(const Rect& rhs);
Region& subtractSelf(const Rect& rhs);
// boolean operators, applied on this
Region& orSelf(const Region& rhs);
+ Region& xorSelf(const Region& rhs);
Region& andSelf(const Region& rhs);
Region& subtractSelf(const Region& rhs);
// boolean operators
const Region merge(const Rect& rhs) const;
+ const Region mergeExclusive(const Rect& rhs) const;
const Region intersect(const Rect& rhs) const;
const Region subtract(const Rect& rhs) const;
// boolean operators
const Region merge(const Region& rhs) const;
+ const Region mergeExclusive(const Region& rhs) const;
const Region intersect(const Region& rhs) const;
const Region subtract(const Region& rhs) const;
// these translate rhs first
Region& translateSelf(int dx, int dy);
Region& orSelf(const Region& rhs, int dx, int dy);
+ Region& xorSelf(const Region& rhs, int dx, int dy);
Region& andSelf(const Region& rhs, int dx, int dy);
Region& subtractSelf(const Region& rhs, int dx, int dy);
// these translate rhs first
const Region translate(int dx, int dy) const;
const Region merge(const Region& rhs, int dx, int dy) const;
+ const Region mergeExclusive(const Region& rhs, int dx, int dy) const;
const Region intersect(const Region& rhs, int dx, int dy) const;
const Region subtract(const Region& rhs, int dx, int dy) const;
// convenience operators overloads
inline const Region operator | (const Region& rhs) const;
+ inline const Region operator ^ (const Region& rhs) const;
inline const Region operator & (const Region& rhs) const;
inline const Region operator - (const Region& rhs) const;
inline const Region operator + (const Point& pt) const;
inline Region& operator |= (const Region& rhs);
+ inline Region& operator ^= (const Region& rhs);
inline Region& operator &= (const Region& rhs);
inline Region& operator -= (const Region& rhs);
inline Region& operator += (const Point& pt);
@@ -158,6 +166,9 @@ private:
const Region Region::operator | (const Region& rhs) const {
return merge(rhs);
}
+const Region Region::operator ^ (const Region& rhs) const {
+ return mergeExclusive(rhs);
+}
const Region Region::operator & (const Region& rhs) const {
return intersect(rhs);
}
@@ -172,6 +183,9 @@ const Region Region::operator + (const Point& pt) const {
Region& Region::operator |= (const Region& rhs) {
return orSelf(rhs);
}
+Region& Region::operator ^= (const Region& rhs) {
+ return xorSelf(rhs);
+}
Region& Region::operator &= (const Region& rhs) {
return andSelf(rhs);
}