Merge "Update renderer surface if rotation is changed" into tm-qpr-dev am: 86c9d56dc2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18030727 Change-Id: I41153bae50930f301c6393c2c0633a5a850e10e5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -605,6 +605,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
int mSyncSeqId = 0;
|
int mSyncSeqId = 0;
|
||||||
int mLastSyncSeqId = 0;
|
int mLastSyncSeqId = 0;
|
||||||
|
|
||||||
|
private boolean mUpdateSurfaceNeeded;
|
||||||
boolean mFullRedrawNeeded;
|
boolean mFullRedrawNeeded;
|
||||||
boolean mNewSurfaceNeeded;
|
boolean mNewSurfaceNeeded;
|
||||||
boolean mForceNextWindowRelayout;
|
boolean mForceNextWindowRelayout;
|
||||||
@@ -2979,6 +2980,8 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
!mFirst, INVALID_DISPLAY /* same display */);
|
!mFirst, INVALID_DISPLAY /* same display */);
|
||||||
updatedConfiguration = true;
|
updatedConfiguration = true;
|
||||||
}
|
}
|
||||||
|
final boolean updateSurfaceNeeded = mUpdateSurfaceNeeded;
|
||||||
|
mUpdateSurfaceNeeded = false;
|
||||||
|
|
||||||
surfaceSizeChanged = false;
|
surfaceSizeChanged = false;
|
||||||
if (!mLastSurfaceSize.equals(mSurfaceSize)) {
|
if (!mLastSurfaceSize.equals(mSurfaceSize)) {
|
||||||
@@ -3057,7 +3060,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
if (isHardwareEnabled()) {
|
if (isHardwareEnabled()) {
|
||||||
mAttachInfo.mThreadedRenderer.destroy();
|
mAttachInfo.mThreadedRenderer.destroy();
|
||||||
}
|
}
|
||||||
} else if ((surfaceReplaced || surfaceSizeChanged)
|
} else if ((surfaceReplaced || surfaceSizeChanged || updateSurfaceNeeded)
|
||||||
&& mSurfaceHolder == null
|
&& mSurfaceHolder == null
|
||||||
&& mAttachInfo.mThreadedRenderer != null
|
&& mAttachInfo.mThreadedRenderer != null
|
||||||
&& mSurface.isValid()) {
|
&& mSurface.isValid()) {
|
||||||
@@ -5211,6 +5214,18 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
throw new IllegalArgumentException("No merged config provided.");
|
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();
|
Configuration globalConfig = mergedConfiguration.getGlobalConfiguration();
|
||||||
final Configuration overrideConfig = mergedConfiguration.getOverrideConfiguration();
|
final Configuration overrideConfig = mergedConfiguration.getOverrideConfiguration();
|
||||||
if (DEBUG_CONFIGURATION) Log.v(mTag,
|
if (DEBUG_CONFIGURATION) Log.v(mTag,
|
||||||
|
|||||||
Reference in New Issue
Block a user