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

Commit bf95ee2c authored by Michael Chock's avatar Michael Chock Committed by Steve Kondik
Browse files

Abort surface composition if hw surface is invalid

If an invalid display device is detected during surface composition
(e.g., a simulated secondary display is removed), abort the
composition.

Change-Id: Ia6afb2e287882d8ae0614eb25463d3f85b687adf
parent bc72ca0a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1629,7 +1629,11 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const

    const bool hasGlesComposition = hwc.hasGlesComposition(id) || (cur==end);
    if (hasGlesComposition) {
        DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext);
        if (!DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext)) {
            ALOGW("DisplayDevice::makeCurrent failed. Aborting surface composition for display %s",
                  hw->getDisplayName().string());
            return;
        }

        // set the frame buffer
        glMatrixMode(GL_MODELVIEW);