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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1227163017: cc: one copy is default as well as final fallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix Created 5 years, 5 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
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/trees/layer_tree_host_pixeltest_synchronous.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89d2ef5b173b512dc7eaf3699d2900cca159c3e2..40d47a6a6c16c3e75ec65b8fde85294dfd327240 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -129,29 +129,6 @@ void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) {
TRACE_EVENT_ASYNC_END0("cc", "LayerTreeHostImpl::SetVisible", id);
}
-size_t GetMaxTransferBufferUsageBytes(
- const ContextProvider::Capabilities& context_capabilities,
- double refresh_rate) {
- // We want to make sure the default transfer buffer size is equal to the
- // amount of data that can be uploaded by the compositor to avoid stalling
- // the pipeline.
- // For reference Chromebook Pixel can upload 1MB in about 0.5ms.
- const size_t kMaxBytesUploadedPerMs = 1024 * 1024 * 2;
-
- // We need to upload at least enough work to keep the GPU process busy until
- // the next time it can handle a request to start more uploads from the
- // compositor. We assume that it will pick up any sent upload requests within
- // the time of a vsync, since the browser will want to swap a frame within
- // that time interval, and then uploads should have a chance to be processed.
- size_t ms_per_frame = std::floor(1000.0 / refresh_rate);
- size_t max_transfer_buffer_usage_bytes =
- ms_per_frame * kMaxBytesUploadedPerMs;
-
- // The context may request a lower limit based on the device capabilities.
- return std::min(context_capabilities.max_transfer_buffer_usage_bytes,
- max_transfer_buffer_usage_bytes);
-}
-
size_t GetMaxStagingResourceCount() {
// Upper bound for number of staging resource to allow.
return 32;
@@ -261,8 +238,6 @@ LayerTreeHostImpl::LayerTreeHostImpl(
}
DCHECK(proxy_->IsImplThread());
- DCHECK_IMPLIES(settings.use_one_copy, !settings.use_zero_copy);
- DCHECK_IMPLIES(settings.use_zero_copy, !settings.use_one_copy);
DidVisibilityChange(this, visible_);
SetDebugState(settings.initial_debug_state);
@@ -2137,43 +2112,25 @@ void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool(
return;
}
- if (settings_.use_one_copy) {
- // Synchronous single-threaded mode depends on tiles being ready to
- // draw when raster is complete. Therefore, it must use one of zero
- // copy, software raster, or GPU raster.
- DCHECK(!IsSynchronousSingleThreaded());
-
- // We need to create a staging resource pool when using copy rasterizer.
- *staging_resource_pool =
- ResourcePool::Create(resource_provider_.get(), image_target);
- *resource_pool =
- ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D);
-
- int max_copy_texture_chromium_size =
- context_provider->ContextCapabilities()
- .gpu.max_copy_texture_chromium_size;
-
- *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create(
- GetTaskRunner(), task_graph_runner, context_provider,
- resource_provider_.get(), staging_resource_pool_.get(),
- max_copy_texture_chromium_size,
- settings_.use_persistent_map_for_gpu_memory_buffers);
- return;
- }
-
// Synchronous single-threaded mode depends on tiles being ready to
// draw when raster is complete. Therefore, it must use one of zero
- // copy, software raster, or GPU raster (in the branches above).
+ // copy, software raster, or GPU raster.
DCHECK(!IsSynchronousSingleThreaded());
- *resource_pool = ResourcePool::Create(
- resource_provider_.get(), GL_TEXTURE_2D);
+ // We need to create a staging resource pool when using copy rasterizer.
+ *staging_resource_pool =
+ ResourcePool::Create(resource_provider_.get(), image_target);
+ *resource_pool =
+ ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D);
+
+ int max_copy_texture_chromium_size = context_provider->ContextCapabilities()
+ .gpu.max_copy_texture_chromium_size;
- *tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create(
- GetTaskRunner(), task_graph_runner_, context_provider,
- resource_provider_.get(),
- GetMaxTransferBufferUsageBytes(context_provider->ContextCapabilities(),
- settings_.renderer_settings.refresh_rate));
+ *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create(
+ GetTaskRunner(), task_graph_runner, context_provider,
+ resource_provider_.get(), staging_resource_pool_.get(),
+ max_copy_texture_chromium_size,
+ settings_.use_persistent_map_for_gpu_memory_buffers);
}
void LayerTreeHostImpl::RecordMainFrameTiming(
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/trees/layer_tree_host_pixeltest_synchronous.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698