summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2021-06-07 10:45:40 -0700
committer Robert Carr <racarr@google.com> 2021-06-07 10:51:41 -0700
commit97e7cc0ce23e417a2355a4559d43fd9c9ccb4efa (patch)
tree1f3427e86f9211e8e6936e99b8a8ac8414f04142 /libs/gui/BLASTBufferQueue.cpp
parentbba52f423ae347459a18c40dbc93887fcf4bb855 (diff)
SF: Pass transformHint with releaseBuffer
We want the client to receive the tranformHint as early as possible, in particular prior to beginning rendering of a new frame. Since the releaseBuffer callback may cause the client to begin rendering we should include our most up to date transform hint here. Bug: 184842607 Test: Existing tests pass Change-Id: I61127d78f44b7332ad9ff3cade772fa6b475365f
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index a2868c6143..b9a293f4c3 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -302,23 +302,25 @@ void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence
// So we pass in a weak pointer to the BBQ and if it still alive, then we release the buffer.
// Otherwise, this is a no-op.
static void releaseBufferCallbackThunk(wp<BLASTBufferQueue> context, uint64_t graphicBufferId,
- const sp<Fence>& releaseFence) {
+ const sp<Fence>& releaseFence, uint32_t transformHint) {
sp<BLASTBufferQueue> blastBufferQueue = context.promote();
ALOGV("releaseBufferCallbackThunk graphicBufferId=%" PRIu64 " blastBufferQueue=%s",
graphicBufferId, blastBufferQueue ? "alive" : "dead");
if (blastBufferQueue) {
- blastBufferQueue->releaseBufferCallback(graphicBufferId, releaseFence);
+ blastBufferQueue->releaseBufferCallback(graphicBufferId, releaseFence, transformHint);
}
}
void BLASTBufferQueue::releaseBufferCallback(uint64_t graphicBufferId,
- const sp<Fence>& releaseFence) {
+ const sp<Fence>& releaseFence,
+ uint32_t transformHint) {
ATRACE_CALL();
std::unique_lock _lock{mMutex};
BQA_LOGV("releaseBufferCallback graphicBufferId=%" PRIu64, graphicBufferId);
if (mSurfaceControl != nullptr) {
- mTransformHint = mSurfaceControl->getTransformHint();
+ mTransformHint = transformHint;
+ mSurfaceControl->setTransformHint(transformHint);
mBufferItemConsumer->setTransformHint(mTransformHint);
}
@@ -412,7 +414,7 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) {
auto releaseBufferCallback =
std::bind(releaseBufferCallbackThunk, wp<BLASTBufferQueue>(this) /* callbackContext */,
- std::placeholders::_1, std::placeholders::_2);
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
t->setBuffer(mSurfaceControl, buffer, releaseBufferCallback);
t->setDataspace(mSurfaceControl, static_cast<ui::Dataspace>(bufferItem.mDataSpace));
t->setHdrMetadata(mSurfaceControl, bufferItem.mHdrMetadata);