Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81ec607a authored by Valerie Hau's avatar Valerie Hau
Browse files

Set frame based on surface control width/height

Buffers may be transformed due to transformHint and/or
transformToDisplayInverse.  So the buffer we get is not
a good indicator of our frame w/out additional calculation.
Use the surface control's width and height to determine frame

Bug: 147388905
Test: build, boot, libgui_test
Change-Id: Ia2c7d6d5db8a0f9479a6950eab06ac40eef5a044
parent b2a6955c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence
        if (stats.size() > 0) {
            mPendingReleaseItem.releaseFence = stats[0].previousReleaseFence;
            mTransformHint = stats[0].transformHint;
            mBufferItemConsumer->setTransformHint(mTransformHint);
        } else {
            ALOGE("Warning: no SurfaceControlStats returned in BLASTBufferQueue callback");
            mPendingReleaseItem.releaseFence = nullptr;
@@ -151,7 +152,7 @@ void BLASTBufferQueue::processNextBufferLocked() {
                       bufferItem.mFence ? new Fence(bufferItem.mFence->dup()) : Fence::NO_FENCE);
    t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this));

    t->setFrame(mSurfaceControl, {0, 0, (int32_t)buffer->getWidth(), (int32_t)buffer->getHeight()});
    t->setFrame(mSurfaceControl, {0, 0, mWidth, mHeight});
    t->setCrop(mSurfaceControl, computeCrop(bufferItem));
    t->setTransform(mSurfaceControl, bufferItem.mTransform);
    t->setTransformToDisplayInverse(mSurfaceControl, bufferItem.mTransformToDisplayInverse);