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

Commit 2adaf04f authored by Andy McFadden's avatar Andy McFadden
Browse files

Rename ISurfaceTexture and SurfaceTexture

The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
parent f7baee73
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ class BufferItemConsumer: public ConsumerBase
    status_t releaseBuffer(const BufferItem &item,
            const sp<Fence>& releaseFence = Fence::NO_FENCE);

    sp<ISurfaceTexture> getProducerInterface() const { return getBufferQueue(); }
    sp<IGraphicBufferProducer> getProducerInterface() const { return getBufferQueue(); }

};

+7 −7
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <EGL/eglext.h>

#include <gui/IGraphicBufferAlloc.h>
#include <gui/ISurfaceTexture.h>
#include <gui/IGraphicBufferProducer.h>

#include <ui/Fence.h>
#include <ui/GraphicBuffer.h>
@@ -33,7 +33,7 @@
namespace android {
// ----------------------------------------------------------------------------

class BufferQueue : public BnSurfaceTexture {
class BufferQueue : public BnGraphicBufferProducer {
public:
    enum { MIN_UNDEQUEUED_BUFFERS = 2 };
    enum { NUM_BUFFER_SLOTS = 32 };
@@ -149,7 +149,7 @@ public:
    virtual status_t setSynchronousMode(bool enabled);

    // connect attempts to connect a producer client API to the BufferQueue.
    // This must be called before any other ISurfaceTexture methods are called
    // This must be called before any other IGraphicBufferProducer methods are called
    // except for getAllocator.
    //
    // This method will fail if the connect was previously called on the
@@ -158,7 +158,7 @@ public:

    // disconnect attempts to disconnect a producer client API from the
    // BufferQueue. Calling this method will cause any subsequent calls to other
    // ISurfaceTexture methods to fail except for getAllocator and connect.
    // IGraphicBufferProducer methods to fail except for getAllocator and connect.
    // Successfully calling connect after this will allow the other methods to
    // succeed again.
    //
@@ -265,7 +265,7 @@ public:
    // producer is connected to the BufferQueue.
    status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers);

    // isSynchronousMode returns whether the SurfaceTexture is currently in
    // isSynchronousMode returns whether the BufferQueue is currently in
    // synchronous mode.
    bool isSynchronousMode() const;

@@ -506,10 +506,10 @@ private:
    Fifo mQueue;

    // mAbandoned indicates that the BufferQueue will no longer be used to
    // consume images buffers pushed to it using the ISurfaceTexture interface.
    // consume images buffers pushed to it using the IGraphicBufferProducer interface.
    // It is initialized to false, and set to true in the abandon method.  A
    // BufferQueue that has been abandoned will return the NO_INIT error from
    // all ISurfaceTexture methods capable of returning an error.
    // all IGraphicBufferProducer methods capable of returning an error.
    bool mAbandoned;

    // mName is a string used to identify the BufferQueue in log messages.
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public:
    // abandon frees all the buffers and puts the ConsumerBase into the
    // 'abandoned' state.  Once put in this state the ConsumerBase can never
    // leave it.  When in the 'abandoned' state, all methods of the
    // ISurfaceTexture interface will fail with the NO_INIT error.
    // IGraphicBufferProducer interface will fail with the NO_INIT error.
    //
    // Note that while calling this method causes all the buffers to be freed
    // from the perspective of the the ConsumerBase, if there are additional
@@ -186,7 +186,7 @@ protected:
    Slot mSlots[BufferQueue::NUM_BUFFER_SLOTS];

    // mAbandoned indicates that the BufferQueue will no longer be used to
    // consume images buffers pushed to it using the ISurfaceTexture
    // consume images buffers pushed to it using the IGraphicBufferProducer
    // interface. It is initialized to false, and set to true in the abandon
    // method.  A BufferQueue that has been abandoned will return the NO_INIT
    // error from all IConsumerBase methods capable of returning an error.
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ class CpuConsumer: public ConsumerBase
    // lockNextBuffer.
    status_t unlockBuffer(const LockedBuffer &nativeBuffer);

    sp<ISurfaceTexture> getProducerInterface() const { return getBufferQueue(); }
    sp<IGraphicBufferProducer> getProducerInterface() const { return getBufferQueue(); }

  private:
    // Maximum number of buffers that can be locked at a time
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ namespace android {


// The DummyConsumer does not keep a reference to BufferQueue
// unlike SurfaceTexture.  This prevents a circular reference from
// unlike GLConsumer.  This prevents a circular reference from
// forming without having to use a ProxyConsumerListener
class DummyConsumer : public BufferQueue::ConsumerListener {
public:
@@ -33,7 +33,7 @@ public:
protected:

    // Implementation of the BufferQueue::ConsumerListener interface.  These
    // calls are used to notify the SurfaceTexture of asynchronous events in the
    // calls are used to notify the GLConsumer of asynchronous events in the
    // BufferQueue.
    virtual void onFrameAvailable();
    virtual void onBuffersReleased();
Loading