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

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

Issue 1887703002: cc: Add a main thread LayerListIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: For testing only Created 4 years, 8 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') | no next file » | 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 434
435 if (hud_layer()) 435 if (hud_layer())
436 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( 436 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(
437 target_tree->LayerById(hud_layer()->id()))); 437 target_tree->LayerById(hud_layer()->id())));
438 else 438 else
439 target_tree->set_hud_layer(NULL); 439 target_tree->set_hud_layer(NULL);
440 440
441 target_tree->has_ever_been_drawn_ = false; 441 target_tree->has_ever_been_drawn_ = false;
442 } 442 }
443 443
444 LayerListIterator LayerTreeImpl::begin() { 444 LayerListIterator<LayerImpl> LayerTreeImpl::begin() {
445 return LayerListIterator(root_layer_); 445 return LayerListIterator<LayerImpl>(root_layer_);
446 } 446 }
447 447
448 LayerListIterator LayerTreeImpl::end() { 448 LayerListIterator<LayerImpl> LayerTreeImpl::end() {
449 return LayerListIterator(nullptr); 449 return LayerListIterator<LayerImpl>(nullptr);
450 } 450 }
451 451
452 LayerListReverseIterator LayerTreeImpl::rbegin() { 452 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rbegin() {
453 return LayerListReverseIterator(root_layer_); 453 return LayerListReverseIterator<LayerImpl>(root_layer_);
454 } 454 }
455 455
456 LayerListReverseIterator LayerTreeImpl::rend() { 456 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rend() {
457 return LayerListReverseIterator(nullptr); 457 return LayerListReverseIterator<LayerImpl>(nullptr);
458 } 458 }
459 459
460 void LayerTreeImpl::AddToElementMap(LayerImpl* layer) { 460 void LayerTreeImpl::AddToElementMap(LayerImpl* layer) {
461 if (!layer->element_id() || !layer->mutable_properties()) 461 if (!layer->element_id() || !layer->mutable_properties())
462 return; 462 return;
463 463
464 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), 464 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
465 "LayerTreeImpl::AddToElementMap", "element_id", 465 "LayerTreeImpl::AddToElementMap", "element_id",
466 layer->element_id(), "layer_id", layer->id()); 466 layer->element_id(), "layer_id", layer->id());
467 467
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 } 2108 }
2109 2109
2110 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { 2110 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) {
2111 layers_that_should_push_properties_.clear(); 2111 layers_that_should_push_properties_.clear();
2112 for (auto* layer : *this) 2112 for (auto* layer : *this)
2113 layer->ResetChangeTracking(); 2113 layer->ResetChangeTracking();
2114 property_trees_.ResetAllChangeTracking(flag); 2114 property_trees_.ResetAllChangeTracking(flag);
2115 } 2115 }
2116 2116
2117 } // namespace cc 2117 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698