Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: trunk/src/cc/trees/layer_tree_impl.cc

Issue 96363002: Revert 237857 "Revert 237848 "Use LatencyInfoSwapPromise to trac..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/animation/keyframed_animation_curve.h" 8 #include "cc/animation/keyframed_animation_curve.h"
9 #include "cc/animation/scrollbar_animation_controller.h" 9 #include "cc/animation/scrollbar_animation_controller.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { 114 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
115 // The request queue should have been processed and does not require a push. 115 // The request queue should have been processed and does not require a push.
116 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); 116 DCHECK_EQ(ui_resource_request_queue_.size(), 0u);
117 117
118 if (next_activation_forces_redraw_) { 118 if (next_activation_forces_redraw_) {
119 layer_tree_host_impl_->SetFullRootLayerDamage(); 119 layer_tree_host_impl_->SetFullRootLayerDamage();
120 next_activation_forces_redraw_ = false; 120 next_activation_forces_redraw_ = false;
121 } 121 }
122 122
123 target_tree->SetLatencyInfo(latency_info_);
124 latency_info_.Clear();
125
126 target_tree->PassSwapPromises(&swap_promise_list_); 123 target_tree->PassSwapPromises(&swap_promise_list_);
127 124
128 target_tree->SetPageScaleFactorAndLimits( 125 target_tree->SetPageScaleFactorAndLimits(
129 page_scale_factor(), min_page_scale_factor(), max_page_scale_factor()); 126 page_scale_factor(), min_page_scale_factor(), max_page_scale_factor());
130 target_tree->SetPageScaleDelta( 127 target_tree->SetPageScaleDelta(
131 target_tree->page_scale_delta() / target_tree->sent_page_scale_delta()); 128 target_tree->page_scale_delta() / target_tree->sent_page_scale_delta());
132 target_tree->set_sent_page_scale_delta(1); 129 target_tree->set_sent_page_scale_delta(1);
133 130
134 if (settings().use_pinch_virtual_viewport) { 131 if (settings().use_pinch_virtual_viewport) {
135 target_tree->SetViewportLayersFromIds( 132 target_tree->SetViewportLayersFromIds(
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 454
458 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { 455 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) {
459 DCHECK(LayerById(layer->id())); 456 DCHECK(LayerById(layer->id()));
460 layer_id_map_.erase(layer->id()); 457 layer_id_map_.erase(layer->id());
461 } 458 }
462 459
463 void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) { 460 void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) {
464 pending_tree->SetCurrentlyScrollingLayer( 461 pending_tree->SetCurrentlyScrollingLayer(
465 LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(), 462 LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(),
466 currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0)); 463 currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0));
467 pending_tree->SetLatencyInfo(latency_info_);
468 latency_info_.Clear();
469 } 464 }
470 465
471 static void DidBecomeActiveRecursive(LayerImpl* layer) { 466 static void DidBecomeActiveRecursive(LayerImpl* layer) {
472 layer->DidBecomeActive(); 467 layer->DidBecomeActive();
473 for (size_t i = 0; i < layer->children().size(); ++i) 468 for (size_t i = 0; i < layer->children().size(); ++i)
474 DidBecomeActiveRecursive(layer->children()[i]); 469 DidBecomeActiveRecursive(layer->children()[i]);
475 } 470 }
476 471
477 void LayerTreeImpl::DidBecomeActive() { 472 void LayerTreeImpl::DidBecomeActive() {
478 if (!root_layer()) 473 if (!root_layer())
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 687
693 gfx::Vector2dF original_viewport_size = 688 gfx::Vector2dF original_viewport_size =
694 gfx::RectF(root_container->bounds()).bottom_right() - 689 gfx::RectF(root_container->bounds()).bottom_right() -
695 gfx::PointF(); 690 gfx::PointF();
696 original_viewport_size.Scale(1 / page_scale_factor()); 691 original_viewport_size.Scale(1 / page_scale_factor());
697 692
698 root_scroll->SetFixedContainerSizeDelta( 693 root_scroll->SetFixedContainerSizeDelta(
699 scrollable_viewport_size - original_viewport_size); 694 scrollable_viewport_size - original_viewport_size);
700 } 695 }
701 696
702 void LayerTreeImpl::SetLatencyInfo(const ui::LatencyInfo& latency_info) {
703 latency_info_.MergeWith(latency_info);
704 }
705
706 const ui::LatencyInfo& LayerTreeImpl::GetLatencyInfo() {
707 return latency_info_;
708 }
709
710 void LayerTreeImpl::ClearLatencyInfo() {
711 latency_info_.Clear();
712 }
713
714 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { 697 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) {
715 DCHECK(swap_promise); 698 DCHECK(swap_promise);
716 if (swap_promise_list_.size() > kMaxQueuedSwapPromiseNumber) 699 if (swap_promise_list_.size() > kMaxQueuedSwapPromiseNumber)
717 BreakSwapPromises(SwapPromise::SWAP_PROMISE_LIST_OVERFLOW); 700 BreakSwapPromises(SwapPromise::SWAP_PROMISE_LIST_OVERFLOW);
718 swap_promise_list_.push_back(swap_promise.Pass()); 701 swap_promise_list_.push_back(swap_promise.Pass());
719 } 702 }
720 703
721 void LayerTreeImpl::PassSwapPromises( 704 void LayerTreeImpl::PassSwapPromises(
722 ScopedPtrVector<SwapPromise>* new_swap_promise) { 705 ScopedPtrVector<SwapPromise>* new_swap_promise) {
723 swap_promise_list_.insert_and_take(swap_promise_list_.end(), 706 swap_promise_list_.insert_and_take(swap_promise_list_.end(),
724 *new_swap_promise); 707 *new_swap_promise);
725 new_swap_promise->clear(); 708 new_swap_promise->clear();
726 } 709 }
727 710
728 void LayerTreeImpl::FinishSwapPromises() { 711 void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
729 for (size_t i = 0; i < swap_promise_list_.size(); i++) 712 for (size_t i = 0; i < swap_promise_list_.size(); i++)
730 swap_promise_list_[i]->DidSwap(); 713 swap_promise_list_[i]->DidSwap(metadata);
731 swap_promise_list_.clear(); 714 swap_promise_list_.clear();
732 } 715 }
733 716
734 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 717 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
735 for (size_t i = 0; i < swap_promise_list_.size(); i++) 718 for (size_t i = 0; i < swap_promise_list_.size(); i++)
736 swap_promise_list_[i]->DidNotSwap(reason); 719 swap_promise_list_[i]->DidNotSwap(reason);
737 swap_promise_list_.clear(); 720 swap_promise_list_.clear();
738 } 721 }
739 722
740 void LayerTreeImpl::DidModifyTilePriorities() { 723 void LayerTreeImpl::DidModifyTilePriorities() {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() 789 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest()
807 const { 790 const {
808 // Only the active tree needs to know about layers with copy requests, as 791 // Only the active tree needs to know about layers with copy requests, as
809 // they are aborted if not serviced during draw. 792 // they are aborted if not serviced during draw.
810 DCHECK(IsActiveTree()); 793 DCHECK(IsActiveTree());
811 794
812 return layers_with_copy_output_request_; 795 return layers_with_copy_output_request_;
813 } 796 }
814 797
815 } // namespace cc 798 } // namespace cc
OLDNEW
« no previous file with comments | « trunk/src/cc/trees/layer_tree_impl.h ('k') | trunk/src/content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698