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

Unified Diff: ui/compositor/compositor.cc

Issue 2197503002: Route Scroll events through a cc::InputHandler Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollWheelAsScrollEvent
Patch Set: Abandon DeliverInputForBeginFrame: will not help fix the header row Created 4 years 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 | « ui/compositor/compositor.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 63f72bc6178b815d9008fb0daff580c3ae1db9fd..30013a97dfc771261bd2c0fe115762d75537368e 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -39,6 +39,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 {
@@ -183,6 +184,10 @@ Compositor::Compositor(ui::ContextFactory* context_factory,
settings.gpu_memory_policy.priority_cutoff_when_visible =
gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
+#if defined(OS_MACOSX)
+ settings.enable_elastic_overscroll = true;
+#endif
+
base::TimeTicks before_create = base::TimeTicks::Now();
animation_host_ = cc::AnimationHost::CreateMainInstance();
@@ -194,6 +199,14 @@ Compositor::Compositor(ui::ContextFactory* context_factory,
params.main_task_runner = task_runner_;
params.mutator_host = animation_host_.get();
host_ = cc::LayerTreeHostInProcess::CreateSingleThreaded(this, &params);
+
+ // 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);
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698