summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueue.cpp
diff options
context:
space:
mode:
author Jamie Gennis <jgennis@google.com> 2012-04-17 19:36:18 -0700
committer Mathias Agopian <mathias@google.com> 2012-04-24 17:34:38 -0700
commitefc7ab6dcea8c22ddd7c0259ef4ab4bbf1e93044 (patch)
treeb9cef83bc407b4aa08a170d861c899c79bcb5b42 /libs/gui/BufferQueue.cpp
parentf4b322801d872b64f6c7dd2d2ffc1e4f8e993eef (diff)
libgui: Add plumbing for active rectangle
This change adds the plumbing to SurfaceTextureClient, BufferQueue, and SurfaceTexture to get the active rectangle passed to the ANativeWindow to the buffer consumer. Change-Id: I35da0889b266327ebb079b6a7136fa3e2e8b00e6
Diffstat (limited to 'libs/gui/BufferQueue.cpp')
-rw-r--r--libs/gui/BufferQueue.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index 39e9724f25..5095ebd128 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -536,12 +536,19 @@ status_t BufferQueue::queueBuffer(int buf,
ATRACE_CALL();
ATRACE_BUFFER_INDEX(buf);
- ST_LOGV("queueBuffer: slot=%d time=%lld crop=[%d,%d,%d,%d]", buf,
- mSlots[buf].mTimestamp,
- mSlots[buf].mCrop.left,
- mSlots[buf].mCrop.top,
- mSlots[buf].mCrop.right,
- mSlots[buf].mCrop.bottom);
+ Rect crop;
+ uint32_t transform;
+ int scalingMode;
+ int64_t timestamp;
+ Rect activeRect;
+
+ input.deflate(&timestamp, &crop, &scalingMode, &transform,
+ &activeRect);
+
+ ST_LOGV("queueBuffer: slot=%d time=%lld crop=[%d,%d,%d,%d] "
+ "active=[%d,%d,%d,%d]", buf, timestamp, crop.left, crop.top,
+ crop.right, crop.bottom, activeRect.left, activeRect.top,
+ activeRect.right, activeRect.bottom);
sp<ConsumerListener> listener;
@@ -590,14 +597,10 @@ status_t BufferQueue::queueBuffer(int buf,
}
}
- int scalingMode;
-
- input.deflate(
- &mSlots[buf].mTimestamp,
- &mSlots[buf].mCrop,
- &scalingMode,
- &mSlots[buf].mTransform);
-
+ mSlots[buf].mTimestamp = timestamp;
+ mSlots[buf].mCrop = crop;
+ mSlots[buf].mTransform = transform;
+ mSlots[buf].mActiveRect = activeRect;
switch (scalingMode) {
case NATIVE_WINDOW_SCALING_MODE_FREEZE:
@@ -856,6 +859,7 @@ status_t BufferQueue::acquireBuffer(BufferItem *buffer) {
buffer->mFrameNumber = mSlots[buf].mFrameNumber;
buffer->mTimestamp = mSlots[buf].mTimestamp;
buffer->mBuf = buf;
+ buffer->mActiveRect = mSlots[buf].mActiveRect;
mSlots[buf].mAcquireCalled = true;
mSlots[buf].mBufferState = BufferSlot::ACQUIRED;