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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 61823008: Introduce separate client and init path for single-threaded cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « cc/trees/single_thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 9de0fdd8d85d4dcd56686de2cd599ffaf1266559..13d8111a2ea204a36cb115e0ca497c23a8b92f1e 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -14,19 +14,24 @@
#include "cc/resources/resource_update_controller.h"
#include "cc/trees/blocking_task_runner.h"
#include "cc/trees/layer_tree_host.h"
+#include "cc/trees/layer_tree_host_single_thread_client.h"
#include "cc/trees/layer_tree_impl.h"
#include "ui/gfx/frame_time.h"
namespace cc {
-scoped_ptr<Proxy> SingleThreadProxy::Create(LayerTreeHost* layer_tree_host) {
+scoped_ptr<Proxy> SingleThreadProxy::Create(
+ LayerTreeHost* layer_tree_host,
+ LayerTreeHostSingleThreadClient* client) {
return make_scoped_ptr(
- new SingleThreadProxy(layer_tree_host)).PassAs<Proxy>();
+ new SingleThreadProxy(layer_tree_host, client)).PassAs<Proxy>();
}
-SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layer_tree_host)
+SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layer_tree_host,
+ LayerTreeHostSingleThreadClient* client)
: Proxy(NULL),
layer_tree_host_(layer_tree_host),
+ client_(client),
created_offscreen_context_provider_(false),
next_frame_is_newly_committed_frame_(false),
inside_draw_(false) {
@@ -178,7 +183,7 @@ void SingleThreadProxy::SetNeedsAnimate() {
void SingleThreadProxy::SetNeedsUpdateLayers() {
DCHECK(Proxy::IsMainThread());
- layer_tree_host_->ScheduleComposite();
+ client_->ScheduleComposite();
}
void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) {
@@ -237,11 +242,12 @@ void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) {
void SingleThreadProxy::SetNeedsCommit() {
DCHECK(Proxy::IsMainThread());
- layer_tree_host_->ScheduleComposite();
+ client_->ScheduleComposite();
}
void SingleThreadProxy::SetNeedsRedraw(gfx::Rect damage_rect) {
SetNeedsRedrawRectOnImplThread(damage_rect);
+ client_->ScheduleComposite();
}
void SingleThreadProxy::SetNextCommitWaitsForActivation() {
@@ -286,7 +292,7 @@ void SingleThreadProxy::NotifyReadyToActivate() {
}
void SingleThreadProxy::SetNeedsRedrawOnImplThread() {
- layer_tree_host_->ScheduleComposite();
+ client_->ScheduleComposite();
}
void SingleThreadProxy::SetNeedsManageTilesOnImplThread() {
@@ -308,7 +314,7 @@ void SingleThreadProxy::DidInitializeVisibleTileOnImplThread() {
}
void SingleThreadProxy::SetNeedsCommitOnImplThread() {
- layer_tree_host_->ScheduleComposite();
+ client_->ScheduleComposite();
}
void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread(
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698