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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2021 raster_worker_pool_ = | 2021 raster_worker_pool_ = |
2022 BitmapRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), | 2022 BitmapRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), |
2023 RasterWorkerPool::GetTaskGraphRunner(), | 2023 RasterWorkerPool::GetTaskGraphRunner(), |
2024 resource_provider_.get()); | 2024 resource_provider_.get()); |
2025 } else if (use_gpu_rasterization_) { | 2025 } else if (use_gpu_rasterization_) { |
2026 resource_pool_ = | 2026 resource_pool_ = |
2027 ResourcePool::Create(resource_provider_.get(), | 2027 ResourcePool::Create(resource_provider_.get(), |
2028 GL_TEXTURE_2D, | 2028 GL_TEXTURE_2D, |
2029 resource_provider_->best_texture_format()); | 2029 resource_provider_->best_texture_format()); |
2030 | 2030 |
2031 raster_worker_pool_ = GpuRasterWorkerPool::Create( | 2031 raster_worker_pool_ = |
2032 task_runner, context_provider, resource_provider_.get()); | 2032 GpuRasterWorkerPool::Create(task_runner, |
| 2033 context_provider, |
| 2034 resource_provider_.get(), |
| 2035 settings_.use_distance_field_text); |
2033 } else if (UseZeroCopyRasterizer()) { | 2036 } else if (UseZeroCopyRasterizer()) { |
2034 resource_pool_ = ResourcePool::Create( | 2037 resource_pool_ = ResourcePool::Create( |
2035 resource_provider_.get(), | 2038 resource_provider_.get(), |
2036 GetMapImageTextureTarget(context_provider->ContextCapabilities()), | 2039 GetMapImageTextureTarget(context_provider->ContextCapabilities()), |
2037 resource_provider_->best_texture_format()); | 2040 resource_provider_->best_texture_format()); |
2038 | 2041 |
2039 raster_worker_pool_ = | 2042 raster_worker_pool_ = |
2040 ZeroCopyRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), | 2043 ZeroCopyRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), |
2041 RasterWorkerPool::GetTaskGraphRunner(), | 2044 RasterWorkerPool::GetTaskGraphRunner(), |
2042 resource_provider_.get()); | 2045 resource_provider_.get()); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 return false; | 2131 return false; |
2129 | 2132 |
2130 output_surface_ = output_surface.Pass(); | 2133 output_surface_ = output_surface.Pass(); |
2131 resource_provider_ = | 2134 resource_provider_ = |
2132 ResourceProvider::Create(output_surface_.get(), | 2135 ResourceProvider::Create(output_surface_.get(), |
2133 shared_bitmap_manager_, | 2136 shared_bitmap_manager_, |
2134 gpu_memory_buffer_manager_, | 2137 gpu_memory_buffer_manager_, |
2135 proxy_->blocking_main_thread_task_runner(), | 2138 proxy_->blocking_main_thread_task_runner(), |
2136 settings_.highp_threshold_min, | 2139 settings_.highp_threshold_min, |
2137 settings_.use_rgba_4444_textures, | 2140 settings_.use_rgba_4444_textures, |
2138 settings_.texture_id_allocation_chunk_size, | 2141 settings_.texture_id_allocation_chunk_size); |
2139 settings_.use_distance_field_text); | |
2140 | 2142 |
2141 if (output_surface_->capabilities().deferred_gl_initialization) | 2143 if (output_surface_->capabilities().deferred_gl_initialization) |
2142 EnforceZeroBudget(true); | 2144 EnforceZeroBudget(true); |
2143 | 2145 |
2144 CreateAndSetRenderer(); | 2146 CreateAndSetRenderer(); |
2145 | 2147 |
2146 if (settings_.impl_side_painting) | 2148 if (settings_.impl_side_painting) |
2147 CreateAndSetTileManager(); | 2149 CreateAndSetTileManager(); |
2148 | 2150 |
2149 // Initialize vsync parameters to sane values. | 2151 // Initialize vsync parameters to sane values. |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3475 } | 3477 } |
3476 | 3478 |
3477 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3479 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3478 std::vector<PictureLayerImpl*>::iterator it = | 3480 std::vector<PictureLayerImpl*>::iterator it = |
3479 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3481 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3480 DCHECK(it != picture_layers_.end()); | 3482 DCHECK(it != picture_layers_.end()); |
3481 picture_layers_.erase(it); | 3483 picture_layers_.erase(it); |
3482 } | 3484 } |
3483 | 3485 |
3484 } // namespace cc | 3486 } // namespace cc |
OLD | NEW |