summaryrefslogtreecommitdiffstats
path: root/include/private
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-04-15 18:48:26 -0700
committerMathias Agopian <mathias@google.com>2010-04-20 13:36:29 -0700
commite9e4d5431d0df77a73f92b4a892417f47a57334c (patch)
treecd052998c28feb556a6b75febc712b60629ec675 /include/private
parentcdaaf320a1db27a7045fafa4d849c20daa97c146 (diff)
downloadframeworks_av-e9e4d5431d0df77a73f92b4a892417f47a57334c.zip
frameworks_av-e9e4d5431d0df77a73f92b4a892417f47a57334c.tar.gz
frameworks_av-e9e4d5431d0df77a73f92b4a892417f47a57334c.tar.bz2
added setCrop() to android_native_window_t
hooked up the new method up to Surface.cpp the actual crop is not implemented in SF yet Change-Id: Ic6e313c98fd880f127a051a0ccc71808bd689751
Diffstat (limited to 'include/private')
-rw-r--r--include/private/surfaceflinger/SharedBufferStack.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h
index 3b9768b..6ace5bc 100644
--- a/include/private/surfaceflinger/SharedBufferStack.h
+++ b/include/private/surfaceflinger/SharedBufferStack.h
@@ -70,9 +70,9 @@ class SharedClient;
// ----------------------------------------------------------------------------
// 4 * (11 + 7 + (1 + 2*NUM_RECT_MAX) * NUM_BUFFER_MAX) * NUM_LAYERS_MAX
-// 4 * (11 + 7 + (1 + 2*6)*16) * 31
-// 904 * 31
-// = ~27 KiB (28024)
+// 4 * (11 + 7 + (1 + 2*7)*16) * 31
+// 1032 * 31
+// = ~27 KiB (31992)
class SharedBufferStack
{
@@ -82,21 +82,31 @@ class SharedBufferStack
friend class SharedBufferServer;
public:
+ struct Statistics { // 4 longs
+ typedef int32_t usecs_t;
+ usecs_t totalTime;
+ usecs_t reserved[3];
+ };
+
+ struct SmallRect {
+ uint16_t l, t, r, b;
+ };
+
struct FlatRegion { // 52 bytes = 4 * (1 + 2*N)
static const unsigned int NUM_RECT_MAX = 6;
uint32_t count;
- uint16_t rects[4*NUM_RECT_MAX];
+ SmallRect rects[NUM_RECT_MAX];
};
- struct Statistics { // 4 longs
- typedef int32_t usecs_t;
- usecs_t totalTime;
- usecs_t reserved[3];
+ struct BufferData {
+ FlatRegion dirtyRegion;
+ SmallRect crop;
};
SharedBufferStack();
void init(int32_t identity);
status_t setDirtyRegion(int buffer, const Region& reg);
+ status_t setCrop(int buffer, const Rect& reg);
Region getDirtyRegion(int buffer) const;
// these attributes are part of the conditions/updates
@@ -113,7 +123,7 @@ public:
int32_t reserved32[6];
Statistics stats;
int32_t reserved;
- FlatRegion dirtyRegion[NUM_BUFFER_MAX]; // 832 bytes
+ BufferData buffers[NUM_BUFFER_MAX]; // 960 bytes
};
// ----------------------------------------------------------------------------
@@ -243,6 +253,7 @@ public:
status_t queue(int buf);
bool needNewBuffer(int buffer) const;
status_t setDirtyRegion(int buffer, const Region& reg);
+ status_t setCrop(int buffer, const Rect& reg);
private:
friend struct Condition;