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

Commit 4be18a35 authored by Igor Murashkin's avatar Igor Murashkin
Browse files

gui: Remove BufferQueue::MIN_UNDEQUEUED_BUFFERS

Change-Id: I7c0cc36046dbbdb9c0e85acfe5027293d1131275
parent 7d2d160c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ class BufferItemConsumer: public ConsumerBase

    typedef BufferQueue::BufferItem BufferItem;

    enum { MIN_UNDEQUEUED_BUFFERS = -1 };
    enum { INVALID_BUFFER_SLOT = BufferQueue::INVALID_BUFFER_SLOT };
    enum { NO_BUFFER_AVAILABLE = BufferQueue::NO_BUFFER_AVAILABLE };

@@ -54,7 +55,7 @@ class BufferItemConsumer: public ConsumerBase
    // controlledByApp tells whether this consumer is controlled by the
    // application.
    BufferItemConsumer(const sp<BufferQueue>& bq, uint32_t consumerUsage,
            int bufferCount = BufferQueue::MIN_UNDEQUEUED_BUFFERS,
            int bufferCount = MIN_UNDEQUEUED_BUFFERS,
            bool controlledByApp = false);

    virtual ~BufferItemConsumer();
+0 −1
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ class BufferQueue : public BnGraphicBufferProducer,
                    public BnGraphicBufferConsumer,
                    private IBinder::DeathRecipient {
public:
    enum { MIN_UNDEQUEUED_BUFFERS = 2 };
    // BufferQueue will keep track of at most this value of buffers.
    // Attempts at runtime to increase the number of buffers past this will fail.
    enum { NUM_BUFFER_SLOTS = 32 };
+7 −0
Original line number Diff line number Diff line
@@ -33,6 +33,13 @@ BufferItemConsumer::BufferItemConsumer(const sp<BufferQueue>& bq,
        uint32_t consumerUsage, int bufferCount, bool controlledByApp) :
    ConsumerBase(bq, controlledByApp)
{
    if (bufferCount == MIN_UNDEQUEUED_BUFFERS) {
        status_t res;
        res = bq->query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &bufferCount);
        LOG_ALWAYS_FATAL_IF(res != OK || bufferCount < 0,
                            "Failed to query min buffer count");
    }

    mConsumer->setConsumerUsageBits(consumerUsage);
    mConsumer->setMaxAcquiredBufferCount(bufferCount);
}