summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authortrchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 07:51:45 +0000
committertrchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 07:51:45 +0000
commite3067e30ade69021a0964dd52be3a59b7137ecfa (patch)
treea6b213850e360c080b206f5159209bf2de412b35 /cc
parent054723d440afb61122138aa61d9a466006b9077c (diff)
downloadchromium_src-e3067e30ade69021a0964dd52be3a59b7137ecfa.zip
chromium_src-e3067e30ade69021a0964dd52be3a59b7137ecfa.tar.gz
chromium_src-e3067e30ade69021a0964dd52be3a59b7137ecfa.tar.bz2
RenderWidget and RenderWidgetCompositor cleanup
This patch can be considered as two logical changes that are orthogonal. Both of the changes don't affect code behavior. [2/2] Add LayerTreeHostSingleThreadClient::ScheduleAnimation widget_->scheduleAnimation() should be routed through SingleThreadProxy:: SetNeedsAnimate(). This way we can reduce many CC API inconsistencies between single thread and threaded mode. [1/2] Remove ScheduleCompositeImpl The force_redraw parameter of ScheduleCompositeImpl only makes a difference in threaded-compositing mode. The only user of ScheduleCompositeImpl(true) always calls SetNeedsAnimate, so it doesn't harm to call it one more time. --> ScheduleCompositeImpl is fully equivalent to scheduleComposite This patch merges ScheduleCompositeImpl into scheduleComposite. R=jamesr,piman Review URL: https://codereview.chromium.org/80173002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236718 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/test/fake_layer_tree_host_client.h1
-rw-r--r--cc/test/layer_tree_test.cc4
-rw-r--r--cc/test/layer_tree_test.h1
-rw-r--r--cc/trees/layer_tree_host.cc1
-rw-r--r--cc/trees/layer_tree_host_single_thread_client.h3
-rw-r--r--cc/trees/single_thread_proxy.cc4
6 files changed, 11 insertions, 3 deletions
diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h
index 5d9c6ae..eac8d5e 100644
--- a/cc/test/fake_layer_tree_host_client.h
+++ b/cc/test/fake_layer_tree_host_client.h
@@ -44,6 +44,7 @@ class FakeLayerTreeHostClient : public LayerTreeHostClient,
// LayerTreeHostSingleThreadClient implementation.
virtual void ScheduleComposite() OVERRIDE {}
+ virtual void ScheduleAnimation() OVERRIDE {}
virtual void DidPostSwapBuffers() OVERRIDE {}
virtual void DidAbortSwapBuffers() OVERRIDE {}
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 7d4b517..d70d797 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -259,6 +259,10 @@ class LayerTreeHostClientForTesting : public LayerTreeHostClient,
test_hooks_->ScheduleComposite();
}
+ virtual void ScheduleAnimation() OVERRIDE {
+ test_hooks_->ScheduleAnimation();
+ }
+
virtual void DidPostSwapBuffers() OVERRIDE {}
virtual void DidAbortSwapBuffers() OVERRIDE {}
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h
index 7ed3fc1..1800c1a 100644
--- a/cc/test/layer_tree_test.h
+++ b/cc/test/layer_tree_test.h
@@ -68,6 +68,7 @@ class TestHooks : public AnimationDelegate {
virtual void DidCommitAndDrawFrame() {}
virtual void DidCompleteSwapBuffers() {}
virtual void ScheduleComposite() {}
+ virtual void ScheduleAnimation() {}
virtual void DidDeferCommit() {}
virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
bool visible) {}
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 3470175..df82093 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -527,7 +527,6 @@ const RendererCapabilities& LayerTreeHost::GetRendererCapabilities() const {
}
void LayerTreeHost::SetNeedsAnimate() {
- DCHECK(proxy_->HasImplThread());
proxy_->SetNeedsAnimate();
}
diff --git a/cc/trees/layer_tree_host_single_thread_client.h b/cc/trees/layer_tree_host_single_thread_client.h
index 734cb0c..cb61450 100644
--- a/cc/trees/layer_tree_host_single_thread_client.h
+++ b/cc/trees/layer_tree_host_single_thread_client.h
@@ -11,6 +11,9 @@ class LayerTreeHostSingleThreadClient {
public:
// Request that the client schedule a composite.
virtual void ScheduleComposite() = 0;
+ // Request that the client schedule a composite now, and calculate appropriate
+ // delay for potential future frame.
+ virtual void ScheduleAnimation() = 0;
// Called whenever the compositor posts a SwapBuffers (either full or
// partial). After DidPostSwapBuffers(), exactly one of
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 671a53b..ee6d2fd 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -177,8 +177,8 @@ const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const {
}
void SingleThreadProxy::SetNeedsAnimate() {
- // Thread-only feature.
- NOTREACHED();
+ DCHECK(Proxy::IsMainThread());
+ client_->ScheduleAnimation();
}
void SingleThreadProxy::SetNeedsUpdateLayers() {