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
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index 39e9724..5095ebd 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -536,12 +536,19 @@
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(×tamp, &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 @@
}
}
- 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 @@
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;