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

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

Issue 1832663002: cc : Determine if a layer is root by using the value in LayerTreeImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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_impl.h ('k') | cc/trees/occlusion_tracker.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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) { 274 void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) {
275 if (root_layer_ && layer.get() != root_layer_) 275 if (root_layer_ && layer.get() != root_layer_)
276 RemoveLayer(root_layer_->id()); 276 RemoveLayer(root_layer_->id());
277 root_layer_ = layer.get(); 277 root_layer_ = layer.get();
278 if (layer) 278 if (layer)
279 AddLayer(std::move(layer)); 279 AddLayer(std::move(layer));
280 layer_tree_host_impl_->OnCanDrawStateChangedForTree(); 280 layer_tree_host_impl_->OnCanDrawStateChangedForTree();
281 } 281 }
282 282
283 bool LayerTreeImpl::IsRootLayer(const LayerImpl* layer) const {
284 return root_layer_ == layer;
285 }
286
283 LayerImpl* LayerTreeImpl::InnerViewportScrollLayer() const { 287 LayerImpl* LayerTreeImpl::InnerViewportScrollLayer() const {
284 return LayerById(inner_viewport_scroll_layer_id_); 288 return LayerById(inner_viewport_scroll_layer_id_);
285 } 289 }
286 290
287 LayerImpl* LayerTreeImpl::OuterViewportScrollLayer() const { 291 LayerImpl* LayerTreeImpl::OuterViewportScrollLayer() const {
288 return LayerById(outer_viewport_scroll_layer_id_); 292 return LayerById(outer_viewport_scroll_layer_id_);
289 } 293 }
290 294
291 gfx::ScrollOffset LayerTreeImpl::TotalScrollOffset() const { 295 gfx::ScrollOffset LayerTreeImpl::TotalScrollOffset() const {
292 gfx::ScrollOffset offset; 296 gfx::ScrollOffset offset;
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 } 2106 }
2103 2107
2104 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { 2108 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) {
2105 layers_that_should_push_properties_.clear(); 2109 layers_that_should_push_properties_.clear();
2106 for (auto* layer : *this) 2110 for (auto* layer : *this)
2107 layer->ResetChangeTracking(); 2111 layer->ResetChangeTracking();
2108 property_trees_.ResetAllChangeTracking(flag); 2112 property_trees_.ResetAllChangeTracking(flag);
2109 } 2113 }
2110 2114
2111 } // namespace cc 2115 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/occlusion_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698