| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "cc/trees/layer_tree_host.h" | 65 #include "cc/trees/layer_tree_host.h" |
| 66 #include "cc/trees/layer_tree_host_common.h" | 66 #include "cc/trees/layer_tree_host_common.h" |
| 67 #include "cc/trees/layer_tree_impl.h" | 67 #include "cc/trees/layer_tree_impl.h" |
| 68 #include "cc/trees/occlusion_tracker.h" | 68 #include "cc/trees/occlusion_tracker.h" |
| 69 #include "cc/trees/single_thread_proxy.h" | 69 #include "cc/trees/single_thread_proxy.h" |
| 70 #include "cc/trees/tree_synchronizer.h" | 70 #include "cc/trees/tree_synchronizer.h" |
| 71 #include "gpu/command_buffer/client/gles2_interface.h" | 71 #include "gpu/command_buffer/client/gles2_interface.h" |
| 72 #include "gpu/GLES2/gl2extchromium.h" | 72 #include "gpu/GLES2/gl2extchromium.h" |
| 73 #include "ui/gfx/frame_time.h" | 73 #include "ui/gfx/frame_time.h" |
| 74 #include "ui/gfx/geometry/rect_conversions.h" | 74 #include "ui/gfx/geometry/rect_conversions.h" |
| 75 #include "ui/gfx/size_conversions.h" | 75 #include "ui/gfx/geometry/size_conversions.h" |
| 76 #include "ui/gfx/vector2d_conversions.h" | 76 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 77 | 77 |
| 78 namespace cc { | 78 namespace cc { |
| 79 namespace { | 79 namespace { |
| 80 | 80 |
| 81 // Small helper class that saves the current viewport location as the user sees | 81 // Small helper class that saves the current viewport location as the user sees |
| 82 // it and resets to the same location. | 82 // it and resets to the same location. |
| 83 class ViewportAnchor { | 83 class ViewportAnchor { |
| 84 public: | 84 public: |
| 85 ViewportAnchor(LayerImpl* inner_scroll, LayerImpl* outer_scroll) | 85 ViewportAnchor(LayerImpl* inner_scroll, LayerImpl* outer_scroll) |
| 86 : inner_(inner_scroll), | 86 : inner_(inner_scroll), |
| (...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2072 context_provider, | 2072 context_provider, |
| 2073 resource_provider_.get(), | 2073 resource_provider_.get(), |
| 2074 GetMaxTransferBufferUsageBytes(context_provider->ContextCapabilities(), | 2074 GetMaxTransferBufferUsageBytes(context_provider->ContextCapabilities(), |
| 2075 settings_.refresh_rate)); | 2075 settings_.refresh_rate)); |
| 2076 } | 2076 } |
| 2077 | 2077 |
| 2078 tile_manager_ = TileManager::Create(this, | 2078 tile_manager_ = TileManager::Create(this, |
| 2079 task_runner, | 2079 task_runner, |
| 2080 resource_pool_.get(), | 2080 resource_pool_.get(), |
| 2081 raster_worker_pool_->AsRasterizer(), | 2081 raster_worker_pool_->AsRasterizer(), |
| 2082 rendering_stats_instrumentation_); | 2082 rendering_stats_instrumentation_, |
| 2083 settings().scheduled_raster_task_limit); |
| 2083 | 2084 |
| 2084 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); | 2085 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); |
| 2085 need_to_update_visible_tiles_before_draw_ = false; | 2086 need_to_update_visible_tiles_before_draw_ = false; |
| 2086 } | 2087 } |
| 2087 | 2088 |
| 2088 void LayerTreeHostImpl::DestroyTileManager() { | 2089 void LayerTreeHostImpl::DestroyTileManager() { |
| 2089 tile_manager_ = nullptr; | 2090 tile_manager_ = nullptr; |
| 2090 resource_pool_ = nullptr; | 2091 resource_pool_ = nullptr; |
| 2091 staging_resource_pool_ = nullptr; | 2092 staging_resource_pool_ = nullptr; |
| 2092 raster_worker_pool_ = nullptr; | 2093 raster_worker_pool_ = nullptr; |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3477 } | 3478 } |
| 3478 | 3479 |
| 3479 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3480 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3480 std::vector<PictureLayerImpl*>::iterator it = | 3481 std::vector<PictureLayerImpl*>::iterator it = |
| 3481 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3482 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3482 DCHECK(it != picture_layers_.end()); | 3483 DCHECK(it != picture_layers_.end()); |
| 3483 picture_layers_.erase(it); | 3484 picture_layers_.erase(it); |
| 3484 } | 3485 } |
| 3485 | 3486 |
| 3486 } // namespace cc | 3487 } // namespace cc |
| OLD | NEW |