| Index: ui/compositor/compositor.cc
|
| diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
|
| index b057366d8561d0160dcc7e544406f316a363a514..6b42070ae10ad0ed8c3903f580bbf1d28850e6ff 100644
|
| --- a/ui/compositor/compositor.cc
|
| +++ b/ui/compositor/compositor.cc
|
| @@ -14,6 +14,9 @@
|
| #include "base/strings/string_util.h"
|
| #include "base/sys_info.h"
|
| #include "base/trace_event/trace_event.h"
|
| +#include "cc/animation/animation_host.h"
|
| +#include "cc/animation/animation_id_provider.h"
|
| +#include "cc/animation/animation_timeline.h"
|
| #include "cc/base/switches.h"
|
| #include "cc/input/input_handler.h"
|
| #include "cc/layers/layer.h"
|
| @@ -191,6 +194,12 @@ Compositor::Compositor(ui::ContextFactory* context_factory,
|
| host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms);
|
| UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor",
|
| base::TimeTicks::Now() - before_create);
|
| +
|
| + if (settings.use_compositor_animation_timelines) {
|
| + animation_timeline_ = cc::AnimationTimeline::Create(
|
| + cc::AnimationIdProvider::NextTimelineId());
|
| + host_->animation_host()->AddAnimationTimeline(animation_timeline_.get());
|
| + }
|
| host_->SetRootLayer(root_web_layer_);
|
| host_->set_surface_id_namespace(surface_id_allocator_->id_namespace());
|
| host_->SetVisible(true);
|
| @@ -211,6 +220,9 @@ Compositor::~Compositor() {
|
| if (root_layer_)
|
| root_layer_->ResetCompositor();
|
|
|
| + if (animation_timeline_)
|
| + host_->animation_host()->RemoveAnimationTimeline(animation_timeline_.get());
|
| +
|
| // Stop all outstanding draws before telling the ContextFactory to tear
|
| // down any contexts that the |host_| may rely upon.
|
| host_.reset();
|
| @@ -239,6 +251,10 @@ void Compositor::SetRootLayer(Layer* root_layer) {
|
| root_layer_->SetCompositor(this, root_web_layer_);
|
| }
|
|
|
| +cc::AnimationTimeline* Compositor::GetAnimationTimeline() const {
|
| + return animation_timeline_.get();
|
| +}
|
| +
|
| void Compositor::SetHostHasTransparentBackground(
|
| bool host_has_transparent_background) {
|
| host_->set_has_transparent_background(host_has_transparent_background);
|
| @@ -485,6 +501,11 @@ const cc::RendererSettings& Compositor::GetRendererSettings() const {
|
| return host_->settings().renderer_settings;
|
| }
|
|
|
| +const cc::LayerTreeHost& Compositor::GetLayerTreeHost() const {
|
| + DCHECK(host_);
|
| + return *host_.get();
|
| +}
|
| +
|
| scoped_refptr<CompositorLock> Compositor::GetCompositorLock() {
|
| if (!compositor_lock_) {
|
| compositor_lock_ = new CompositorLock(this);
|
|
|