summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authoryusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 18:23:55 +0000
committeryusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 18:23:55 +0000
commit9b2c7efc81f639c201df203ad0ce5373bff0e095 (patch)
tree8ad9f3b814c4778bc7e43f11933c26ac23cf7959 /cc
parentc1626d9dca299ec837949f9d10b952c91f40e1e3 (diff)
downloadchromium_src-9b2c7efc81f639c201df203ad0ce5373bff0e095.zip
chromium_src-9b2c7efc81f639c201df203ad0ce5373bff0e095.tar.gz
chromium_src-9b2c7efc81f639c201df203ad0ce5373bff0e095.tar.bz2
Add API to route end of fling messages from WebLayerTreeView to InputHandler
This API will be used by WebViewImpl to send end of fling messages to the compositor. Then the compositor will only send flingCancels if there is a main thread fling. This flingCancels when unnecessarily sent are causing a lot of input lag when main thread is blocked. BUG=162767 Review URL: https://chromiumcodereview.appspot.com/11565022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/input_handler.h1
-rw-r--r--cc/layer_tree_host.cc5
-rw-r--r--cc/layer_tree_host.h1
-rw-r--r--cc/proxy.h2
-rw-r--r--cc/single_thread_proxy.h1
-rw-r--r--cc/test/fake_proxy.h1
-rw-r--r--cc/thread_proxy.cc6
-rw-r--r--cc/thread_proxy.h1
8 files changed, 18 insertions, 0 deletions
diff --git a/cc/input_handler.h b/cc/input_handler.h
index 78e6213..2016f28 100644
--- a/cc/input_handler.h
+++ b/cc/input_handler.h
@@ -81,6 +81,7 @@ public:
virtual void bindToClient(InputHandlerClient*) = 0;
virtual void animate(base::TimeTicks time) = 0;
+ virtual void mainThreadHasStoppedFlinging() = 0;
protected:
InputHandler() { }
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index 9d7b6f3..70e1620 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -222,6 +222,11 @@ void LayerTreeHost::updateAnimations(base::TimeTicks frameBeginTime)
m_renderingStats.numAnimationFrames++;
}
+void LayerTreeHost::didStopFlinging()
+{
+ m_proxy->mainThreadHasStoppedFlinging();
+}
+
void LayerTreeHost::layout()
{
m_client->layout();
diff --git a/cc/layer_tree_host.h b/cc/layer_tree_host.h
index 5c1ce68..dfb4094 100644
--- a/cc/layer_tree_host.h
+++ b/cc/layer_tree_host.h
@@ -86,6 +86,7 @@ public:
void willBeginFrame() { m_client->willBeginFrame(); }
void didBeginFrame() { m_client->didBeginFrame(); }
void updateAnimations(base::TimeTicks monotonicFrameBeginTime);
+ void didStopFlinging();
void layout();
void beginCommitOnImplThread(LayerTreeHostImpl*);
void finishCommitOnImplThread(LayerTreeHostImpl*);
diff --git a/cc/proxy.h b/cc/proxy.h
index e319f9f..6382afc 100644
--- a/cc/proxy.h
+++ b/cc/proxy.h
@@ -82,6 +82,8 @@ public:
virtual void didAddAnimation() = 0;
+ virtual void mainThreadHasStoppedFlinging() = 0;
+
virtual bool commitRequested() const = 0;
virtual void start() = 0; // Must be called before using the proxy.
diff --git a/cc/single_thread_proxy.h b/cc/single_thread_proxy.h
index c746ecf..9eb0280 100644
--- a/cc/single_thread_proxy.h
+++ b/cc/single_thread_proxy.h
@@ -40,6 +40,7 @@ public:
virtual void setDeferCommits(bool) OVERRIDE;
virtual bool commitRequested() const OVERRIDE;
virtual void didAddAnimation() OVERRIDE;
+ virtual void mainThreadHasStoppedFlinging() OVERRIDE { }
virtual void start() OVERRIDE;
virtual void stop() OVERRIDE;
virtual size_t maxPartialTextureUpdates() const OVERRIDE;
diff --git a/cc/test/fake_proxy.h b/cc/test/fake_proxy.h
index 303d2dc..280c1a4 100644
--- a/cc/test/fake_proxy.h
+++ b/cc/test/fake_proxy.h
@@ -31,6 +31,7 @@ public:
virtual void setNeedsRedraw() OVERRIDE { }
virtual void setDeferCommits(bool) OVERRIDE { }
virtual void didAddAnimation() OVERRIDE { }
+ virtual void mainThreadHasStoppedFlinging() OVERRIDE { }
virtual bool commitRequested() const OVERRIDE;
virtual void start() OVERRIDE { }
virtual void stop() OVERRIDE { }
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc
index 4a437bb..f45c090 100644
--- a/cc/thread_proxy.cc
+++ b/cc/thread_proxy.cc
@@ -431,6 +431,12 @@ void ThreadProxy::setNeedsRedrawOnImplThread()
m_schedulerOnImplThread->setNeedsRedraw();
}
+void ThreadProxy::mainThreadHasStoppedFlinging()
+{
+ if (m_inputHandlerOnImplThread)
+ m_inputHandlerOnImplThread->mainThreadHasStoppedFlinging();
+}
+
void ThreadProxy::start()
{
DCHECK(isMainThread());
diff --git a/cc/thread_proxy.h b/cc/thread_proxy.h
index 3d73f52..af80530 100644
--- a/cc/thread_proxy.h
+++ b/cc/thread_proxy.h
@@ -48,6 +48,7 @@ public:
virtual void setDeferCommits(bool) OVERRIDE;
virtual bool commitRequested() const OVERRIDE;
virtual void didAddAnimation() OVERRIDE { }
+ virtual void mainThreadHasStoppedFlinging() OVERRIDE;
virtual void start() OVERRIDE;
virtual void stop() OVERRIDE;
virtual size_t maxPartialTextureUpdates() const OVERRIDE;