Loading include/gui/BufferQueueConsumer.h +3 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,9 @@ public: virtual status_t getOccupancyHistory(bool forceFlush, std::vector<OccupancyTracker::Segment>* outHistory) override; // See IGraphicBufferConsumer::discardFreeBuffers virtual status_t discardFreeBuffers() override; // dump our state in a String virtual void dump(String8& result, const char* prefix) const; Loading include/gui/BufferQueueCore.h +5 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,11 @@ private: // all slots, even if they're currently dequeued, queued, or acquired. void freeAllBuffersLocked(); // discardFreeBuffersLocked releases all currently-free buffers held by the // queue, in order to reduce the memory consumption of the queue to the // minimum possible without discarding data. void discardFreeBuffersLocked(); // If delta is positive, makes more slots available. If negative, takes // away slots. Returns false if the request can't be met. bool adjustAvailableSlotsLocked(int delta); Loading include/gui/ConsumerBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ public: status_t getOccupancyHistory(bool forceFlush, std::vector<OccupancyTracker::Segment>* outHistory); // See IGraphicBufferConsumer::discardFreeBuffers status_t discardFreeBuffers(); private: ConsumerBase(const ConsumerBase&); void operator=(const ConsumerBase&); Loading include/gui/IGraphicBufferConsumer.h +5 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,11 @@ public: virtual status_t getOccupancyHistory(bool forceFlush, std::vector<OccupancyTracker::Segment>* outHistory) = 0; // discardFreeBuffers releases all currently-free buffers held by the queue, // in order to reduce the memory consumption of the queue to the minimum // possible without discarding data. virtual status_t discardFreeBuffers() = 0; // dump state into a string virtual void dump(String8& result, const char* prefix) const = 0; Loading libs/gui/BufferQueueConsumer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -725,6 +725,12 @@ status_t BufferQueueConsumer::getOccupancyHistory(bool forceFlush, return NO_ERROR; } status_t BufferQueueConsumer::discardFreeBuffers() { Mutex::Autolock lock(mCore->mMutex); mCore->discardFreeBuffersLocked(); return NO_ERROR; } void BufferQueueConsumer::dump(String8& result, const char* prefix) const { const IPCThreadState* ipc = IPCThreadState::self(); const pid_t pid = ipc->getCallingPid(); Loading Loading
include/gui/BufferQueueConsumer.h +3 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,9 @@ public: virtual status_t getOccupancyHistory(bool forceFlush, std::vector<OccupancyTracker::Segment>* outHistory) override; // See IGraphicBufferConsumer::discardFreeBuffers virtual status_t discardFreeBuffers() override; // dump our state in a String virtual void dump(String8& result, const char* prefix) const; Loading
include/gui/BufferQueueCore.h +5 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,11 @@ private: // all slots, even if they're currently dequeued, queued, or acquired. void freeAllBuffersLocked(); // discardFreeBuffersLocked releases all currently-free buffers held by the // queue, in order to reduce the memory consumption of the queue to the // minimum possible without discarding data. void discardFreeBuffersLocked(); // If delta is positive, makes more slots available. If negative, takes // away slots. Returns false if the request can't be met. bool adjustAvailableSlotsLocked(int delta); Loading
include/gui/ConsumerBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ public: status_t getOccupancyHistory(bool forceFlush, std::vector<OccupancyTracker::Segment>* outHistory); // See IGraphicBufferConsumer::discardFreeBuffers status_t discardFreeBuffers(); private: ConsumerBase(const ConsumerBase&); void operator=(const ConsumerBase&); Loading
include/gui/IGraphicBufferConsumer.h +5 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,11 @@ public: virtual status_t getOccupancyHistory(bool forceFlush, std::vector<OccupancyTracker::Segment>* outHistory) = 0; // discardFreeBuffers releases all currently-free buffers held by the queue, // in order to reduce the memory consumption of the queue to the minimum // possible without discarding data. virtual status_t discardFreeBuffers() = 0; // dump state into a string virtual void dump(String8& result, const char* prefix) const = 0; Loading
libs/gui/BufferQueueConsumer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -725,6 +725,12 @@ status_t BufferQueueConsumer::getOccupancyHistory(bool forceFlush, return NO_ERROR; } status_t BufferQueueConsumer::discardFreeBuffers() { Mutex::Autolock lock(mCore->mMutex); mCore->discardFreeBuffersLocked(); return NO_ERROR; } void BufferQueueConsumer::dump(String8& result, const char* prefix) const { const IPCThreadState* ipc = IPCThreadState::self(); const pid_t pid = ipc->getCallingPid(); Loading