| 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 651fe18ef032309174721e5c9aa0084f21937a26..d491ec6d36a47e1e095c6b460bcf413a9c9612a9 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/memory/ptr_util.h"
|
| @@ -25,6 +26,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"
|
| @@ -237,7 +240,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());
|
| @@ -2254,6 +2258,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();
|
| @@ -3310,6 +3320,17 @@ void LayerTreeHostImpl::PinchGestureEnd() {
|
| SetNeedsRedraw();
|
| }
|
|
|
| +std::unique_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)
|
|
|