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

Commit 89fd4f7f authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Frameworks/native: Wall Werror in surfaceflinger

Turn on -Wall -Werror in services/surfaceflinger. Fix warnings.

Change-Id: Ifef830300d9d4bc657d8f1257c02bfe8c2b4d9c5
parent fecc0bf4
Loading
Loading
Loading
Loading
+32 −26
Original line number Original line Diff line number Diff line
@@ -102,6 +102,8 @@ LOCAL_SHARED_LIBRARIES := \


LOCAL_MODULE:= libsurfaceflinger
LOCAL_MODULE:= libsurfaceflinger


LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)


###############################################################
###############################################################
@@ -131,6 +133,8 @@ ifdef TARGET_32_BIT_SURFACEFLINGER
LOCAL_32_BIT_ONLY := true
LOCAL_32_BIT_ONLY := true
endif
endif


LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code

include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)


###############################################################
###############################################################
@@ -149,5 +153,7 @@ LOCAL_SHARED_LIBRARIES := \


LOCAL_MODULE:= libsurfaceflinger_ddmconnection
LOCAL_MODULE:= libsurfaceflinger_ddmconnection


LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
endif # libnativehelper
endif # libnativehelper
+19 −13
Original line number Original line Diff line number Diff line
@@ -44,6 +44,18 @@
using namespace android;
using namespace android;
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------


#ifdef EGL_ANDROID_swap_rectangle
static constexpr bool kEGLAndroidSwapRectangle = true;
#else
static constexpr bool kEGLAndroidSwapRectangle = false;
#endif

#if !defined(EGL_EGLEXT_PROTOTYPES) || !defined(EGL_ANDROID_swap_rectangle)
// Dummy implementation in case it is missing.
inline void eglSetSwapRectangleANDROID (EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint) {
}
#endif

/*
/*
 * Initialize the display to the specified values.
 * Initialize the display to the specified values.
 *
 *
@@ -84,7 +96,6 @@ DisplayDevice::DisplayDevice(
     */
     */


    EGLSurface surface;
    EGLSurface surface;
    EGLint w, h;
    EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    if (config == EGL_NO_CONFIG) {
    if (config == EGL_NO_CONFIG) {
        config = RenderEngine::chooseEglConfig(display, format);
        config = RenderEngine::chooseEglConfig(display, format);
@@ -188,19 +199,14 @@ void DisplayDevice::flip(const Region& dirty) const
{
{
    mFlinger->getRenderEngine().checkErrors();
    mFlinger->getRenderEngine().checkErrors();


    EGLDisplay dpy = mDisplay;
    if (kEGLAndroidSwapRectangle) {
    EGLSurface surface = mSurface;

#ifdef EGL_ANDROID_swap_rectangle
        if (mFlags & SWAP_RECTANGLE) {
        if (mFlags & SWAP_RECTANGLE) {
            const Region newDirty(dirty.intersect(bounds()));
            const Region newDirty(dirty.intersect(bounds()));
            const Rect b(newDirty.getBounds());
            const Rect b(newDirty.getBounds());
        eglSetSwapRectangleANDROID(dpy, surface,
            eglSetSwapRectangleANDROID(mDisplay, mSurface,
                    b.left, b.top, b.width(), b.height());
                    b.left, b.top, b.width(), b.height());
        }
        }
#else
    }
    (void) dirty; // Eliminate unused parameter warning
#endif


    mPageFlipCount++;
    mPageFlipCount++;
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -68,7 +68,7 @@ FramebufferSurface::FramebufferSurface(HWComposer& hwc, int disp,
    mConsumer->setDefaultMaxBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS);
    mConsumer->setDefaultMaxBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS);
}
}


status_t FramebufferSurface::beginFrame(bool mustRecompose) {
status_t FramebufferSurface::beginFrame(bool /* mustRecompose */) {
    return NO_ERROR;
    return NO_ERROR;
}
}


+1 −0
Original line number Original line Diff line number Diff line
@@ -86,6 +86,7 @@ public:
    virtual status_t compositionComplete();
    virtual status_t compositionComplete();
    virtual status_t advanceFrame();
    virtual status_t advanceFrame();
    virtual void onFrameCommitted();
    virtual void onFrameCommitted();
    using BBinder::dump;
    virtual void dump(String8& result) const;
    virtual void dump(String8& result) const;
    virtual void resizeBuffers(const uint32_t w, const uint32_t h);
    virtual void resizeBuffers(const uint32_t w, const uint32_t h);


+0 −2
Original line number Original line Diff line number Diff line
@@ -63,7 +63,6 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client,
        mTextureName(-1U),
        mTextureName(-1U),
        mPremultipliedAlpha(true),
        mPremultipliedAlpha(true),
        mName("unnamed"),
        mName("unnamed"),
        mDebug(false),
        mFormat(PIXEL_FORMAT_NONE),
        mFormat(PIXEL_FORMAT_NONE),
        mTransactionFlags(0),
        mTransactionFlags(0),
        mQueuedFrames(0),
        mQueuedFrames(0),
@@ -646,7 +645,6 @@ void Layer::clearWithOpenGL(


void Layer::drawWithOpenGL(const sp<const DisplayDevice>& hw,
void Layer::drawWithOpenGL(const sp<const DisplayDevice>& hw,
        const Region& /* clip */, bool useIdentityTransform) const {
        const Region& /* clip */, bool useIdentityTransform) const {
    const uint32_t fbHeight = hw->getHeight();
    const State& s(getDrawingState());
    const State& s(getDrawingState());


    computeGeometry(hw, mMesh, useIdentityTransform);
    computeGeometry(hw, mMesh, useIdentityTransform);
Loading