From 01049c8321aab30cd431e2febeddd79242ae5a4f Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Tue, 11 Nov 2014 10:32:31 -0800 Subject: Enable clang for libui/libgui/surfaceflinger Enables clang and C++11 for libui/libgui/surfaceflinger, and eliminates all compile-time warnings. Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f (cherry picked from commit f10c46ef855b6410b20ebd8b1351d4d78d8eca8e) --- .../surfaceflinger/DisplayHardware/DisplaySurface.h | 2 +- .../DisplayHardware/FramebufferSurface.cpp | 18 +----------------- .../DisplayHardware/FramebufferSurface.h | 5 +---- .../DisplayHardware/VirtualDisplaySurface.cpp | 2 +- .../DisplayHardware/VirtualDisplaySurface.h | 3 +-- 5 files changed, 5 insertions(+), 25 deletions(-) (limited to 'services/surfaceflinger/DisplayHardware') diff --git a/services/surfaceflinger/DisplayHardware/DisplaySurface.h b/services/surfaceflinger/DisplayHardware/DisplaySurface.h index e60c4fb..2f743c1 100644 --- a/services/surfaceflinger/DisplayHardware/DisplaySurface.h +++ b/services/surfaceflinger/DisplayHardware/DisplaySurface.h @@ -70,7 +70,7 @@ public: // frame's buffer. virtual void onFrameCommitted() = 0; - virtual void dump(String8& result) const = 0; + virtual void dumpAsString(String8& result) const = 0; virtual void resizeBuffers(const uint32_t w, const uint32_t h) = 0; diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp index 342016e..f9d76d1 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp @@ -160,23 +160,7 @@ status_t FramebufferSurface::compositionComplete() return mHwc.fbCompositionComplete(); } -// Since DisplaySurface and ConsumerBase both have a method with this -// signature, results will vary based on the static pointer type the caller is -// using: -// void dump(FrameBufferSurface* fbs, String8& s) { -// // calls FramebufferSurface::dump() -// fbs->dump(s); -// -// // calls ConsumerBase::dump() since it is non-virtual -// static_cast(fbs)->dump(s); -// -// // calls FramebufferSurface::dump() since it is virtual -// static_cast(fbs)->dump(s); -// } -// To make sure that all of these end up doing the same thing, we just redirect -// to ConsumerBase::dump() here. It will take the internal lock, and then call -// virtual dumpLocked(), which is where the real work happens. -void FramebufferSurface::dump(String8& result) const { +void FramebufferSurface::dumpAsString(String8& result) const { ConsumerBase::dump(result); } diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h index d0bf22b..6ffc52d 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h @@ -44,10 +44,7 @@ public: virtual status_t compositionComplete(); virtual status_t advanceFrame(); virtual void onFrameCommitted(); - - // Implementation of DisplaySurface::dump(). Note that ConsumerBase also - // has a non-virtual dump() with the same signature. - virtual void dump(String8& result) const; + virtual void dumpAsString(String8& result) const; // Cannot resize a buffers in a FramebufferSurface. Only works with virtual // displays. diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index c3d45ee..e0f32e9 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -254,7 +254,7 @@ void VirtualDisplaySurface::onFrameCommitted() { resetPerFrameState(); } -void VirtualDisplaySurface::dump(String8& /* result */) const { +void VirtualDisplaySurface::dumpAsString(String8& /* result */) const { } void VirtualDisplaySurface::resizeBuffers(const uint32_t w, const uint32_t h) { diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h index 0fab7e2..2c14d6d 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h @@ -86,8 +86,7 @@ public: virtual status_t compositionComplete(); virtual status_t advanceFrame(); virtual void onFrameCommitted(); - using BBinder::dump; - virtual void dump(String8& result) const; + virtual void dumpAsString(String8& result) const; virtual void resizeBuffers(const uint32_t w, const uint32_t h); private: -- cgit v1.1