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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1379783002: Allow one-copy task tile worker pool to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove needs_conversion, fix tile size unit test and move modulo 4 DCHECK (for tests) Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 << "Forcing zero-copy tile initialization as worker context is missing"; 2217 << "Forcing zero-copy tile initialization as worker context is missing";
2218 use_zero_copy = true; 2218 use_zero_copy = true;
2219 } 2219 }
2220 2220
2221 if (use_zero_copy) { 2221 if (use_zero_copy) {
2222 *resource_pool = ResourcePool::CreateForGpuMemoryBufferResources( 2222 *resource_pool = ResourcePool::CreateForGpuMemoryBufferResources(
2223 resource_provider_.get(), GetTaskRunner()); 2223 resource_provider_.get(), GetTaskRunner());
2224 2224
2225 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( 2225 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create(
2226 GetTaskRunner(), task_graph_runner, resource_provider_.get(), 2226 GetTaskRunner(), task_graph_runner, resource_provider_.get(),
2227 settings_.renderer_settings.use_rgba_4444_textures); 2227 settings_.renderer_settings.preferred_tile_format);
2228 return; 2228 return;
2229 } 2229 }
2230 2230
2231 *resource_pool = 2231 *resource_pool =
2232 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); 2232 ResourcePool::Create(resource_provider_.get(), GetTaskRunner());
2233 2233
2234 int max_copy_texture_chromium_size = context_provider->ContextCapabilities() 2234 int max_copy_texture_chromium_size = context_provider->ContextCapabilities()
2235 .gpu.max_copy_texture_chromium_size; 2235 .gpu.max_copy_texture_chromium_size;
2236 2236
2237 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( 2237 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create(
2238 GetTaskRunner(), task_graph_runner, context_provider, 2238 GetTaskRunner(), task_graph_runner, context_provider,
2239 resource_provider_.get(), max_copy_texture_chromium_size, 2239 resource_provider_.get(), max_copy_texture_chromium_size,
2240 settings_.use_partial_raster, settings_.max_staging_buffer_usage_in_bytes, 2240 settings_.use_partial_raster, settings_.max_staging_buffer_usage_in_bytes,
2241 settings_.renderer_settings.use_rgba_4444_textures); 2241 settings_.renderer_settings.preferred_tile_format);
2242 } 2242 }
2243 2243
2244 void LayerTreeHostImpl::RecordMainFrameTiming( 2244 void LayerTreeHostImpl::RecordMainFrameTiming(
2245 const BeginFrameArgs& start_of_main_frame_args, 2245 const BeginFrameArgs& start_of_main_frame_args,
2246 const BeginFrameArgs& expected_next_main_frame_args) { 2246 const BeginFrameArgs& expected_next_main_frame_args) {
2247 std::vector<int64_t> request_ids; 2247 std::vector<int64_t> request_ids;
2248 active_tree_->GatherFrameTimingRequestIds(&request_ids); 2248 active_tree_->GatherFrameTimingRequestIds(&request_ids);
2249 if (request_ids.empty()) 2249 if (request_ids.empty())
2250 return; 2250 return;
2251 2251
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
3752 return task_runner_provider_->HasImplThread(); 3752 return task_runner_provider_->HasImplThread();
3753 } 3753 }
3754 3754
3755 bool LayerTreeHostImpl::CommitToActiveTree() const { 3755 bool LayerTreeHostImpl::CommitToActiveTree() const {
3756 // In single threaded mode we skip the pending tree and commit directly to the 3756 // In single threaded mode we skip the pending tree and commit directly to the
3757 // active tree. 3757 // active tree.
3758 return !task_runner_provider_->HasImplThread(); 3758 return !task_runner_provider_->HasImplThread();
3759 } 3759 }
3760 3760
3761 } // namespace cc 3761 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698