| 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 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 DCHECK(!tile_manager_); | 1868 DCHECK(!tile_manager_); |
| 1869 DCHECK(settings_.impl_side_painting); | 1869 DCHECK(settings_.impl_side_painting); |
| 1870 DCHECK(output_surface_); | 1870 DCHECK(output_surface_); |
| 1871 DCHECK(resource_provider_); | 1871 DCHECK(resource_provider_); |
| 1872 DCHECK(proxy_->ImplThreadTaskRunner()); | 1872 DCHECK(proxy_->ImplThreadTaskRunner()); |
| 1873 | 1873 |
| 1874 ContextProvider* context_provider = output_surface_->context_provider(); | 1874 ContextProvider* context_provider = output_surface_->context_provider(); |
| 1875 transfer_buffer_memory_limit_ = | 1875 transfer_buffer_memory_limit_ = |
| 1876 GetMaxTransferBufferUsageBytes(context_provider); | 1876 GetMaxTransferBufferUsageBytes(context_provider); |
| 1877 | 1877 |
| 1878 if (use_gpu_rasterization_ && context_provider) { | 1878 if (use_gpu_rasterization_) { |
| 1879 resource_pool_ = | 1879 resource_pool_ = |
| 1880 ResourcePool::Create(resource_provider_.get(), | 1880 ResourcePool::Create(resource_provider_.get(), |
| 1881 GL_TEXTURE_2D, | 1881 GL_TEXTURE_2D, |
| 1882 resource_provider_->best_texture_format()); | 1882 resource_provider_->best_texture_format()); |
| 1883 | 1883 |
| 1884 raster_worker_pool_ = | 1884 raster_worker_pool_ = GpuRasterWorkerPool::Create( |
| 1885 GpuRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), | 1885 proxy_->ImplThreadTaskRunner(), resource_provider_.get()); |
| 1886 resource_provider_.get(), | |
| 1887 context_provider); | |
| 1888 on_demand_task_graph_runner_ = &synchronous_task_graph_runner_; | 1886 on_demand_task_graph_runner_ = &synchronous_task_graph_runner_; |
| 1889 } else if (UseZeroCopyTextureUpload()) { | 1887 } else if (UseZeroCopyTextureUpload()) { |
| 1890 resource_pool_ = | 1888 resource_pool_ = |
| 1891 ResourcePool::Create(resource_provider_.get(), | 1889 ResourcePool::Create(resource_provider_.get(), |
| 1892 GetMapImageTextureTarget(context_provider), | 1890 GetMapImageTextureTarget(context_provider), |
| 1893 resource_provider_->best_texture_format()); | 1891 resource_provider_->best_texture_format()); |
| 1894 | 1892 |
| 1895 raster_worker_pool_ = | 1893 raster_worker_pool_ = |
| 1896 ImageRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), | 1894 ImageRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), |
| 1897 RasterWorkerPool::GetTaskGraphRunner(), | 1895 RasterWorkerPool::GetTaskGraphRunner(), |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3149 } | 3147 } |
| 3150 | 3148 |
| 3151 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3149 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3152 std::vector<PictureLayerImpl*>::iterator it = | 3150 std::vector<PictureLayerImpl*>::iterator it = |
| 3153 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3151 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3154 DCHECK(it != picture_layers_.end()); | 3152 DCHECK(it != picture_layers_.end()); |
| 3155 picture_layers_.erase(it); | 3153 picture_layers_.erase(it); |
| 3156 } | 3154 } |
| 3157 | 3155 |
| 3158 } // namespace cc | 3156 } // namespace cc |
| OLD | NEW |