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

Commit a1dee14c authored by Dan Stoza's avatar Dan Stoza Committed by android-build-merger
Browse files

Merge "libgui: Add getLastQueuedBuffer to BufferQueue" into nyc-dev

am: 4908a010

* commit '4908a010':
  libgui: Add getLastQueuedBuffer to BufferQueue

Change-Id: I0ec082bd8d8413043dd0f4b6a9ec2c84581a585b
parents d9718276 4908a010
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -319,6 +319,9 @@ private:
        android_dataspace dataspace;
    } mSharedBufferCache;

    // The slot of the last queued buffer
    int mLastQueuedSlot;

}; // class BufferQueueCore

} // namespace android
+4 −0
Original line number Diff line number Diff line
@@ -182,6 +182,10 @@ public:
    // See IGraphicBufferProducer::setDequeueTimeout
    virtual status_t setDequeueTimeout(nsecs_t timeout) override;

    // See IGraphicBufferProducer::getLastQueuedBuffer
    virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer,
            sp<Fence>* outFence) override;

private:
    // This is required by the IBinder::DeathRecipient interface
    virtual void binderDied(const wp<IBinder>& who);
+9 −0
Original line number Diff line number Diff line
@@ -557,6 +557,15 @@ public:
    //               happen because of trying to allocate/deallocate the async
    //               buffer.
    virtual status_t setDequeueTimeout(nsecs_t timeout) = 0;

    // Returns the last queued buffer along with a fence which must signal
    // before the contents of the buffer are read. If there are no buffers in
    // the queue, outBuffer will be populated with nullptr and outFence will be
    // populated with Fence::NO_FENCE
    //
    // Returns NO_ERROR or the status of the Binder transaction
    virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer,
            sp<Fence>* outFence) = 0;
};

// ----------------------------------------------------------------------------
+4 −0
Original line number Diff line number Diff line
@@ -129,6 +129,10 @@ public:
     */
    bool waitForNextFrame(uint64_t lastFrame, nsecs_t timeout);

    // See IGraphicBufferProducer::getLastQueuedBuffer
    status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer,
            sp<Fence>* outFence);

protected:
    virtual ~Surface();

+4 −0
Original line number Diff line number Diff line
@@ -200,6 +200,10 @@ void BufferQueueCore::clearBufferSlotLocked(int slot) {
    }
    mSlots[slot].mFence = Fence::NO_FENCE;
    mSlots[slot].mEglDisplay = EGL_NO_DISPLAY;

    if (mLastQueuedSlot == slot) {
        mLastQueuedSlot = INVALID_BUFFER_SLOT;
    }
}

void BufferQueueCore::freeAllBuffersLocked() {
Loading