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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 } else { | 375 } else { |
376 page_scale_delta = sync_tree->page_scale_delta(); | 376 page_scale_delta = sync_tree->page_scale_delta(); |
377 sent_page_scale_delta = sync_tree->sent_page_scale_delta(); | 377 sent_page_scale_delta = sync_tree->sent_page_scale_delta(); |
378 sync_tree->set_sent_page_scale_delta(1.f); | 378 sync_tree->set_sent_page_scale_delta(1.f); |
379 } | 379 } |
380 | 380 |
381 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_, | 381 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_, |
382 min_page_scale_factor_, | 382 min_page_scale_factor_, |
383 max_page_scale_factor_); | 383 max_page_scale_factor_); |
384 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); | 384 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); |
385 sync_tree->SetLatencyInfo(latency_info_); | |
386 latency_info_.Clear(); | |
387 | 385 |
388 sync_tree->PassSwapPromises(&swap_promise_list_); | 386 sync_tree->PassSwapPromises(&swap_promise_list_); |
389 | 387 |
390 host_impl->SetViewportSize(device_viewport_size_); | 388 host_impl->SetViewportSize(device_viewport_size_); |
391 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); | 389 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); |
392 host_impl->SetDeviceScaleFactor(device_scale_factor_); | 390 host_impl->SetDeviceScaleFactor(device_scale_factor_); |
393 host_impl->SetDebugState(debug_state_); | 391 host_impl->SetDebugState(debug_state_); |
394 if (pending_page_scale_animation_) { | 392 if (pending_page_scale_animation_) { |
395 host_impl->StartPageScaleAnimation( | 393 host_impl->StartPageScaleAnimation( |
396 pending_page_scale_animation_->target_offset, | 394 pending_page_scale_animation_->target_offset, |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 | 696 |
699 void LayerTreeHost::SetVisible(bool visible) { | 697 void LayerTreeHost::SetVisible(bool visible) { |
700 if (visible_ == visible) | 698 if (visible_ == visible) |
701 return; | 699 return; |
702 visible_ = visible; | 700 visible_ = visible; |
703 if (!visible) | 701 if (!visible) |
704 ReduceMemoryUsage(); | 702 ReduceMemoryUsage(); |
705 proxy_->SetVisible(visible); | 703 proxy_->SetVisible(visible); |
706 } | 704 } |
707 | 705 |
708 void LayerTreeHost::SetLatencyInfo(const ui::LatencyInfo& latency_info) { | |
709 latency_info_.MergeWith(latency_info); | |
710 } | |
711 | |
712 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, | 706 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, |
713 bool use_anchor, | 707 bool use_anchor, |
714 float scale, | 708 float scale, |
715 base::TimeDelta duration) { | 709 base::TimeDelta duration) { |
716 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); | 710 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); |
717 pending_page_scale_animation_->target_offset = target_offset; | 711 pending_page_scale_animation_->target_offset = target_offset; |
718 pending_page_scale_animation_->use_anchor = use_anchor; | 712 pending_page_scale_animation_->use_anchor = use_anchor; |
719 pending_page_scale_animation_->scale = scale; | 713 pending_page_scale_animation_->scale = scale; |
720 pending_page_scale_animation_->duration = duration; | 714 pending_page_scale_animation_->duration = duration; |
721 | 715 |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 | 1283 |
1290 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1284 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1291 for (size_t i = 0; i < swap_promise_list_.size(); i++) { | 1285 for (size_t i = 0; i < swap_promise_list_.size(); i++) { |
1292 if (swap_promise_list_[i]) | 1286 if (swap_promise_list_[i]) |
1293 swap_promise_list_[i]->DidNotSwap(reason); | 1287 swap_promise_list_[i]->DidNotSwap(reason); |
1294 } | 1288 } |
1295 swap_promise_list_.clear(); | 1289 swap_promise_list_.clear(); |
1296 } | 1290 } |
1297 | 1291 |
1298 } // namespace cc | 1292 } // namespace cc |
OLD | NEW |