summaryrefslogtreecommitdiffstats
path: root/include/ui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-08-31 15:41:24 -0700
committerMathias Agopian <mathias@google.com>2012-08-31 18:38:22 -0700
commit2401ead70099c982796ecc3ec63ec8a5570948fc (patch)
tree70b4464149c060bf808a5cb7e15de67b612d3fe1 /include/ui
parent3ab68558fa5a4b8f792a54965a010f03385bd271 (diff)
downloadframeworks_native-2401ead70099c982796ecc3ec63ec8a5570948fc.zip
frameworks_native-2401ead70099c982796ecc3ec63ec8a5570948fc.tar.gz
frameworks_native-2401ead70099c982796ecc3ec63ec8a5570948fc.tar.bz2
Add a way to retrieve a Region as a SharedBuffer
Change-Id: Ia53cb905fbc88f899521658545f990fb9217b1e1
Diffstat (limited to 'include/ui')
-rw-r--r--include/ui/Region.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/ui/Region.h b/include/ui/Region.h
index 46a36ed..0049fde 100644
--- a/include/ui/Region.h
+++ b/include/ui/Region.h
@@ -28,6 +28,7 @@
namespace android {
// ---------------------------------------------------------------------------
+class SharedBuffer;
class String8;
// ---------------------------------------------------------------------------
@@ -106,16 +107,23 @@ public:
/* various ways to access the rectangle list */
+
+ // STL-like iterators
typedef Rect const* const_iterator;
-
- const_iterator begin() const;
- const_iterator end() const;
+ const_iterator begin() const;
+ const_iterator end() const;
- /* no user serviceable parts here... */
-
- Rect const* getArray(size_t* count) const;
+ // returns an array of rect which has the same life-time has this
+ // Region object.
+ Rect const* getArray(size_t* count) const;
+
+ // returns a SharedBuffer as well as the number of rects.
+ // ownership is transfered to the caller.
+ // the caller must call SharedBuffer::release() to free the memory.
+ 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.