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 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 } else { | 336 } else { |
337 page_scale_delta = sync_tree->page_scale_delta(); | 337 page_scale_delta = sync_tree->page_scale_delta(); |
338 sent_page_scale_delta = sync_tree->sent_page_scale_delta(); | 338 sent_page_scale_delta = sync_tree->sent_page_scale_delta(); |
339 sync_tree->set_sent_page_scale_delta(1.f); | 339 sync_tree->set_sent_page_scale_delta(1.f); |
340 } | 340 } |
341 | 341 |
342 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_, | 342 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_, |
343 min_page_scale_factor_, | 343 min_page_scale_factor_, |
344 max_page_scale_factor_); | 344 max_page_scale_factor_); |
345 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); | 345 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); |
| 346 sync_tree->SetLatencyInfo(latency_info_); |
| 347 latency_info_.Clear(); |
346 | 348 |
347 host_impl->SetViewportSize(device_viewport_size_); | 349 host_impl->SetViewportSize(device_viewport_size_); |
348 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); | 350 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); |
349 host_impl->SetDeviceScaleFactor(device_scale_factor_); | 351 host_impl->SetDeviceScaleFactor(device_scale_factor_); |
350 host_impl->SetDebugState(debug_state_); | 352 host_impl->SetDebugState(debug_state_); |
351 if (pending_page_scale_animation_) { | 353 if (pending_page_scale_animation_) { |
352 host_impl->StartPageScaleAnimation( | 354 host_impl->StartPageScaleAnimation( |
353 pending_page_scale_animation_->target_offset, | 355 pending_page_scale_animation_->target_offset, |
354 pending_page_scale_animation_->use_anchor, | 356 pending_page_scale_animation_->use_anchor, |
355 pending_page_scale_animation_->scale, | 357 pending_page_scale_animation_->scale, |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 SetNeedsCommit(); | 675 SetNeedsCommit(); |
674 } | 676 } |
675 | 677 |
676 void LayerTreeHost::SetVisible(bool visible) { | 678 void LayerTreeHost::SetVisible(bool visible) { |
677 if (visible_ == visible) | 679 if (visible_ == visible) |
678 return; | 680 return; |
679 visible_ = visible; | 681 visible_ = visible; |
680 proxy_->SetVisible(visible); | 682 proxy_->SetVisible(visible); |
681 } | 683 } |
682 | 684 |
| 685 void LayerTreeHost::SetLatencyInfo(const LatencyInfo& latency_info) { |
| 686 latency_info_.MergeWith(latency_info); |
| 687 } |
| 688 |
683 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, | 689 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, |
684 bool use_anchor, | 690 bool use_anchor, |
685 float scale, | 691 float scale, |
686 base::TimeDelta duration) { | 692 base::TimeDelta duration) { |
687 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); | 693 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); |
688 pending_page_scale_animation_->target_offset = target_offset; | 694 pending_page_scale_animation_->target_offset = target_offset; |
689 pending_page_scale_animation_->use_anchor = use_anchor; | 695 pending_page_scale_animation_->use_anchor = use_anchor; |
690 pending_page_scale_animation_->scale = scale; | 696 pending_page_scale_animation_->scale = scale; |
691 pending_page_scale_animation_->duration = duration; | 697 pending_page_scale_animation_->duration = duration; |
692 | 698 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 bool start_ready_animations = true; | 1095 bool start_ready_animations = true; |
1090 (*iter).second->UpdateState(start_ready_animations, NULL); | 1096 (*iter).second->UpdateState(start_ready_animations, NULL); |
1091 } | 1097 } |
1092 } | 1098 } |
1093 | 1099 |
1094 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1100 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
1095 return proxy_->CapturePicture(); | 1101 return proxy_->CapturePicture(); |
1096 } | 1102 } |
1097 | 1103 |
1098 } // namespace cc | 1104 } // namespace cc |
OLD | NEW |