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

Unified Diff: ui/compositor/compositor.h

Issue 996453002: Allow ui::Compositor to disable commits during tab-switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 5 years, 9 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 | « ui/compositor/BUILD.gn ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 47d4cd0d7e30866f980299191cd5994d386673b9..3a3e4cc829b1d675a2d3d64a7a139c69d94842a1 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -111,9 +111,10 @@ class COMPOSITOR_EXPORT ContextFactory {
// event. The typical use case is when waiting for a renderer to produce a frame
// at the right size. The caller keeps a reference on this object, and drops the
// reference once it desires to release the lock.
-// Note however that the lock is cancelled after a short timeout to ensure
+// By default, the lock will be cancelled after a short timeout to ensure
// responsiveness of the UI, so the compositor tree should be kept in a
-// "reasonable" state while the lock is held.
+// "reasonable" state while the lock is held. If the compositor sets
+// locks to not time out, then the lock will remain in effect until destroyed.
// Don't instantiate this class directly, use Compositor::GetCompositorLock.
class COMPOSITOR_EXPORT CompositorLock
: public base::RefCounted<CompositorLock>,
@@ -226,6 +227,13 @@ class COMPOSITOR_EXPORT Compositor
void RemoveAnimationObserver(CompositorAnimationObserver* observer);
bool HasAnimationObserver(const CompositorAnimationObserver* observer) const;
+ // Change the timeout behavior for all future locks that are created. Locks
+ // should time out if there is an expectation that the compositor will be
+ // responsive.
+ void SetLocksWillTimeOut(bool locks_will_time_out) {
+ locks_will_time_out_ = locks_will_time_out;
+ }
+
// Creates a compositor lock. Returns NULL if it is not possible to lock at
// this time (i.e. we're waiting to complete a previous unlock).
scoped_refptr<CompositorLock> GetCompositorLock();
@@ -319,8 +327,7 @@ class COMPOSITOR_EXPORT Compositor
int last_started_frame_;
int last_ended_frame_;
- bool disable_schedule_composite_;
-
+ bool locks_will_time_out_;
CompositorLock* compositor_lock_;
LayerAnimatorCollection layer_animator_collection_;
« no previous file with comments | « ui/compositor/BUILD.gn ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698