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

Commit a277ccba authored by Dan Stoza's avatar Dan Stoza
Browse files

SF: Add workaround to release screenshot buffer

Works around driver behavior to force the [E]GL driver to fully release
the screenshot buffer immediately after the screenshot is complete
rather than deferring until the next instance of client composition.

Bug: b/77935566
Test: Manual, inspect 'dumpsys SurfaceFlinger' after launching an app
      and then returning home (which causes a screenshot for overview)

Change-Id: I4f33d89f3ff3020707a9f556a1fcfe34bc9b7adb
parent 63a2d825
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -427,6 +427,12 @@ void RenderEngine::unbindNativeBufferAsFrameBuffer(RE::BindNativeBufferAsFramebu
    // back to main framebuffer
    unbindFramebuffer(bindHelper->mTexName, bindHelper->mFbName);
    eglDestroyImageKHR(mEGLDisplay, bindHelper->mImage);

    // Workaround for b/77935566 to force the EGL driver to release the
    // screenshot buffer
    setScissor(0, 0, 0, 0);
    clearWithColor(0.0, 0.0, 0.0, 0.0);
    disableScissor();
}

// ---------------------------------------------------------------------------