| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 void LayerTreeHostImpl::BeginCommit() { | 292 void LayerTreeHostImpl::BeginCommit() { |
| 293 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); | 293 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); |
| 294 | 294 |
| 295 // Ensure all textures are returned so partial texture updates can happen | 295 // Ensure all textures are returned so partial texture updates can happen |
| 296 // during the commit. Impl-side-painting doesn't upload during commits, so | 296 // during the commit. Impl-side-painting doesn't upload during commits, so |
| 297 // is unaffected. | 297 // is unaffected. |
| 298 if (!settings_.impl_side_painting && output_surface_) | 298 if (!settings_.impl_side_painting && output_surface_) |
| 299 output_surface_->ForceReclaimResources(); | 299 output_surface_->ForceReclaimResources(); |
| 300 | 300 |
| 301 if (UsePendingTreeForSync()) | 301 if (settings_.impl_side_painting && !proxy_->CommitToActiveTree()) |
| 302 CreatePendingTree(); | 302 CreatePendingTree(); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void LayerTreeHostImpl::CommitComplete() { | 305 void LayerTreeHostImpl::CommitComplete() { |
| 306 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); | 306 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
| 307 | 307 |
| 308 if (pending_tree_) | 308 if (pending_tree_) |
| 309 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); | 309 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); |
| 310 sync_tree()->set_needs_update_draw_properties(); | 310 sync_tree()->set_needs_update_draw_properties(); |
| 311 | 311 |
| (...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 | 2046 |
| 2047 void LayerTreeHostImpl::DestroyTileManager() { | 2047 void LayerTreeHostImpl::DestroyTileManager() { |
| 2048 tile_manager_ = nullptr; | 2048 tile_manager_ = nullptr; |
| 2049 resource_pool_ = nullptr; | 2049 resource_pool_ = nullptr; |
| 2050 staging_resource_pool_ = nullptr; | 2050 staging_resource_pool_ = nullptr; |
| 2051 tile_task_worker_pool_ = nullptr; | 2051 tile_task_worker_pool_ = nullptr; |
| 2052 rasterizer_ = nullptr; | 2052 rasterizer_ = nullptr; |
| 2053 single_thread_synchronous_task_graph_runner_ = nullptr; | 2053 single_thread_synchronous_task_graph_runner_ = nullptr; |
| 2054 } | 2054 } |
| 2055 | 2055 |
| 2056 bool LayerTreeHostImpl::UsePendingTreeForSync() const { | |
| 2057 // In impl-side painting, synchronize to the pending tree so that it has | |
| 2058 // time to raster before being displayed. | |
| 2059 return settings_.impl_side_painting; | |
| 2060 } | |
| 2061 | |
| 2062 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const { | 2056 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const { |
| 2063 return !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler; | 2057 return !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler; |
| 2064 } | 2058 } |
| 2065 | 2059 |
| 2066 void LayerTreeHostImpl::EnforceZeroBudget(bool zero_budget) { | 2060 void LayerTreeHostImpl::EnforceZeroBudget(bool zero_budget) { |
| 2067 SetManagedMemoryPolicy(cached_managed_memory_policy_, zero_budget); | 2061 SetManagedMemoryPolicy(cached_managed_memory_policy_, zero_budget); |
| 2068 } | 2062 } |
| 2069 | 2063 |
| 2070 bool LayerTreeHostImpl::InitializeRenderer( | 2064 bool LayerTreeHostImpl::InitializeRenderer( |
| 2071 scoped_ptr<OutputSurface> output_surface) { | 2065 scoped_ptr<OutputSurface> output_surface) { |
| (...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3454 } | 3448 } |
| 3455 | 3449 |
| 3456 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3450 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3457 std::vector<PictureLayerImpl*>::iterator it = | 3451 std::vector<PictureLayerImpl*>::iterator it = |
| 3458 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3452 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3459 DCHECK(it != picture_layers_.end()); | 3453 DCHECK(it != picture_layers_.end()); |
| 3460 picture_layers_.erase(it); | 3454 picture_layers_.erase(it); |
| 3461 } | 3455 } |
| 3462 | 3456 |
| 3463 } // namespace cc | 3457 } // namespace cc |
| OLD | NEW |