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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1625473002: compositor-worker: blink->cc plumbing Base URL: https://chromium.googlesource.com/chromium/src.git@upstream-compositor-worker
Patch Set: Merge with landing of https://codereview.chromium.org/1599673002/ on master Created 4 years, 11 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 | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 3d134464edae5174c63c823f59a117e31be51dbf..fc2cb5e4cc23d3b1e743ff06a68cd4662b18f8e1 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -226,6 +226,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
shared_bitmap_manager_(shared_bitmap_manager),
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
task_graph_runner_(task_graph_runner),
+ mutator_(nullptr),
id_(id),
requires_high_res_to_draw_(false),
is_likely_to_require_a_draw_(false),
@@ -459,6 +460,8 @@ void LayerTreeHostImpl::AnimateInternal(bool active_tree) {
did_animate |= AnimateTopControls(monotonic_time);
if (active_tree) {
+ did_animate |= Mutate(monotonic_time);
+
// Animating stuff can change the root scroll offset, so inform the
// synchronous input handler.
UpdateRootLayerStateForSynchronousInputHandler();
@@ -470,6 +473,20 @@ void LayerTreeHostImpl::AnimateInternal(bool active_tree) {
}
}
+bool LayerTreeHostImpl::Mutate(base::TimeTicks monotonic_time) {
+ if (!mutator_)
+ return false;
+ TRACE_EVENT0("compositor-worker", "LayerTreeHostImpl::Mutate");
+ if (mutator_->Mutate(monotonic_time, active_tree_.get()))
+ client_->SetNeedsOneBeginImplFrameOnImplThread();
+ return true;
+}
+
+void LayerTreeHostImpl::SetNeedsMutate() {
+ TRACE_EVENT0("compositor-worker", "LayerTreeHostImpl::SetNeedsMutate");
+ client_->SetNeedsOneBeginImplFrameOnImplThread();
+}
+
bool LayerTreeHostImpl::PrepareTiles() {
if (!tile_priorities_dirty_)
return false;
@@ -2060,6 +2077,7 @@ void LayerTreeHostImpl::ActivateSyncTree() {
// If we commit to the active tree directly, this is already done during
// commit.
ActivateAnimations();
+ Mutate(CurrentBeginFrameArgs().frame_time);
} else {
active_tree_->ProcessUIResourceRequestQueue();
}
@@ -2310,6 +2328,14 @@ void LayerTreeHostImpl::PostFrameTimingEvents(
std::move(main_frame_events));
}
+void LayerTreeHostImpl::SetLayerTreeMutator(LayerTreeMutator* mutator) {
+ if (mutator == mutator_)
+ return;
+ TRACE_EVENT0("compositor-worker", "LayerTreeHostImpl::SetLayerTreeMutator");
+ mutator_ = mutator;
+ mutator_->SetClient(this);
+}
+
void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() {
ClearUIResources();
tile_manager_->FinishTasksAndCleanUp();
@@ -2981,6 +3007,9 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
UpdateRootLayerStateForSynchronousInputHandler();
}
+ // Update compositor worker mutations which may respond to scrolling.
+ Mutate(CurrentBeginFrameArgs().frame_time);
+
return scroll_result;
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698