| OLD | NEW |
| 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 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 if (pending_tree_) | 2202 if (pending_tree_) |
| 2203 pending_tree_->set_needs_update_draw_properties(); | 2203 pending_tree_->set_needs_update_draw_properties(); |
| 2204 client_->UpdateRendererCapabilitiesOnImplThread(); | 2204 client_->UpdateRendererCapabilitiesOnImplThread(); |
| 2205 } | 2205 } |
| 2206 | 2206 |
| 2207 void LayerTreeHostImpl::CreateTileManagerResources() { | 2207 void LayerTreeHostImpl::CreateTileManagerResources() { |
| 2208 CreateResourceAndRasterBufferProvider(&raster_buffer_provider_, | 2208 CreateResourceAndRasterBufferProvider(&raster_buffer_provider_, |
| 2209 &resource_pool_); | 2209 &resource_pool_); |
| 2210 | 2210 |
| 2211 if (use_gpu_rasterization_) { | 2211 if (use_gpu_rasterization_) { |
| 2212 image_decode_controller_ = base::WrapUnique(new GpuImageDecodeController( | 2212 image_decode_controller_ = base::MakeUnique<GpuImageDecodeController>( |
| 2213 output_surface_->worker_context_provider(), | 2213 output_surface_->worker_context_provider(), |
| 2214 settings_.renderer_settings.preferred_tile_format, | 2214 settings_.renderer_settings.preferred_tile_format, |
| 2215 settings_.gpu_decoded_image_budget_bytes)); | 2215 settings_.gpu_decoded_image_budget_bytes); |
| 2216 } else { | 2216 } else { |
| 2217 image_decode_controller_ = | 2217 image_decode_controller_ = base::MakeUnique<SoftwareImageDecodeController>( |
| 2218 base::WrapUnique(new SoftwareImageDecodeController( | 2218 settings_.renderer_settings.preferred_tile_format, |
| 2219 settings_.renderer_settings.preferred_tile_format, | 2219 settings_.software_decoded_image_budget_bytes); |
| 2220 settings_.software_decoded_image_budget_bytes)); | |
| 2221 } | 2220 } |
| 2222 | 2221 |
| 2223 // Pass the single-threaded synchronous task graph runner to the worker pool | 2222 // Pass the single-threaded synchronous task graph runner to the worker pool |
| 2224 // if we're in synchronous single-threaded mode. | 2223 // if we're in synchronous single-threaded mode. |
| 2225 TaskGraphRunner* task_graph_runner = task_graph_runner_; | 2224 TaskGraphRunner* task_graph_runner = task_graph_runner_; |
| 2226 if (is_synchronous_single_threaded_) { | 2225 if (is_synchronous_single_threaded_) { |
| 2227 DCHECK(!single_thread_synchronous_task_graph_runner_); | 2226 DCHECK(!single_thread_synchronous_task_graph_runner_); |
| 2228 single_thread_synchronous_task_graph_runner_.reset( | 2227 single_thread_synchronous_task_graph_runner_.reset( |
| 2229 new SynchronousTaskGraphRunner); | 2228 new SynchronousTaskGraphRunner); |
| 2230 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); | 2229 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); |
| (...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4102 return task_runner_provider_->HasImplThread(); | 4101 return task_runner_provider_->HasImplThread(); |
| 4103 } | 4102 } |
| 4104 | 4103 |
| 4105 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4104 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 4106 // In single threaded mode we skip the pending tree and commit directly to the | 4105 // In single threaded mode we skip the pending tree and commit directly to the |
| 4107 // active tree. | 4106 // active tree. |
| 4108 return !task_runner_provider_->HasImplThread(); | 4107 return !task_runner_provider_->HasImplThread(); |
| 4109 } | 4108 } |
| 4110 | 4109 |
| 4111 } // namespace cc | 4110 } // namespace cc |
| OLD | NEW |