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 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 *raster_worker_pool = | 2011 *raster_worker_pool = |
2012 GpuRasterWorkerPool::Create(task_runner, | 2012 GpuRasterWorkerPool::Create(task_runner, |
2013 context_provider, | 2013 context_provider, |
2014 resource_provider_.get(), | 2014 resource_provider_.get(), |
2015 settings_.use_distance_field_text); | 2015 settings_.use_distance_field_text); |
2016 return; | 2016 return; |
2017 } | 2017 } |
2018 | 2018 |
2019 if (GetRendererCapabilities().using_image) { | 2019 if (GetRendererCapabilities().using_image) { |
2020 unsigned image_target = GL_TEXTURE_2D; | 2020 unsigned image_target = GL_TEXTURE_2D; |
2021 #if defined(OS_MACOSX) | |
2022 // GL_TEXTURE_RECTANGLE_ARB target is required by IOSurface backed images. | |
2023 DCHECK(context_provider->ContextCapabilities().gpu.texture_rectangle); | |
2024 image_target = GL_TEXTURE_RECTANGLE_ARB; | |
2025 #endif | |
2026 if (settings_.use_image_external) { | 2021 if (settings_.use_image_external) { |
2027 DCHECK(context_provider->ContextCapabilities().gpu.egl_image_external); | 2022 DCHECK(context_provider->ContextCapabilities().gpu.egl_image_external); |
2028 image_target = GL_TEXTURE_EXTERNAL_OES; | 2023 image_target = GL_TEXTURE_EXTERNAL_OES; |
| 2024 #ifndef OS_ANDROID |
| 2025 NOTREACHED(); |
| 2026 #endif |
| 2027 } |
| 2028 if (settings_.use_image_io_surface) { |
| 2029 // GL_TEXTURE_RECTANGLE_ARB target is required by IOSurface backed images. |
| 2030 DCHECK(context_provider->ContextCapabilities().gpu.texture_rectangle); |
| 2031 image_target = GL_TEXTURE_RECTANGLE_ARB; |
| 2032 #ifndef OS_MACOSX |
| 2033 NOTREACHED(); |
| 2034 #endif |
2029 } | 2035 } |
2030 | 2036 |
2031 if (settings_.use_zero_copy || IsSynchronousSingleThreaded()) { | 2037 if (settings_.use_zero_copy || IsSynchronousSingleThreaded()) { |
2032 *resource_pool = | 2038 *resource_pool = |
2033 ResourcePool::Create(resource_provider_.get(), image_target, | 2039 ResourcePool::Create(resource_provider_.get(), image_target, |
2034 resource_provider_->best_texture_format()); | 2040 resource_provider_->best_texture_format()); |
2035 | 2041 |
2036 TaskGraphRunner* task_graph_runner; | 2042 TaskGraphRunner* task_graph_runner; |
2037 if (IsSynchronousSingleThreaded()) { | 2043 if (IsSynchronousSingleThreaded()) { |
2038 DCHECK(!single_thread_synchronous_task_graph_runner_); | 2044 DCHECK(!single_thread_synchronous_task_graph_runner_); |
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3486 } | 3492 } |
3487 | 3493 |
3488 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3494 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3489 std::vector<PictureLayerImpl*>::iterator it = | 3495 std::vector<PictureLayerImpl*>::iterator it = |
3490 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3496 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3491 DCHECK(it != picture_layers_.end()); | 3497 DCHECK(it != picture_layers_.end()); |
3492 picture_layers_.erase(it); | 3498 picture_layers_.erase(it); |
3493 } | 3499 } |
3494 | 3500 |
3495 } // namespace cc | 3501 } // namespace cc |
OLD | NEW |