Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3370)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java

Issue 2930113002: Ensure that all CompositorView callbacks are complete when entering VR. (Closed)
Patch Set: rename method Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java
index 285b4e70a1b16f791e167b49b9e1fe4acdd36690..ffc766310ee7b407a1796b2caea47b398d0930a2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java
@@ -325,12 +325,7 @@ public class CompositorView
mCompositorSurfaceManager.doneWithUnownedSurface();
}
- List<Runnable> runnables = mDrawingFinishedCallbacks;
- mDrawingFinishedCallbacks = null;
- if (runnables == null) return;
- for (Runnable r : runnables) {
- r.run();
- }
+ runDrawFinishedCallbacks();
}
/**
@@ -394,6 +389,19 @@ public class CompositorView
// the surface as well. Otherwise, the surface is kept, which can
// interfere with VR.
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698