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 efc8eb0c6b73f02d9da331aa9c77003ffa798a2c..3e11d9204a903f55530ca7783702b22c08c2c0ad 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -15,6 +15,7 @@ |
#include <utility> |
#include "base/auto_reset.h" |
+#include "base/bind.h" |
#include "base/containers/small_map.h" |
#include "base/json/json_writer.h" |
#include "base/metrics/histogram.h" |
@@ -24,6 +25,8 @@ |
#include "base/trace_event/trace_event_argument.h" |
#include "cc/animation/animation_events.h" |
#include "cc/animation/animation_host.h" |
+#include "cc/animation/animation_id_provider.h" |
+#include "cc/animation/scroll_offset_animation_curve.h" |
#include "cc/animation/timing_function.h" |
#include "cc/base/histograms.h" |
#include "cc/base/math_util.h" |
@@ -236,7 +239,8 @@ LayerTreeHostImpl::LayerTreeHostImpl( |
id_(id), |
requires_high_res_to_draw_(false), |
is_likely_to_require_a_draw_(false), |
- frame_timing_tracker_(FrameTimingTracker::Create(this)) { |
+ frame_timing_tracker_(FrameTimingTracker::Create(this)), |
+ mutator_(nullptr) { |
animation_host_ = AnimationHost::Create(ThreadInstance::IMPL); |
animation_host_->SetMutatorHostClient(this); |
animation_host_->SetSupportsScrollAnimations(SupportsImplScrolling()); |
@@ -2251,6 +2255,12 @@ void LayerTreeHostImpl::PostFrameTimingEvents( |
std::move(main_frame_events)); |
} |
+void LayerTreeHostImpl::SetLayerTreeMutator(LayerTreeMutator* mutator) { |
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), |
+ "LayerTreeHostImpl::SetLayerTreeMutator"); |
+ mutator_ = mutator; |
+} |
+ |
void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() { |
ClearUIResources(); |
tile_manager_->FinishTasksAndCleanUp(); |
@@ -3283,6 +3293,17 @@ void LayerTreeHostImpl::PinchGestureEnd() { |
SetNeedsRedraw(); |
} |
+scoped_ptr<BeginFrameCallbackList> |
+LayerTreeHostImpl::ProcessLayerTreeMutations() { |
+ auto callbacks = make_scoped_ptr(new BeginFrameCallbackList()); |
+ if (mutator_) { |
+ const base::Closure& callback = mutator_->TakeMutations(); |
+ if (!callback.is_null()) |
+ callbacks->push_back(callback); |
+ } |
+ return callbacks; |
+} |
+ |
static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, |
LayerImpl* root_layer) { |
if (!root_layer) |