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

Commit 8cee3f9d authored by Valerie Hau's avatar Valerie Hau
Browse files

Pass transformHint to BLASTBufferQueue adapter

Bug: 141939598
Test: build, boot, BLASTBufferQueue_test
Change-Id: If07c10821abadfcad86b147b85dfba738cc7e490
parent 1acd6961
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ BLASTBufferQueue::BLASTBufferQueue(const sp<SurfaceControl>& surface, int width,
    mBufferItemConsumer->setBufferFreedListener(this);
    mBufferItemConsumer->setDefaultBufferSize(mWidth, mHeight);
    mBufferItemConsumer->setDefaultBufferFormat(PIXEL_FORMAT_RGBA_8888);
    mBufferItemConsumer->setTransformHint(mSurfaceControl->getTransformHint());
}

void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, int width, int height) {
@@ -41,6 +42,7 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, int width, int
    mWidth = width;
    mHeight = height;
    mBufferItemConsumer->setDefaultBufferSize(mWidth, mHeight);
    mBufferItemConsumer->setTransformHint(mSurfaceControl->getTransformHint());
}

static void transactionCallbackThunk(void* context, nsecs_t latchTime,
@@ -63,6 +65,7 @@ void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence
                                                   ? stats[0].previousReleaseFence
                                                   : Fence::NO_FENCE);
        mNextCallbackBufferItem = BufferItem();
        mBufferItemConsumer->setTransformHint(stats[0].transformHint);
    }
    mDequeueWaitCV.notify_all();
    decStrong((void*)transactionCallbackThunk);
+1 −1
Original line number Diff line number Diff line
@@ -1482,7 +1482,7 @@ sp<SurfaceControl> SurfaceComposerClient::createWithSurfaceParent(const String8&
        }
        ALOGE_IF(err, "SurfaceComposerClient::createWithSurfaceParent error %s", strerror(-err));
        if (err == NO_ERROR) {
            return new SurfaceControl(this, handle, gbp, true /* owned */);
            return new SurfaceControl(this, handle, gbp, true /* owned */, transformHint);
        }
    }
    return nullptr;
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <ui/DisplayInfo.h>
#include <ui/GraphicBuffer.h>
#include <ui/GraphicTypes.h>
#include <ui/Transform.h>

#include <gtest/gtest.h>

@@ -201,6 +202,7 @@ TEST_F(BLASTBufferQueueTest, onFrameAvailable_Apply) {
              igbProducer->connect(new DummyProducerListener, NATIVE_WINDOW_API_CPU, false,
                                   &qbOutput));
    ASSERT_EQ(NO_ERROR, igbProducer->setMaxDequeuedBufferCount(3));
    ASSERT_NE(ui::Transform::orientation_flags::ROT_INVALID, qbOutput.transformHint);

    int slot;
    sp<Fence> fence;
@@ -222,6 +224,7 @@ TEST_F(BLASTBufferQueueTest, onFrameAvailable_Apply) {
                                                   NATIVE_WINDOW_SCALING_MODE_FREEZE, 0,
                                                   Fence::NO_FENCE);
    igbProducer->queueBuffer(slot, input, &qbOutput);
    ASSERT_NE(ui::Transform::orientation_flags::ROT_INVALID, qbOutput.transformHint);

    adapter.waitForCallback();