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

Commit a0827903 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [13386636, 13386930, 13387079] into sc-release

Change-Id: I51a20434c817871d43c9f9b09a0dd98b8f9b8f76
parents 2250fc55 0b7fcbdd
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -117,13 +117,11 @@ void BLASTBufferItemConsumer::getConnectionEvents(uint64_t frameNumber, bool* ne
}

BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp<SurfaceControl>& surface,
                                   int width, int height, int32_t format,
                                   bool enableTripleBuffering)
                                   int width, int height, bool enableTripleBuffering)
      : mName(name),
        mSurfaceControl(surface),
        mSize(width, height),
        mRequestedSize(mSize),
        mFormat(format),
        mNextTransaction(nullptr) {
    createBufferQueue(&mProducer, &mConsumer);
    // since the adapter is in the client process, set dequeue timeout
@@ -142,7 +140,7 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp<SurfaceCont
    mBufferItemConsumer->setFrameAvailableListener(this);
    mBufferItemConsumer->setBufferFreedListener(this);
    mBufferItemConsumer->setDefaultBufferSize(mSize.width, mSize.height);
    mBufferItemConsumer->setDefaultBufferFormat(format);
    mBufferItemConsumer->setDefaultBufferFormat(PIXEL_FORMAT_RGBA_8888);

    mTransformHint = mSurfaceControl->getTransformHint();
    mBufferItemConsumer->setTransformHint(mTransformHint);
@@ -166,16 +164,10 @@ BLASTBufferQueue::~BLASTBufferQueue() {
    t.apply();
}

void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height,
                              int32_t format) {
void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height) {
    std::unique_lock _lock{mMutex};
    mSurfaceControl = surface;

    if (mFormat != format) {
        mFormat = format;
        mBufferItemConsumer->setDefaultBufferFormat(format);
    }

    ui::Size newSize(width, height);
    if (mRequestedSize != newSize) {
        mRequestedSize.set(newSize);
+2 −3
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ class BLASTBufferQueue
{
public:
    BLASTBufferQueue(const std::string& name, const sp<SurfaceControl>& surface, int width,
                     int height, int32_t format, bool enableTripleBuffering = true);
                     int height, bool enableTripleBuffering = true);

    sp<IGraphicBufferProducer> getIGraphicBufferProducer() const {
        return mProducer;
@@ -88,7 +88,7 @@ public:
    void setTransactionCompleteCallback(uint64_t frameNumber,
                                        std::function<void(int64_t)>&& transactionCompleteCallback);

    void update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height, int32_t format);
    void update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height);
    void flushShadowQueue() { mFlushShadowQueue = true; }

    status_t setFrameRate(float frameRate, int8_t compatibility, bool shouldBeSeamless);
@@ -136,7 +136,6 @@ private:

    ui::Size mSize GUARDED_BY(mMutex);
    ui::Size mRequestedSize GUARDED_BY(mMutex);
    int32_t mFormat GUARDED_BY(mMutex);

    uint32_t mTransformHint GUARDED_BY(mMutex);

+2 −3
Original line number Diff line number Diff line
@@ -45,12 +45,11 @@ using android::hardware::graphics::common::V1_2::BufferUsage;
class BLASTBufferQueueHelper {
public:
    BLASTBufferQueueHelper(const sp<SurfaceControl>& sc, int width, int height) {
        mBlastBufferQueueAdapter = new BLASTBufferQueue("TestBLASTBufferQueue", sc, width, height,
                                                        PIXEL_FORMAT_RGBA_8888);
        mBlastBufferQueueAdapter = new BLASTBufferQueue("TestBLASTBufferQueue", sc, width, height);
    }

    void update(const sp<SurfaceControl>& sc, int width, int height) {
        mBlastBufferQueueAdapter->update(sc, width, height, PIXEL_FORMAT_RGBA_8888);
        mBlastBufferQueueAdapter->update(sc, width, height);
    }

    void setNextTransaction(Transaction* next) {