Merge "ViewRootImpl: Update opaque flag if SurfaceControl changes from relayout" into sc-dev
This commit is contained in:
@@ -2836,8 +2836,13 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final boolean surfaceControlChanged =
|
||||||
|
(relayoutResult & RELAYOUT_RES_SURFACE_CHANGED)
|
||||||
|
== RELAYOUT_RES_SURFACE_CHANGED;
|
||||||
|
|
||||||
if (mSurfaceControl.isValid()) {
|
if (mSurfaceControl.isValid()) {
|
||||||
updateOpacity(mWindowAttributes, dragResizing);
|
updateOpacity(mWindowAttributes, dragResizing,
|
||||||
|
surfaceControlChanged /*forceUpdate */);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DEBUG_LAYOUT) Log.v(mTag, "relayout: frame=" + frame.toShortString()
|
if (DEBUG_LAYOUT) Log.v(mTag, "relayout: frame=" + frame.toShortString()
|
||||||
@@ -2872,9 +2877,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
// RELAYOUT_RES_SURFACE_CHANGED since it should indicate that WMS created a new
|
// RELAYOUT_RES_SURFACE_CHANGED since it should indicate that WMS created a new
|
||||||
// SurfaceControl.
|
// SurfaceControl.
|
||||||
surfaceReplaced = (surfaceGenerationId != mSurface.getGenerationId()
|
surfaceReplaced = (surfaceGenerationId != mSurface.getGenerationId()
|
||||||
|| (relayoutResult & RELAYOUT_RES_SURFACE_CHANGED)
|
|| surfaceControlChanged) && mSurface.isValid();
|
||||||
== RELAYOUT_RES_SURFACE_CHANGED)
|
|
||||||
&& mSurface.isValid();
|
|
||||||
if (surfaceReplaced) {
|
if (surfaceReplaced) {
|
||||||
mSurfaceSequenceId++;
|
mSurfaceSequenceId++;
|
||||||
}
|
}
|
||||||
@@ -7824,7 +7827,8 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
return relayoutResult;
|
return relayoutResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateOpacity(WindowManager.LayoutParams params, boolean dragResizing) {
|
private void updateOpacity(WindowManager.LayoutParams params, boolean dragResizing,
|
||||||
|
boolean forceUpdate) {
|
||||||
boolean opaque = false;
|
boolean opaque = false;
|
||||||
|
|
||||||
if (!PixelFormat.formatHasAlpha(params.format)
|
if (!PixelFormat.formatHasAlpha(params.format)
|
||||||
@@ -7840,7 +7844,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
opaque = true;
|
opaque = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIsSurfaceOpaque == opaque) {
|
if (!forceUpdate && mIsSurfaceOpaque == opaque) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user