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

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

Issue 1951193002: cc: Add mailbox support to ResourceProvider write locks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@worker_context_stream
Patch Set: fix gpu Created 4 years, 7 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 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 if (use_gpu_rasterization_) { 2196 if (use_gpu_rasterization_) {
2197 DCHECK(resource_provider_->output_surface()->worker_context_provider()); 2197 DCHECK(resource_provider_->output_surface()->worker_context_provider());
2198 2198
2199 *resource_pool = 2199 *resource_pool =
2200 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); 2200 ResourcePool::Create(resource_provider_.get(), GetTaskRunner());
2201 2201
2202 int msaa_sample_count = use_msaa_ ? RequestedMSAASampleCount() : 0; 2202 int msaa_sample_count = use_msaa_ ? RequestedMSAASampleCount() : 0;
2203 2203
2204 *raster_buffer_provider = GpuRasterBufferProvider::Create( 2204 *raster_buffer_provider = GpuRasterBufferProvider::Create(
2205 context_provider, resource_provider_.get(), 2205 context_provider, resource_provider_.get(),
2206 settings_.use_distance_field_text, msaa_sample_count); 2206 settings_.use_distance_field_text, msaa_sample_count,
2207 settings_.async_worker_context_enabled);
2207 return; 2208 return;
2208 } 2209 }
2209 2210
2210 DCHECK(GetRendererCapabilities().using_image); 2211 DCHECK(GetRendererCapabilities().using_image);
2211 2212
2212 bool use_zero_copy = settings_.use_zero_copy; 2213 bool use_zero_copy = settings_.use_zero_copy;
2213 // TODO(reveman): Remove this when mojo supports worker contexts. 2214 // TODO(reveman): Remove this when mojo supports worker contexts.
2214 // crbug.com/522440 2215 // crbug.com/522440
2215 if (!resource_provider_->output_surface()->worker_context_provider()) { 2216 if (!resource_provider_->output_surface()->worker_context_provider()) {
2216 LOG(ERROR) 2217 LOG(ERROR)
(...skipping 14 matching lines...) Expand all
2231 *resource_pool = 2232 *resource_pool =
2232 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); 2233 ResourcePool::Create(resource_provider_.get(), GetTaskRunner());
2233 2234
2234 const int max_copy_texture_chromium_size = 2235 const int max_copy_texture_chromium_size =
2235 context_provider->ContextCapabilities().max_copy_texture_chromium_size; 2236 context_provider->ContextCapabilities().max_copy_texture_chromium_size;
2236 2237
2237 *raster_buffer_provider = OneCopyRasterBufferProvider::Create( 2238 *raster_buffer_provider = OneCopyRasterBufferProvider::Create(
2238 GetTaskRunner(), context_provider, resource_provider_.get(), 2239 GetTaskRunner(), context_provider, resource_provider_.get(),
2239 max_copy_texture_chromium_size, settings_.use_partial_raster, 2240 max_copy_texture_chromium_size, settings_.use_partial_raster,
2240 settings_.max_staging_buffer_usage_in_bytes, 2241 settings_.max_staging_buffer_usage_in_bytes,
2241 settings_.renderer_settings.preferred_tile_format); 2242 settings_.renderer_settings.preferred_tile_format,
2243 settings_.async_worker_context_enabled);
2242 } 2244 }
2243 2245
2244 void LayerTreeHostImpl::SetLayerTreeMutator(LayerTreeMutator* mutator) { 2246 void LayerTreeHostImpl::SetLayerTreeMutator(LayerTreeMutator* mutator) {
2245 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), 2247 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
2246 "LayerTreeHostImpl::SetLayerTreeMutator"); 2248 "LayerTreeHostImpl::SetLayerTreeMutator");
2247 mutator_ = mutator; 2249 mutator_ = mutator;
2248 } 2250 }
2249 2251
2250 void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() { 2252 void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() {
2251 ClearUIResources(); 2253 ClearUIResources();
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
3955 return task_runner_provider_->HasImplThread(); 3957 return task_runner_provider_->HasImplThread();
3956 } 3958 }
3957 3959
3958 bool LayerTreeHostImpl::CommitToActiveTree() const { 3960 bool LayerTreeHostImpl::CommitToActiveTree() const {
3959 // In single threaded mode we skip the pending tree and commit directly to the 3961 // In single threaded mode we skip the pending tree and commit directly to the
3960 // active tree. 3962 // active tree.
3961 return !task_runner_provider_->HasImplThread(); 3963 return !task_runner_provider_->HasImplThread();
3962 } 3964 }
3963 3965
3964 } // namespace cc 3966 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698