Merge "SurfaceView: Ensure position update listener sets at least once" into tm-dev am: f84837ffe8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17768445 Change-Id: Ia18c6ec246e6e12b4b3c1c6b49605a2625ae9900 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1274,6 +1274,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
private class SurfaceViewPositionUpdateListener implements RenderNode.PositionUpdateListener {
|
private class SurfaceViewPositionUpdateListener implements RenderNode.PositionUpdateListener {
|
||||||
private final int mRtSurfaceWidth;
|
private final int mRtSurfaceWidth;
|
||||||
private final int mRtSurfaceHeight;
|
private final int mRtSurfaceHeight;
|
||||||
|
private boolean mRtFirst = true;
|
||||||
private final SurfaceControl.Transaction mPositionChangedTransaction =
|
private final SurfaceControl.Transaction mPositionChangedTransaction =
|
||||||
new SurfaceControl.Transaction();
|
new SurfaceControl.Transaction();
|
||||||
|
|
||||||
@@ -1284,14 +1285,15 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void positionChanged(long frameNumber, int left, int top, int right, int bottom) {
|
public void positionChanged(long frameNumber, int left, int top, int right, int bottom) {
|
||||||
if (mRTLastReportedPosition.left == left
|
if (!mRtFirst && (mRTLastReportedPosition.left == left
|
||||||
&& mRTLastReportedPosition.top == top
|
&& mRTLastReportedPosition.top == top
|
||||||
&& mRTLastReportedPosition.right == right
|
&& mRTLastReportedPosition.right == right
|
||||||
&& mRTLastReportedPosition.bottom == bottom
|
&& mRTLastReportedPosition.bottom == bottom
|
||||||
&& mRTLastReportedSurfaceSize.x == mRtSurfaceWidth
|
&& mRTLastReportedSurfaceSize.x == mRtSurfaceWidth
|
||||||
&& mRTLastReportedSurfaceSize.y == mRtSurfaceHeight) {
|
&& mRTLastReportedSurfaceSize.y == mRtSurfaceHeight)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mRtFirst = false;
|
||||||
try {
|
try {
|
||||||
if (DEBUG_POSITION) {
|
if (DEBUG_POSITION) {
|
||||||
Log.d(TAG, String.format(
|
Log.d(TAG, String.format(
|
||||||
|
|||||||
Reference in New Issue
Block a user