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

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

Issue 1887703002: cc: Add a main thread LayerListIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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_host.h" 5 #include "cc/trees/layer_tree_host.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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 bool LayerTreeHost::UpdateLayers() { 891 bool LayerTreeHost::UpdateLayers() {
892 DCHECK(!output_surface_lost_); 892 DCHECK(!output_surface_lost_);
893 if (!root_layer()) 893 if (!root_layer())
894 return false; 894 return false;
895 DCHECK(!root_layer()->parent()); 895 DCHECK(!root_layer()->parent());
896 bool result = DoUpdateLayers(root_layer()); 896 bool result = DoUpdateLayers(root_layer());
897 micro_benchmark_controller_.DidUpdateLayers(); 897 micro_benchmark_controller_.DidUpdateLayers();
898 return result || next_commit_forces_redraw_; 898 return result || next_commit_forces_redraw_;
899 } 899 }
900 900
901 LayerListIterator<Layer> LayerTreeHost::begin() {
902 return LayerListIterator<Layer>(root_layer_.get());
903 }
904
905 LayerListIterator<Layer> LayerTreeHost::end() {
906 return LayerListIterator<Layer>(nullptr);
907 }
908
909 LayerListReverseIterator<Layer> LayerTreeHost::rbegin() {
910 return LayerListReverseIterator<Layer>(root_layer_.get());
911 }
912
913 LayerListReverseIterator<Layer> LayerTreeHost::rend() {
914 return LayerListReverseIterator<Layer>(nullptr);
915 }
916
901 void LayerTreeHost::DidCompletePageScaleAnimation() { 917 void LayerTreeHost::DidCompletePageScaleAnimation() {
902 did_complete_scale_animation_ = true; 918 did_complete_scale_animation_ = true;
903 } 919 }
904 920
905 static Layer* FindFirstScrollableLayer(Layer* layer) { 921 static Layer* FindFirstScrollableLayer(Layer* layer) {
906 if (!layer) 922 if (!layer)
907 return NULL; 923 return NULL;
908 924
909 if (layer->scrollable()) 925 if (layer->scrollable())
910 return layer; 926 return layer;
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 int seq_num = property_trees_.sequence_number; 1647 int seq_num = property_trees_.sequence_number;
1632 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { 1648 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) {
1633 layer->set_property_tree_sequence_number(seq_num); 1649 layer->set_property_tree_sequence_number(seq_num);
1634 }); 1650 });
1635 1651
1636 surface_id_namespace_ = proto.surface_id_namespace(); 1652 surface_id_namespace_ = proto.surface_id_namespace();
1637 next_surface_sequence_ = proto.next_surface_sequence(); 1653 next_surface_sequence_ = proto.next_surface_sequence();
1638 } 1654 }
1639 1655
1640 } // namespace cc 1656 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698