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

Commit 3be1c6b6 authored by Dan Stoza's avatar Dan Stoza
Browse files

libgui: Enable -Weverything and -Werror

Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

Cherry pick of I034abec27bf4020d84af60d7acc1939c59986dd6 plus a
couple of minor changes to CpuConsumer.cpp to make it work with a
prior change:
    Uncomment CC_LOGV on line 46
    Change C-style cast to static_cast on line 71

Change-Id: Iaec610477ea0122317b0578fb74caf2383d4cf08
parent b6b81d6a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ class BufferItemConsumer: public ConsumerBase
    // setDefaultBufferFormat allows the BufferQueue to create
    // GraphicBuffers of a defaultFormat if no format is specified
    // in dequeueBuffer
    status_t setDefaultBufferFormat(uint32_t defaultFormat);
    status_t setDefaultBufferFormat(PixelFormat defaultFormat);
};

} // namespace android
+2 −3
Original line number Diff line number Diff line
@@ -125,9 +125,8 @@ public:

    // setDefaultBufferFormat allows the BufferQueue to create
    // GraphicBuffers of a defaultFormat if no format is specified
    // in dequeueBuffer.  Formats are enumerated in graphics.h; the
    // initial default is HAL_PIXEL_FORMAT_RGBA_8888.
    virtual status_t setDefaultBufferFormat(uint32_t defaultFormat);
    // in dequeueBuffer. The initial default is HAL_PIXEL_FORMAT_RGBA_8888.
    virtual status_t setDefaultBufferFormat(PixelFormat defaultFormat);

    // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer.
    // These are merged with the bits passed to dequeueBuffer.  The values are
+3 −3
Original line number Diff line number Diff line
@@ -199,15 +199,15 @@ private:

    // mDefaultBufferFormat can be set so it will override the buffer format
    // when it isn't specified in dequeueBuffer.
    uint32_t mDefaultBufferFormat;
    PixelFormat mDefaultBufferFormat;

    // mDefaultWidth holds the default width of allocated buffers. It is used
    // in dequeueBuffer if a width and height of 0 are specified.
    int mDefaultWidth;
    uint32_t mDefaultWidth;

    // mDefaultHeight holds the default height of allocated buffers. It is used
    // in dequeueBuffer if a width and height of 0 are specified.
    int mDefaultHeight;
    uint32_t mDefaultHeight;

    // mDefaultMaxBufferCount is the default limit on the number of buffers that
    // will be allocated at one time. This default limit is set by the consumer.
+5 −6
Original line number Diff line number Diff line
@@ -73,9 +73,7 @@ public:
    // updateTexImage() is called.  If width and height are both zero, the
    // default values specified by setDefaultBufferSize() are used instead.
    //
    // The pixel formats are enumerated in graphics.h, e.g.
    // HAL_PIXEL_FORMAT_RGBA_8888.  If the format is 0, the default format
    // will be used.
    // If the format is 0, the default format will be used.
    //
    // The usage argument specifies gralloc buffer usage flags.  The values
    // are enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER.  These
@@ -93,8 +91,9 @@ public:
    //
    // In both cases, the producer will need to call requestBuffer to get a
    // GraphicBuffer handle for the returned slot.
    virtual status_t dequeueBuffer(int *outSlot, sp<Fence>* outFence, bool async,
            uint32_t width, uint32_t height, uint32_t format, uint32_t usage);
    virtual status_t dequeueBuffer(int *outSlot, sp<Fence>* outFence,
            bool async, uint32_t width, uint32_t height, PixelFormat format,
            uint32_t usage);

    // See IGraphicBufferProducer::detachBuffer
    virtual status_t detachBuffer(int slot);
@@ -171,7 +170,7 @@ public:

    // See IGraphicBufferProducer::allocateBuffers
    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
            uint32_t format, uint32_t usage);
            PixelFormat format, uint32_t usage);

private:
    // This is required by the IBinder::DeathRecipient interface
+7 −8
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ 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(const sp<IGraphicBufferConsumer>& bq,
            uint32_t maxLockedBuffers, bool controlledByApp = false);
            size_t maxLockedBuffers, bool controlledByApp = false);

    virtual ~CpuConsumer();

@@ -86,10 +86,9 @@ class CpuConsumer : public ConsumerBase
    status_t setDefaultBufferSize(uint32_t width, uint32_t height);

    // setDefaultBufferFormat allows CpuConsumer's BufferQueue to create buffers
    // of a defaultFormat if no format is specified by producer. Formats are
    // enumerated in graphics.h; the initial default is
    // HAL_PIXEL_FORMAT_RGBA_8888.
    status_t setDefaultBufferFormat(uint32_t defaultFormat);
    // of a defaultFormat if no format is specified by producer.
    // The initial default is PIXEL_FORMAT_RGBA_8888.
    status_t setDefaultBufferFormat(PixelFormat defaultFormat);

    // Gets the next graphics buffer from the producer and locks it for CPU use,
    // filling out the passed-in locked buffer structure with the native pointer
@@ -110,9 +109,9 @@ class CpuConsumer : public ConsumerBase

  private:
    // Maximum number of buffers that can be locked at a time
    uint32_t mMaxLockedBuffers;
    size_t mMaxLockedBuffers;

    status_t releaseAcquiredBufferLocked(int lockedIdx);
    status_t releaseAcquiredBufferLocked(size_t lockedIdx);

    virtual void freeBufferLocked(int slotIndex);

@@ -133,7 +132,7 @@ class CpuConsumer : public ConsumerBase
    Vector<AcquiredBuffer> mAcquiredBuffers;

    // Count of currently locked buffers
    uint32_t mCurrentLockedBuffers;
    size_t mCurrentLockedBuffers;

};

Loading