Chromium Code Reviews| 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 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2010 | 2010 |
| 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 = settings_.image_texture_target; |
| 2021 #if defined(OS_MACOSX) | 2021 if (image_target == GL_TEXTURE_RECTANGLE_ARB) { |
|
reveman
2014/12/03 15:57:19
Please remove if/else statements and use DCHECK_IM
| |
| 2022 // GL_TEXTURE_RECTANGLE_ARB target is required by IOSurface backed images. | 2022 DCHECK(context_provider->ContextCapabilities().gpu.texture_rectangle); |
| 2023 DCHECK(context_provider->ContextCapabilities().gpu.texture_rectangle); | 2023 } else if (image_target == GL_TEXTURE_EXTERNAL_OES) { |
| 2024 image_target = GL_TEXTURE_RECTANGLE_ARB; | |
| 2025 #endif | |
| 2026 if (settings_.use_image_external) { | |
| 2027 DCHECK(context_provider->ContextCapabilities().gpu.egl_image_external); | 2024 DCHECK(context_provider->ContextCapabilities().gpu.egl_image_external); |
| 2028 image_target = GL_TEXTURE_EXTERNAL_OES; | |
| 2029 } | 2025 } |
| 2030 | 2026 |
| 2031 if (settings_.use_zero_copy || IsSynchronousSingleThreaded()) { | 2027 if (settings_.use_zero_copy || IsSynchronousSingleThreaded()) { |
| 2032 *resource_pool = | 2028 *resource_pool = |
| 2033 ResourcePool::Create(resource_provider_.get(), image_target, | 2029 ResourcePool::Create(resource_provider_.get(), image_target, |
| 2034 resource_provider_->best_texture_format()); | 2030 resource_provider_->best_texture_format()); |
| 2035 | 2031 |
| 2036 TaskGraphRunner* task_graph_runner; | 2032 TaskGraphRunner* task_graph_runner; |
| 2037 if (IsSynchronousSingleThreaded()) { | 2033 if (IsSynchronousSingleThreaded()) { |
| 2038 DCHECK(!single_thread_synchronous_task_graph_runner_); | 2034 DCHECK(!single_thread_synchronous_task_graph_runner_); |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3486 } | 3482 } |
| 3487 | 3483 |
| 3488 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3484 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3489 std::vector<PictureLayerImpl*>::iterator it = | 3485 std::vector<PictureLayerImpl*>::iterator it = |
| 3490 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3486 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3491 DCHECK(it != picture_layers_.end()); | 3487 DCHECK(it != picture_layers_.end()); |
| 3492 picture_layers_.erase(it); | 3488 picture_layers_.erase(it); |
| 3493 } | 3489 } |
| 3494 | 3490 |
| 3495 } // namespace cc | 3491 } // namespace cc |
| OLD | NEW |