| Index: ui/compositor/compositor.cc
|
| diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
|
| index 846bab0d17c68c871055b30d3ff19bffd2fdae1c..00ccce42f3b95946344555d230ca7076c73d42fa 100644
|
| --- a/ui/compositor/compositor.cc
|
| +++ b/ui/compositor/compositor.cc
|
| @@ -38,6 +38,7 @@
|
| #include "ui/compositor/dip_util.h"
|
| #include "ui/compositor/layer.h"
|
| #include "ui/compositor/layer_animator_collection.h"
|
| +#include "ui/compositor/overscroll/ui_scroll_input_manager.h"
|
| #include "ui/gl/gl_switches.h"
|
|
|
| namespace {
|
| @@ -101,6 +102,10 @@ Compositor::Compositor(ui::ContextFactory* context_factory,
|
|
|
| cc::LayerTreeSettings settings;
|
|
|
| +#if defined(OS_MACOSX)
|
| + settings.enable_elastic_overscroll = true;
|
| +#endif
|
| +
|
| // This will ensure PictureLayers always can have LCD text, to match the
|
| // previous behaviour with ContentLayers, where LCD-not-allowed notifications
|
| // were ignored.
|
| @@ -208,6 +213,14 @@ Compositor::Compositor(ui::ContextFactory* context_factory,
|
| params.main_task_runner = task_runner_;
|
| params.animation_host = cc::AnimationHost::CreateMainInstance();
|
| host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms);
|
| +
|
| + // Tie composited scrolling with whether the platform wants elastic scrolling.
|
| + // TODO(tapted): Use composited scrolling on all platforms.
|
| + if (settings.enable_elastic_overscroll) {
|
| + scroll_input_manager_.reset(
|
| + new UIScrollInputManager(host_->GetInputHandler()));
|
| + }
|
| +
|
| UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor",
|
| base::TimeTicks::Now() - before_create);
|
|
|
| @@ -385,6 +398,14 @@ bool Compositor::IsVisible() {
|
| return host_->visible();
|
| }
|
|
|
| +bool Compositor::ScrollLayerTo(int layer_id, const gfx::ScrollOffset& offset) {
|
| + return host_->GetInputHandler()->ScrollLayerTo(layer_id, offset);
|
| +}
|
| +
|
| +gfx::ScrollOffset Compositor::GetScrollOffsetForLayer(int layer_id) const {
|
| + return host_->GetInputHandler()->GetScrollOffsetForLayer(layer_id);
|
| +}
|
| +
|
| void Compositor::SetAuthoritativeVSyncInterval(
|
| const base::TimeDelta& interval) {
|
| context_factory_->SetAuthoritativeVSyncInterval(this, interval);
|
|
|