From efc7ab6dcea8c22ddd7c0259ef4ab4bbf1e93044 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Tue, 17 Apr 2012 19:36:18 -0700 Subject: 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 --- libs/gui/BufferQueue.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'libs/gui/BufferQueue.cpp') 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(×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 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; -- cgit v1.2.3-59-g8ed1b