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

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

Issue 375093002: Initial attempt at counting layers in the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment in histograms.xml to say the stat is collected once per frame, before the frame is d… Created 6 years, 5 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/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 <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { 554 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) {
555 DCHECK(!LayerById(layer->id())); 555 DCHECK(!LayerById(layer->id()));
556 layer_id_map_[layer->id()] = layer; 556 layer_id_map_[layer->id()] = layer;
557 } 557 }
558 558
559 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { 559 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) {
560 DCHECK(LayerById(layer->id())); 560 DCHECK(LayerById(layer->id()));
561 layer_id_map_.erase(layer->id()); 561 layer_id_map_.erase(layer->id());
562 } 562 }
563 563
564 size_t LayerTreeImpl::NumLayers() {
565 return layer_id_map_.size();
566 }
567
564 void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) { 568 void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) {
565 pending_tree->SetCurrentlyScrollingLayer( 569 pending_tree->SetCurrentlyScrollingLayer(
566 LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(), 570 LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(),
567 currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0)); 571 currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0));
568 } 572 }
569 573
570 static void DidBecomeActiveRecursive(LayerImpl* layer) { 574 static void DidBecomeActiveRecursive(LayerImpl* layer) {
571 layer->DidBecomeActive(); 575 layer->DidBecomeActive();
572 for (size_t i = 0; i < layer->children().size(); ++i) 576 for (size_t i = 0; i < layer->children().size(); ++i)
573 DidBecomeActiveRecursive(layer->children()[i]); 577 DidBecomeActiveRecursive(layer->children()[i]);
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 1375
1372 void LayerTreeImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 1376 void LayerTreeImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
1373 layer_tree_host_impl_->UnregisterPictureLayerImpl(layer); 1377 layer_tree_host_impl_->UnregisterPictureLayerImpl(layer);
1374 } 1378 }
1375 1379
1376 void LayerTreeImpl::InputScrollAnimationFinished() { 1380 void LayerTreeImpl::InputScrollAnimationFinished() {
1377 layer_tree_host_impl_->ScrollEnd(); 1381 layer_tree_host_impl_->ScrollEnd();
1378 } 1382 }
1379 1383
1380 } // namespace cc 1384 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/layer_tree_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698