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
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
index e0f32e9..ef10fa7 100644
--- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
+++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
@@ -284,7 +284,7 @@
}
status_t VirtualDisplaySurface::dequeueBuffer(Source source,
- uint32_t format, uint32_t usage, int* sslot, sp<Fence>* fence) {
+ PixelFormat format, uint32_t usage, int* sslot, sp<Fence>* fence) {
LOG_FATAL_IF(mDisplayId < 0, "mDisplayId=%d but should not be < 0.", mDisplayId);
// Don't let a slow consumer block us
bool async = (source == SOURCE_SINK);
@@ -329,7 +329,7 @@
}
status_t VirtualDisplaySurface::dequeueBuffer(int* pslot, sp<Fence>* fence, bool async,
- uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
+ uint32_t w, uint32_t h, PixelFormat format, uint32_t usage) {
if (mDisplayId < 0)
return mSource[SOURCE_SINK]->dequeueBuffer(pslot, fence, async, w, h, format, usage);
@@ -364,7 +364,7 @@
usage |= GRALLOC_USAGE_HW_COMPOSER;
const sp<GraphicBuffer>& buf = mProducerBuffers[mOutputProducerSlot];
if ((usage & ~buf->getUsage()) != 0 ||
- (format != 0 && format != (uint32_t)buf->getPixelFormat()) ||
+ (format != 0 && format != buf->getPixelFormat()) ||
(w != 0 && w != mSinkBufferWidth) ||
(h != 0 && h != mSinkBufferHeight)) {
VDS_LOGV("dequeueBuffer: dequeueing new output buffer: "
@@ -517,7 +517,7 @@
}
void VirtualDisplaySurface::allocateBuffers(bool /* async */,
- uint32_t /* width */, uint32_t /* height */, uint32_t /* format */,
+ uint32_t /* width */, uint32_t /* height */, PixelFormat /* format */,
uint32_t /* usage */) {
// TODO: Should we actually allocate buffers for a virtual display?
}
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
index 2c14d6d..0a3f4a1 100644
--- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
+++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
@@ -100,7 +100,7 @@
virtual status_t requestBuffer(int pslot, sp<GraphicBuffer>* outBuf);
virtual status_t setBufferCount(int bufferCount);
virtual status_t dequeueBuffer(int* pslot, sp<Fence>* fence, bool async,
- uint32_t w, uint32_t h, uint32_t format, uint32_t usage);
+ uint32_t w, uint32_t h, PixelFormat format, uint32_t usage);
virtual status_t detachBuffer(int slot);
virtual status_t detachNextBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence);
@@ -114,13 +114,13 @@
virtual status_t disconnect(int api);
virtual status_t setSidebandStream(const sp<NativeHandle>& stream);
virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
- uint32_t format, uint32_t usage);
+ PixelFormat format, uint32_t usage);
//
// Utility methods
//
static Source fbSourceForCompositionType(CompositionType type);
- status_t dequeueBuffer(Source source, uint32_t format, uint32_t usage,
+ status_t dequeueBuffer(Source source, PixelFormat format, uint32_t usage,
int* sslot, sp<Fence>* fence);
void updateQueueBufferOutput(const QueueBufferOutput& qbo);
void resetPerFrameState();
diff --git a/services/surfaceflinger/MonitoredProducer.cpp b/services/surfaceflinger/MonitoredProducer.cpp
index 37a044e..e4e7d42 100644
--- a/services/surfaceflinger/MonitoredProducer.cpp
+++ b/services/surfaceflinger/MonitoredProducer.cpp
@@ -61,7 +61,7 @@
}
status_t MonitoredProducer::dequeueBuffer(int* slot, sp<Fence>* fence,
- bool async, uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
+ bool async, uint32_t w, uint32_t h, PixelFormat format, uint32_t usage) {
return mProducer->dequeueBuffer(slot, fence, async, w, h, format, usage);
}
@@ -106,7 +106,7 @@
}
void MonitoredProducer::allocateBuffers(bool async, uint32_t width,
- uint32_t height, uint32_t format, uint32_t usage) {
+ uint32_t height, PixelFormat format, uint32_t usage) {
mProducer->allocateBuffers(async, width, height, format, usage);
}
diff --git a/services/surfaceflinger/MonitoredProducer.h b/services/surfaceflinger/MonitoredProducer.h
index f6ccc51..aec3e85 100644
--- a/services/surfaceflinger/MonitoredProducer.h
+++ b/services/surfaceflinger/MonitoredProducer.h
@@ -37,7 +37,7 @@
virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf);
virtual status_t setBufferCount(int bufferCount);
virtual status_t dequeueBuffer(int* slot, sp<Fence>* fence, bool async,
- uint32_t w, uint32_t h, uint32_t format, uint32_t usage);
+ uint32_t w, uint32_t h, PixelFormat format, uint32_t usage);
virtual status_t detachBuffer(int slot);
virtual status_t detachNextBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence);
@@ -52,7 +52,7 @@
virtual status_t disconnect(int api);
virtual status_t setSidebandStream(const sp<NativeHandle>& stream);
virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
- uint32_t format, uint32_t usage);
+ PixelFormat format, uint32_t usage);
virtual IBinder* onAsBinder();
private: