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

Unified Diff: cc/trees/thread_proxy.cc

Issue 1425973003: cc: Don't attempt main thread synchronization if it is slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase; change names; use enum class Created 5 years, 1 month 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 | « cc/test/scheduler_test_common.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 0369508d21a6d8afea092740add656995c3e6c63..6ce4d47c38978dabf5f05407565c9bbf5561ff70 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -1069,11 +1069,11 @@ void ThreadProxy::RenewTreePriority() {
impl().smoothness_priority_expiration_notifier.Schedule();
// We use the same priority for both trees by default.
- TreePriority priority = SAME_PRIORITY_FOR_BOTH_TREES;
+ TreePriority tree_priority = SAME_PRIORITY_FOR_BOTH_TREES;
// Smoothness takes priority if we have an expiration for it scheduled.
if (impl().smoothness_priority_expiration_notifier.HasPendingNotification())
- priority = SMOOTHNESS_TAKES_PRIORITY;
+ tree_priority = SMOOTHNESS_TAKES_PRIORITY;
// New content always takes priority when there is an invalid viewport size or
// ui resources have been evicted.
@@ -1084,18 +1084,21 @@ void ThreadProxy::RenewTreePriority() {
// tree might be freed. We need to set RequiresHighResToDraw to ensure that
// high res tiles will be required to activate pending tree.
impl().layer_tree_host_impl->SetRequiresHighResToDraw();
- priority = NEW_CONTENT_TAKES_PRIORITY;
+ tree_priority = NEW_CONTENT_TAKES_PRIORITY;
}
- impl().layer_tree_host_impl->SetTreePriority(priority);
+ impl().layer_tree_host_impl->SetTreePriority(tree_priority);
// Only put the scheduler in impl latency prioritization mode if we don't
// have a scroll listener. This gives the scroll listener a better chance of
// handling scroll updates within the same frame. The tree itself is still
// kept in prefer smoothness mode to allow checkerboarding.
- impl().scheduler->SetImplLatencyTakesPriority(
- priority == SMOOTHNESS_TAKES_PRIORITY &&
- !impl().layer_tree_host_impl->scroll_affects_scroll_handler());
+ ScrollHandlerState scroll_handler_state =
+ impl().layer_tree_host_impl->scroll_affects_scroll_handler()
+ ? ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER
+ : ScrollHandlerState::SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
+ impl().scheduler->SetTreePrioritiesAndScrollState(tree_priority,
+ scroll_handler_state);
// Notify the the client of this compositor via the output surface.
// TODO(epenner): Route this to compositor-thread instead of output-surface
@@ -1103,7 +1106,8 @@ void ThreadProxy::RenewTreePriority() {
if (impl().layer_tree_host_impl->output_surface()) {
impl()
.layer_tree_host_impl->output_surface()
- ->UpdateSmoothnessTakesPriority(priority == SMOOTHNESS_TAKES_PRIORITY);
+ ->UpdateSmoothnessTakesPriority(tree_priority ==
+ SMOOTHNESS_TAKES_PRIORITY);
}
}
« no previous file with comments | « cc/test/scheduler_test_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698