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

Commit 59d12e90 authored by Pablo Ceballos's avatar Pablo Ceballos Committed by Android (Google) Code Review
Browse files

Merge "Rename single buffer mode to shared buffer mode" into nyc-dev

parents 9767bd89 3559fbf9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -121,10 +121,10 @@ class BufferItem : public Flattenable<BufferItem> {

    // Indicates that the consumer should acquire the next frame as soon as it
    // can and not wait for a frame to become available. This is only relevant
    // in single buffer mode.
    // in shared buffer mode.
    bool mAutoRefresh;

    // Indicates that this buffer was queued by the producer. When in single
    // Indicates that this buffer was queued by the producer. When in shared
    // buffer mode acquire() can return a BufferItem that wasn't in the queue.
    bool mQueuedBuffer;

+9 −9
Original line number Diff line number Diff line
@@ -291,21 +291,21 @@ private:
    // enqueue buffers without blocking.
    bool mAsyncMode;

    // mSingleBufferMode indicates whether or not single buffer mode is enabled.
    bool mSingleBufferMode;
    // mSharedBufferMode indicates whether or not shared buffer mode is enabled.
    bool mSharedBufferMode;

    // When single buffer mode is enabled, this indicates whether the consumer
    // When shared buffer mode is enabled, this indicates whether the consumer
    // should acquire buffers even if BufferQueue doesn't indicate that they are
    // available.
    bool mAutoRefresh;

    // When single buffer mode is enabled, this tracks which slot contains the
    // When shared buffer mode is enabled, this tracks which slot contains the
    // shared buffer.
    int mSingleBufferSlot;
    int mSharedBufferSlot;

    // Cached data about the shared buffer in single buffer mode
    struct SingleBufferCache {
        SingleBufferCache(Rect _crop, uint32_t _transform, int _scalingMode,
    // Cached data about the shared buffer in shared buffer mode
    struct SharedBufferCache {
        SharedBufferCache(Rect _crop, uint32_t _transform, int _scalingMode,
                android_dataspace _dataspace)
        : crop(_crop),
          transform(_transform),
@@ -317,7 +317,7 @@ private:
        uint32_t transform;
        uint32_t scalingMode;
        android_dataspace dataspace;
    } mSingleBufferCache;
    } mSharedBufferCache;

}; // class BufferQueueCore

+2 −2
Original line number Diff line number Diff line
@@ -173,8 +173,8 @@ public:
    // See IGraphicBufferProducer::getNextFrameNumber
    virtual uint64_t getNextFrameNumber() const override;

    // See IGraphicBufferProducer::setSingleBufferMode
    virtual status_t setSingleBufferMode(bool singleBufferMode) override;
    // See IGraphicBufferProducer::setSharedBufferMode
    virtual status_t setSharedBufferMode(bool sharedBufferMode) override;

    // See IGraphicBufferProducer::setAutoRefresh
    virtual status_t setAutoRefresh(bool autoRefresh) override;
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ struct BufferState {
    // transitions to FREE when releaseBuffer (or detachBuffer) is called. A
    // detached buffer can also enter the ACQUIRED state via attachBuffer.
    //
    // SHARED indicates that this buffer is being used in single-buffer
    // SHARED indicates that this buffer is being used in shared buffer
    // mode. It can be in any combination of the other states at the same time,
    // except for FREE (since that excludes being in any other state). It can
    // also be dequeued, queued, or acquired multiple times.
+4 −4
Original line number Diff line number Diff line
@@ -524,17 +524,17 @@ public:
    // Returns the number of the next frame which will be dequeued.
    virtual uint64_t getNextFrameNumber() const = 0;

    // Used to enable/disable single buffer mode.
    // Used to enable/disable shared buffer mode.
    //
    // When single buffer mode is enabled the first buffer that is queued or
    // When shared buffer mode is enabled the first buffer that is queued or
    // dequeued will be cached and returned to all subsequent calls to
    // dequeueBuffer and acquireBuffer. This allows the producer and consumer to
    // simultaneously access the same buffer.
    virtual status_t setSingleBufferMode(bool singleBufferMode) = 0;
    virtual status_t setSharedBufferMode(bool sharedBufferMode) = 0;

    // Used to enable/disable auto-refresh.
    //
    // Auto refresh has no effect outside of single buffer mode. In single
    // Auto refresh has no effect outside of shared buffer mode. In shared
    // buffer mode, when enabled, it indicates to the consumer that it should
    // attempt to acquire buffers even if it is not aware of any being
    // available.
Loading