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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 667793004: Support single-threaded impl-side painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now with less plumbing Created 6 years, 2 months 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
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 5e89bbeda7ebed65b7fb2dde7c04b8d84c2f968a..a6f834b5c0b6ce03ba715590722ef8ce7f4f80d6 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1742,6 +1742,14 @@ void LayerTreeHostImpl::SetTopControlsLayoutHeight(float height) {
SetFullRootLayerDamage();
}
+void LayerTreeHostImpl::SynchronouslyInitializeAllTiles() {
+ // Only valid for the single-threaded non-scheduled/synchronous case
+ // using the zero copy raster worker pool.
+ DCHECK(!proxy_->HasImplThread());
+ DCHECK(!settings_.single_thread_proxy_scheduler);
reveman 2014/10/28 03:46:33 nit: can we DCHECK to make sure that settings.sche
enne (OOO) 2014/10/28 16:49:56 We only need the zero copy DCHECK if I follow your
reveman 2014/10/28 18:08:24 hm, this will only initialize some tiles if settin
+ single_thread_synchronous_task_graph_runner_->RunUntilIdle();
+}
+
void LayerTreeHostImpl::DidLoseOutputSurface() {
if (resource_provider_)
resource_provider_->DidLoseOutputSurface();
@@ -2019,7 +2027,7 @@ void LayerTreeHostImpl::CreateAndSetTileManager() {
resource_provider_->best_texture_format());
raster_worker_pool_ =
- BitmapRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(),
+ BitmapRasterWorkerPool::Create(task_runner,
RasterWorkerPool::GetTaskGraphRunner(),
resource_provider_.get());
} else if (use_gpu_rasterization_) {
@@ -2039,10 +2047,20 @@ void LayerTreeHostImpl::CreateAndSetTileManager() {
GetMapImageTextureTarget(context_provider->ContextCapabilities()),
resource_provider_->best_texture_format());
- raster_worker_pool_ =
- ZeroCopyRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(),
- RasterWorkerPool::GetTaskGraphRunner(),
- resource_provider_.get());
+ bool synchronous_single_threaded =
+ !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler;
+
+ TaskGraphRunner* task_graph_runner;
+ if (synchronous_single_threaded) {
+ DCHECK(!single_thread_synchronous_task_graph_runner_);
+ single_thread_synchronous_task_graph_runner_.reset(new TaskGraphRunner);
+ task_graph_runner = single_thread_synchronous_task_graph_runner_.get();
+ } else {
+ task_graph_runner = RasterWorkerPool::GetTaskGraphRunner();
+ }
reveman 2014/10/28 03:46:33 I think you can replace all this with: synchronou
+
+ raster_worker_pool_ = ZeroCopyRasterWorkerPool::Create(
+ task_runner, task_graph_runner, resource_provider_.get());
} else if (UseOneCopyRasterizer()) {
// We need to create a staging resource pool when using copy rasterizer.
staging_resource_pool_ = ResourcePool::Create(
@@ -2091,6 +2109,7 @@ void LayerTreeHostImpl::DestroyTileManager() {
resource_pool_ = nullptr;
staging_resource_pool_ = nullptr;
raster_worker_pool_ = nullptr;
+ single_thread_synchronous_task_graph_runner_ = nullptr;
}
bool LayerTreeHostImpl::UsePendingTreeForSync() const {

Powered by Google App Engine
This is Rietveld 408576698