| 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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 | 686 |
| 687 void LayerTreeHost::SetVisible(bool visible) { | 687 void LayerTreeHost::SetVisible(bool visible) { |
| 688 if (visible_ == visible) | 688 if (visible_ == visible) |
| 689 return; | 689 return; |
| 690 visible_ = visible; | 690 visible_ = visible; |
| 691 if (!visible) | 691 if (!visible) |
| 692 ReduceMemoryUsage(); | 692 ReduceMemoryUsage(); |
| 693 proxy_->SetVisible(visible); | 693 proxy_->SetVisible(visible); |
| 694 } | 694 } |
| 695 | 695 |
| 696 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, | 696 void LayerTreeHost::StartPageScaleAnimation(const gfx::Vector2d& target_offset, |
| 697 bool use_anchor, | 697 bool use_anchor, |
| 698 float scale, | 698 float scale, |
| 699 base::TimeDelta duration) { | 699 base::TimeDelta duration) { |
| 700 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); | 700 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); |
| 701 pending_page_scale_animation_->target_offset = target_offset; | 701 pending_page_scale_animation_->target_offset = target_offset; |
| 702 pending_page_scale_animation_->use_anchor = use_anchor; | 702 pending_page_scale_animation_->use_anchor = use_anchor; |
| 703 pending_page_scale_animation_->scale = scale; | 703 pending_page_scale_animation_->scale = scale; |
| 704 pending_page_scale_animation_->duration = duration; | 704 pending_page_scale_animation_->duration = duration; |
| 705 | 705 |
| 706 SetNeedsCommit(); | 706 SetNeedsCommit(); |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 swap_promise_list_.push_back(swap_promise.Pass()); | 1322 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1325 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1326 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1326 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1327 swap_promise_list_[i]->DidNotSwap(reason); | 1327 swap_promise_list_[i]->DidNotSwap(reason); |
| 1328 swap_promise_list_.clear(); | 1328 swap_promise_list_.clear(); |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 } // namespace cc | 1331 } // namespace cc |
| OLD | NEW |