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

Commit 7f069d79 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "always pass the BufferQueue explicitely to consumers"

parents 7556c37b 8f938a53
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -199,8 +199,8 @@ bool GLHelper::getShaderProgram(const char* name, GLuint* outPgm) {
bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h,
        sp<GLConsumer>* glConsumer, EGLSurface* surface) {
    sp<BufferQueue> bq = new BufferQueue(true, mGraphicBufferAlloc);
    sp<GLConsumer> glc = new GLConsumer(name, true,
            GL_TEXTURE_EXTERNAL_OES, false, bq);
    sp<GLConsumer> glc = new GLConsumer(bq, name,
            GL_TEXTURE_EXTERNAL_OES, false);
    glc->setDefaultBufferSize(w, h);
    glc->setDefaultMaxBufferCount(3);
    glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER);
+3 −1
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@

namespace android {

class BufferQueue;

/**
 * BufferItemConsumer is a BufferQueue consumer endpoint that allows clients
 * access to the whole BufferItem entry from BufferQueue. Multiple buffers may
@@ -49,7 +51,7 @@ class BufferItemConsumer: public ConsumerBase
    // the consumer usage flags passed to the graphics allocator. The
    // bufferCount parameter specifies how many buffers can be locked for user
    // access at the same time.
    BufferItemConsumer(uint32_t consumerUsage,
    BufferItemConsumer(const sp<BufferQueue>& bq, uint32_t consumerUsage,
            int bufferCount = BufferQueue::MIN_UNDEQUEUED_BUFFERS,
            bool synchronousMode = false);

+4 −1
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@

namespace android {

class BufferQueue;

/**
 * CpuConsumer is a BufferQueue consumer endpoint that allows direct CPU
 * access to the underlying gralloc buffers provided by BufferQueue. Multiple
@@ -64,7 +66,8 @@ class CpuConsumer : public ConsumerBase

    // Create a new CPU consumer. The maxLockedBuffers parameter specifies
    // how many buffers can be locked for user access at the same time.
    CpuConsumer(uint32_t maxLockedBuffers, bool synchronousMode = true);
    CpuConsumer(const sp<BufferQueue>& bq,
            uint32_t maxLockedBuffers, bool synchronousMode = true);

    virtual ~CpuConsumer();

+3 −3
Original line number Diff line number Diff line
@@ -85,9 +85,9 @@ public:
    // purely to allow a GLConsumer to be transferred from one consumer
    // context to another. If such a transfer is not needed there is no
    // requirement that either of these methods be called.
    GLConsumer(GLuint tex, bool allowSynchronousMode = true,
            GLenum texTarget = GL_TEXTURE_EXTERNAL_OES, bool useFenceSync = true,
            const sp<BufferQueue> &bufferQueue = 0);
    GLConsumer(const sp<BufferQueue>& bq,
            GLuint tex, GLenum texTarget = GL_TEXTURE_EXTERNAL_OES,
            bool useFenceSync = true);

    // updateTexImage acquires the most recently queued buffer, and sets the
    // image contents of the target texture to it.
+3 −3
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@

namespace android {

BufferItemConsumer::BufferItemConsumer(uint32_t consumerUsage,
        int bufferCount, bool synchronousMode) :
    ConsumerBase(new BufferQueue(true) )
BufferItemConsumer::BufferItemConsumer(const sp<BufferQueue>& bq,
        uint32_t consumerUsage, int bufferCount, bool synchronousMode) :
    ConsumerBase(bq)
{
    mBufferQueue->setConsumerUsageBits(consumerUsage);
    mBufferQueue->setSynchronousMode(synchronousMode);
Loading