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

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

Issue 1455023002: cc: Replace Pass() with std::move() in some subdirs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-cc
Patch Set: pass-cc2: . Created 5 years, 1 month 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 if (scrollbar_needs_animation) { 214 if (scrollbar_needs_animation) {
215 ScrollbarAnimationController* controller = 215 ScrollbarAnimationController* controller =
216 layer_tree_host_impl_->ScrollbarAnimationControllerForId( 216 layer_tree_host_impl_->ScrollbarAnimationControllerForId(
217 scroll_layer_id); 217 scroll_layer_id);
218 if (controller) 218 if (controller)
219 controller->DidScrollUpdate(scroll_layer_size_did_change); 219 controller->DidScrollUpdate(scroll_layer_size_did_change);
220 } 220 }
221 } 221 }
222 222
223 void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) { 223 void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) {
224 root_layer_ = layer.Pass(); 224 root_layer_ = std::move(layer);
225 225
226 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); 226 layer_tree_host_impl_->OnCanDrawStateChangedForTree();
227 } 227 }
228 228
229 LayerImpl* LayerTreeImpl::InnerViewportScrollLayer() const { 229 LayerImpl* LayerTreeImpl::InnerViewportScrollLayer() const {
230 return LayerById(inner_viewport_scroll_layer_id_); 230 return LayerById(inner_viewport_scroll_layer_id_);
231 } 231 }
232 232
233 LayerImpl* LayerTreeImpl::OuterViewportScrollLayer() const { 233 LayerImpl* LayerTreeImpl::OuterViewportScrollLayer() const {
234 return LayerById(outer_viewport_scroll_layer_id_); 234 return LayerById(outer_viewport_scroll_layer_id_);
(...skipping 19 matching lines...) Expand all
254 254
255 if (OuterViewportScrollLayer()) 255 if (OuterViewportScrollLayer())
256 offset += OuterViewportScrollLayer()->MaxScrollOffset(); 256 offset += OuterViewportScrollLayer()->MaxScrollOffset();
257 257
258 return offset; 258 return offset;
259 } 259 }
260 260
261 scoped_ptr<LayerImpl> LayerTreeImpl::DetachLayerTree() { 261 scoped_ptr<LayerImpl> LayerTreeImpl::DetachLayerTree() {
262 render_surface_layer_list_.clear(); 262 render_surface_layer_list_.clear();
263 set_needs_update_draw_properties(); 263 set_needs_update_draw_properties();
264 return root_layer_.Pass(); 264 return std::move(root_layer_);
265 } 265 }
266 266
267 static void UpdateClipTreeForBoundsDeltaOnLayer(LayerImpl* layer, 267 static void UpdateClipTreeForBoundsDeltaOnLayer(LayerImpl* layer,
268 ClipTree* clip_tree) { 268 ClipTree* clip_tree) {
269 if (layer && layer->masks_to_bounds()) { 269 if (layer && layer->masks_to_bounds()) {
270 ClipNode* clip_node = clip_tree->Node(layer->clip_tree_index()); 270 ClipNode* clip_node = clip_tree->Node(layer->clip_tree_index());
271 if (clip_node) { 271 if (clip_node) {
272 DCHECK_EQ(layer->id(), clip_node->owner_id); 272 DCHECK_EQ(layer->id(), clip_node->owner_id);
273 gfx::SizeF bounds = gfx::SizeF(layer->bounds()); 273 gfx::SizeF bounds = gfx::SizeF(layer->bounds());
274 if (clip_node->data.clip.size() != bounds) { 274 if (clip_node->data.clip.size() != bounds) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 // Active tree already shares the page_scale_factor object with pending 319 // Active tree already shares the page_scale_factor object with pending
320 // tree so only the limits need to be provided. 320 // tree so only the limits need to be provided.
321 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(), 321 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(),
322 max_page_scale_factor()); 322 max_page_scale_factor());
323 target_tree->SetDeviceScaleFactor(device_scale_factor()); 323 target_tree->SetDeviceScaleFactor(device_scale_factor());
324 target_tree->set_painted_device_scale_factor(painted_device_scale_factor()); 324 target_tree->set_painted_device_scale_factor(painted_device_scale_factor());
325 target_tree->elastic_overscroll()->PushPendingToActive(); 325 target_tree->elastic_overscroll()->PushPendingToActive();
326 326
327 target_tree->pending_page_scale_animation_ = 327 target_tree->pending_page_scale_animation_ =
328 pending_page_scale_animation_.Pass(); 328 std::move(pending_page_scale_animation_);
329 329
330 target_tree->SetViewportLayersFromIds( 330 target_tree->SetViewportLayersFromIds(
331 overscroll_elasticity_layer_id_, page_scale_layer_id_, 331 overscroll_elasticity_layer_id_, page_scale_layer_id_,
332 inner_viewport_scroll_layer_id_, outer_viewport_scroll_layer_id_); 332 inner_viewport_scroll_layer_id_, outer_viewport_scroll_layer_id_);
333 333
334 target_tree->RegisterSelection(selection_); 334 target_tree->RegisterSelection(selection_);
335 335
336 // This should match the property synchronization in 336 // This should match the property synchronization in
337 // LayerTreeHost::finishCommitOnImplThread(). 337 // LayerTreeHost::finishCommitOnImplThread().
338 target_tree->set_source_frame_number(source_frame_number()); 338 target_tree->set_source_frame_number(source_frame_number());
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 outer_viewport_offset.SetToMax(gfx::ScrollOffset()); 1115 outer_viewport_offset.SetToMax(gfx::ScrollOffset());
1116 1116
1117 OuterViewportScrollLayer()->SetCurrentScrollOffset(outer_viewport_offset); 1117 OuterViewportScrollLayer()->SetCurrentScrollOffset(outer_viewport_offset);
1118 inner_viewport_offset = root_offset - outer_viewport_offset; 1118 inner_viewport_offset = root_offset - outer_viewport_offset;
1119 InnerViewportScrollLayer()->SetCurrentScrollOffset(inner_viewport_offset); 1119 InnerViewportScrollLayer()->SetCurrentScrollOffset(inner_viewport_offset);
1120 return true; 1120 return true;
1121 } 1121 }
1122 1122
1123 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { 1123 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) {
1124 DCHECK(swap_promise); 1124 DCHECK(swap_promise);
1125 swap_promise_list_.push_back(swap_promise.Pass()); 1125 swap_promise_list_.push_back(std::move(swap_promise));
1126 } 1126 }
1127 1127
1128 void LayerTreeImpl::QueuePinnedSwapPromise( 1128 void LayerTreeImpl::QueuePinnedSwapPromise(
1129 scoped_ptr<SwapPromise> swap_promise) { 1129 scoped_ptr<SwapPromise> swap_promise) {
1130 DCHECK(IsActiveTree()); 1130 DCHECK(IsActiveTree());
1131 DCHECK(swap_promise); 1131 DCHECK(swap_promise);
1132 pinned_swap_promise_list_.push_back(swap_promise.Pass()); 1132 pinned_swap_promise_list_.push_back(std::move(swap_promise));
1133 } 1133 }
1134 1134
1135 void LayerTreeImpl::PassSwapPromises( 1135 void LayerTreeImpl::PassSwapPromises(
1136 std::vector<scoped_ptr<SwapPromise>>* new_swap_promise) { 1136 std::vector<scoped_ptr<SwapPromise>>* new_swap_promise) {
1137 for (const auto& swap_promise : swap_promise_list_) 1137 for (const auto& swap_promise : swap_promise_list_)
1138 swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS); 1138 swap_promise->DidNotSwap(SwapPromise::SWAP_FAILS);
1139 swap_promise_list_.clear(); 1139 swap_promise_list_.clear();
1140 swap_promise_list_.swap(*new_swap_promise); 1140 swap_promise_list_.swap(*new_swap_promise);
1141 } 1141 }
1142 1142
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY; 1753 return layer_tree_host_impl_->GetTreePriority() == SMOOTHNESS_TAKES_PRIORITY;
1754 } 1754 }
1755 1755
1756 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient() 1756 VideoFrameControllerClient* LayerTreeImpl::GetVideoFrameControllerClient()
1757 const { 1757 const {
1758 return layer_tree_host_impl_; 1758 return layer_tree_host_impl_;
1759 } 1759 }
1760 1760
1761 void LayerTreeImpl::SetPendingPageScaleAnimation( 1761 void LayerTreeImpl::SetPendingPageScaleAnimation(
1762 scoped_ptr<PendingPageScaleAnimation> pending_animation) { 1762 scoped_ptr<PendingPageScaleAnimation> pending_animation) {
1763 pending_page_scale_animation_ = pending_animation.Pass(); 1763 pending_page_scale_animation_ = std::move(pending_animation);
1764 } 1764 }
1765 1765
1766 scoped_ptr<PendingPageScaleAnimation> 1766 scoped_ptr<PendingPageScaleAnimation>
1767 LayerTreeImpl::TakePendingPageScaleAnimation() { 1767 LayerTreeImpl::TakePendingPageScaleAnimation() {
1768 return pending_page_scale_animation_.Pass(); 1768 return std::move(pending_page_scale_animation_);
1769 } 1769 }
1770 1770
1771 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { 1771 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const {
1772 LayerTreeType tree_type = 1772 LayerTreeType tree_type =
1773 IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; 1773 IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING;
1774 return layer_tree_host_impl_->animation_host() 1774 return layer_tree_host_impl_->animation_host()
1775 ? layer_tree_host_impl_->animation_host() 1775 ? layer_tree_host_impl_->animation_host()
1776 ->IsAnimatingFilterProperty(layer->id(), tree_type) 1776 ->IsAnimatingFilterProperty(layer->id(), tree_type)
1777 : false; 1777 : false;
1778 } 1778 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 const gfx::BoxF& box, 1927 const gfx::BoxF& box,
1928 gfx::BoxF* bounds) const { 1928 gfx::BoxF* bounds) const {
1929 *bounds = gfx::BoxF(); 1929 *bounds = gfx::BoxF();
1930 return layer_tree_host_impl_->animation_host() 1930 return layer_tree_host_impl_->animation_host()
1931 ? layer_tree_host_impl_->animation_host() 1931 ? layer_tree_host_impl_->animation_host()
1932 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) 1932 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
1933 : true; 1933 : true;
1934 } 1934 }
1935 1935
1936 } // namespace cc 1936 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698