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

Commit efbb57e8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update renderer surface if rotation is changed" into tm-qpr-dev am:...

Merge "Update renderer surface if rotation is changed" into tm-qpr-dev am: 86c9d56d am: 62575ecd

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18030727



Change-Id: Ib30e01fd9adf3f354853a853f8b5d0387939af8d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6a6bcc48 62575ecd
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -604,6 +604,7 @@ public final class ViewRootImpl implements ViewParent,
    int mSyncSeqId = 0;
    int mLastSyncSeqId = 0;

    private boolean mUpdateSurfaceNeeded;
    boolean mFullRedrawNeeded;
    boolean mNewSurfaceNeeded;
    boolean mForceNextWindowRelayout;
@@ -3001,6 +3002,8 @@ public final class ViewRootImpl implements ViewParent,
                            !mFirst, INVALID_DISPLAY /* same display */);
                    updatedConfiguration = true;
                }
                final boolean updateSurfaceNeeded = mUpdateSurfaceNeeded;
                mUpdateSurfaceNeeded = false;

                surfaceSizeChanged = false;
                if (!mLastSurfaceSize.equals(mSurfaceSize)) {
@@ -3079,7 +3082,7 @@ public final class ViewRootImpl implements ViewParent,
                    if (isHardwareEnabled()) {
                        mAttachInfo.mThreadedRenderer.destroy();
                    }
                } else if ((surfaceReplaced || surfaceSizeChanged)
                } else if ((surfaceReplaced || surfaceSizeChanged || updateSurfaceNeeded)
                        && mSurfaceHolder == null
                        && mAttachInfo.mThreadedRenderer != null
                        && mSurface.isValid()) {
@@ -5221,6 +5224,18 @@ public final class ViewRootImpl implements ViewParent,
            throw new IllegalArgumentException("No merged config provided.");
        }

        final int lastRotation = mLastReportedMergedConfiguration.getMergedConfiguration()
                .windowConfiguration.getRotation();
        final int newRotation = mergedConfiguration.getMergedConfiguration()
                .windowConfiguration.getRotation();
        if (lastRotation != newRotation) {
            // Trigger ThreadedRenderer#updateSurface() if the surface control doesn't change.
            // Because even if the actual surface size is not changed, e.g. flip 180 degrees,
            // the buffers may still have content in previous rotation. And the next draw may
            // not update all regions, that causes some afterimages to flicker.
            mUpdateSurfaceNeeded = true;
        }

        Configuration globalConfig = mergedConfiguration.getGlobalConfiguration();
        final Configuration overrideConfig = mergedConfiguration.getOverrideConfiguration();
        if (DEBUG_CONFIGURATION) Log.v(mTag,