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

Commit 0530f87f authored by Chia-I Wu's avatar Chia-I Wu
Browse files

libgui: tidy up CpuConsumer

Remove unnecessary freeBufferLocked and destructor.

Test: libgui_test
Change-Id: Ifc81f72a2f9c0deca97294f6b2977bd150430f7c
parent 924454f5
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -18,10 +18,11 @@
#define LOG_TAG "CpuConsumer"
//#define ATRACE_TAG ATRACE_TAG_GRAPHICS

#include <utils/Log.h>
#include <gui/BufferItem.h>
#include <gui/CpuConsumer.h>

#include <gui/BufferItem.h>
#include <utils/Log.h>

#define CC_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__)
//#define CC_LOGD(x, ...) ALOGD("[%s] " x, mName.string(), ##__VA_ARGS__)
//#define CC_LOGI(x, ...) ALOGI("[%s] " x, mName.string(), ##__VA_ARGS__)
@@ -43,12 +44,6 @@ CpuConsumer::CpuConsumer(const sp<IGraphicBufferConsumer>& bq,
    mConsumer->setMaxAcquiredBufferCount(static_cast<int32_t>(maxLockedBuffers));
}

CpuConsumer::~CpuConsumer() {
    // ConsumerBase destructor does all the work.
}



void CpuConsumer::setName(const String8& name) {
    Mutex::Autolock _l(mMutex);
    if (mAbandoned) {
@@ -242,8 +237,4 @@ status_t CpuConsumer::unlockBuffer(const LockedBuffer &nativeBuffer) {
    return OK;
}

void CpuConsumer::freeBufferLocked(int slotIndex) {
    ConsumerBase::freeBufferLocked(slotIndex);
}

} // namespace android
+0 −5
Original line number Diff line number Diff line
@@ -94,8 +94,6 @@ class CpuConsumer : public ConsumerBase
    CpuConsumer(const sp<IGraphicBufferConsumer>& bq,
            size_t maxLockedBuffers, bool controlledByApp = false);

    virtual ~CpuConsumer();

    // set the name of the CpuConsumer that will be used to identify it in
    // log messages.
    void setName(const String8& name);
@@ -121,8 +119,6 @@ class CpuConsumer : public ConsumerBase
    // Maximum number of buffers that can be locked at a time
    const size_t mMaxLockedBuffers;

    virtual void freeBufferLocked(int slotIndex);

    // Tracking for buffers acquired by the user
    struct AcquiredBuffer {
        static constexpr uintptr_t kUnusedId = 0;
@@ -154,7 +150,6 @@ class CpuConsumer : public ConsumerBase

    // Count of currently locked buffers
    size_t mCurrentLockedBuffers;

};

} // namespace android