Commit 7c6286a9 authored by amp's avatar amp Committed by Commit Bot

Ensure that all CompositorView callbacks are complete when entering VR.

BUG=729164

Review-Url: https://codereview.chromium.org/2930113002
Cr-Commit-Position: refs/heads/master@{#478698}
parent ffb2d6a8
...@@ -325,12 +325,7 @@ public class CompositorView ...@@ -325,12 +325,7 @@ public class CompositorView
mCompositorSurfaceManager.doneWithUnownedSurface(); mCompositorSurfaceManager.doneWithUnownedSurface();
} }
List<Runnable> runnables = mDrawingFinishedCallbacks; runDrawFinishedCallbacks();
mDrawingFinishedCallbacks = null;
if (runnables == null) return;
for (Runnable r : runnables) {
r.run();
}
} }
/** /**
...@@ -394,6 +389,19 @@ public class CompositorView ...@@ -394,6 +389,19 @@ public class CompositorView
// the surface as well. Otherwise, the surface is kept, which can // the surface as well. Otherwise, the surface is kept, which can
// interfere with VR. // interfere with VR.
mCompositorSurfaceManager.setVisibility(visibility); mCompositorSurfaceManager.setVisibility(visibility);
// Clear out any outstanding callbacks that won't run if set to invisible.
if (visibility == View.INVISIBLE) {
runDrawFinishedCallbacks();
}
}
private void runDrawFinishedCallbacks() {
List<Runnable> runnables = mDrawingFinishedCallbacks;
mDrawingFinishedCallbacks = null;
if (runnables == null) return;
for (Runnable r : runnables) {
r.run();
}
} }
// Implemented in native // Implemented in native
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment