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

Commit 3131bdec authored by Chris Craik's avatar Chris Craik
Browse files

Reset transparent region when saving a surface

Fixes: 28432088

Ensure a transparent region on a saved surface is reset for future use,
since the surface should be like-new if used again.

This prevents an issue where the region - used to signal a portion of
content doesn't need to be composited - is persisted when a saved
surface is reused. The client assumes it's new and in default
state (composite everything), but the window is clipped when composited.

Change-Id: Icf2ec94c735679d715aded58de7eab12e9c43367
parent 08ca2e3a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1986,12 +1986,17 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        return mAppToken.shouldSaveSurface();
    }

    static final Region sEmptyRegion = new Region();

    void destroyOrSaveSurface() {
        mSurfaceSaved = shouldSaveSurface();
        if (mSurfaceSaved) {
            if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
                Slog.v(TAG, "Saving surface: " + this);
            }
            // Previous user of the surface may have set a transparent region signaling a portion
            // doesn't need to be composited, so reset to default empty state.
            mSession.setTransparentRegion(mClient, sEmptyRegion);

            mWinAnimator.hide("saved surface");
            mWinAnimator.mDrawState = WindowStateAnimator.NO_SURFACE;