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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 | 693 |
694 void LayerTreeHost::SetVisible(bool visible) { | 694 void LayerTreeHost::SetVisible(bool visible) { |
695 if (visible_ == visible) | 695 if (visible_ == visible) |
696 return; | 696 return; |
697 visible_ = visible; | 697 visible_ = visible; |
698 if (!visible) | 698 if (!visible) |
699 ReduceMemoryUsage(); | 699 ReduceMemoryUsage(); |
700 proxy_->SetVisible(visible); | 700 proxy_->SetVisible(visible); |
701 } | 701 } |
702 | 702 |
703 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, | 703 void LayerTreeHost::StartPageScaleAnimation(const gfx::Vector2d& target_offset, |
704 bool use_anchor, | 704 bool use_anchor, |
705 float scale, | 705 float scale, |
706 base::TimeDelta duration) { | 706 base::TimeDelta duration) { |
707 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); | 707 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); |
708 pending_page_scale_animation_->target_offset = target_offset; | 708 pending_page_scale_animation_->target_offset = target_offset; |
709 pending_page_scale_animation_->use_anchor = use_anchor; | 709 pending_page_scale_animation_->use_anchor = use_anchor; |
710 pending_page_scale_animation_->scale = scale; | 710 pending_page_scale_animation_->scale = scale; |
711 pending_page_scale_animation_->duration = duration; | 711 pending_page_scale_animation_->duration = duration; |
712 | 712 |
713 SetNeedsCommit(); | 713 SetNeedsCommit(); |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 swap_promise_list_.push_back(swap_promise.Pass()); | 1272 swap_promise_list_.push_back(swap_promise.Pass()); |
1273 } | 1273 } |
1274 | 1274 |
1275 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1275 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1276 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1276 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
1277 swap_promise_list_[i]->DidNotSwap(reason); | 1277 swap_promise_list_[i]->DidNotSwap(reason); |
1278 swap_promise_list_.clear(); | 1278 swap_promise_list_.clear(); |
1279 } | 1279 } |
1280 | 1280 |
1281 } // namespace cc | 1281 } // namespace cc |
OLD | NEW |