| 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.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 LayerTreeHost::~LayerTreeHost() { | 162 LayerTreeHost::~LayerTreeHost() { |
| 163 TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); | 163 TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); |
| 164 | 164 |
| 165 DCHECK(swap_promise_monitor_.empty()); | 165 DCHECK(swap_promise_monitor_.empty()); |
| 166 | 166 |
| 167 BreakSwapPromises(SwapPromise::COMMIT_FAILS); | 167 BreakSwapPromises(SwapPromise::COMMIT_FAILS); |
| 168 | 168 |
| 169 overhang_ui_resource_.reset(); | 169 overhang_ui_resource_ = nullptr; |
| 170 | 170 |
| 171 if (root_layer_.get()) | 171 if (root_layer_.get()) |
| 172 root_layer_->SetLayerTreeHost(NULL); | 172 root_layer_->SetLayerTreeHost(NULL); |
| 173 | 173 |
| 174 if (proxy_) { | 174 if (proxy_) { |
| 175 DCHECK(proxy_->IsMainThread()); | 175 DCHECK(proxy_->IsMainThread()); |
| 176 proxy_->Stop(); | 176 proxy_->Stop(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 // We must clear any pointers into the layer tree prior to destroying it. | 179 // We must clear any pointers into the layer tree prior to destroying it. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 host_impl->SetViewportSize(device_viewport_size_); | 360 host_impl->SetViewportSize(device_viewport_size_); |
| 361 host_impl->SetDeviceScaleFactor(device_scale_factor_); | 361 host_impl->SetDeviceScaleFactor(device_scale_factor_); |
| 362 host_impl->SetDebugState(debug_state_); | 362 host_impl->SetDebugState(debug_state_); |
| 363 if (pending_page_scale_animation_) { | 363 if (pending_page_scale_animation_) { |
| 364 host_impl->StartPageScaleAnimation( | 364 host_impl->StartPageScaleAnimation( |
| 365 pending_page_scale_animation_->target_offset, | 365 pending_page_scale_animation_->target_offset, |
| 366 pending_page_scale_animation_->use_anchor, | 366 pending_page_scale_animation_->use_anchor, |
| 367 pending_page_scale_animation_->scale, | 367 pending_page_scale_animation_->scale, |
| 368 pending_page_scale_animation_->duration); | 368 pending_page_scale_animation_->duration); |
| 369 pending_page_scale_animation_.reset(); | 369 pending_page_scale_animation_ = nullptr; |
| 370 } | 370 } |
| 371 | 371 |
| 372 if (!ui_resource_request_queue_.empty()) { | 372 if (!ui_resource_request_queue_.empty()) { |
| 373 sync_tree->set_ui_resource_request_queue(ui_resource_request_queue_); | 373 sync_tree->set_ui_resource_request_queue(ui_resource_request_queue_); |
| 374 ui_resource_request_queue_.clear(); | 374 ui_resource_request_queue_.clear(); |
| 375 } | 375 } |
| 376 if (overhang_ui_resource_) { | 376 if (overhang_ui_resource_) { |
| 377 host_impl->SetOverhangUIResource( | 377 host_impl->SetOverhangUIResource( |
| 378 overhang_ui_resource_->id(), | 378 overhang_ui_resource_->id(), |
| 379 GetUIResourceSize(overhang_ui_resource_->id())); | 379 GetUIResourceSize(overhang_ui_resource_->id())); |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 swap_promise_list_.push_back(swap_promise.Pass()); | 1323 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1324 } | 1324 } |
| 1325 | 1325 |
| 1326 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1326 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1327 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1327 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1328 swap_promise_list_[i]->DidNotSwap(reason); | 1328 swap_promise_list_[i]->DidNotSwap(reason); |
| 1329 swap_promise_list_.clear(); | 1329 swap_promise_list_.clear(); |
| 1330 } | 1330 } |
| 1331 | 1331 |
| 1332 } // namespace cc | 1332 } // namespace cc |
| OLD | NEW |