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

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 375093002: Initial attempt at counting layers in the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add UMA for number of layers in a compositor frame 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 | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')
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 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 // When a SwapPromiseMonitor is created on the impl thread, it calls 457 // When a SwapPromiseMonitor is created on the impl thread, it calls
458 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. 458 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl.
459 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() 459 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor()
460 // to unregister itself. 460 // to unregister itself.
461 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); 461 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor);
462 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); 462 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor);
463 463
464 void RegisterPictureLayerImpl(PictureLayerImpl* layer); 464 void RegisterPictureLayerImpl(PictureLayerImpl* layer);
465 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); 465 void UnregisterPictureLayerImpl(PictureLayerImpl* layer);
466 466
467 // Public only for for unit testing
danakj 2014/07/10 18:03:41 comments are full sentences with periods
468 size_t num_layers_for_testing() { return num_layers_; }
469
467 protected: 470 protected:
468 LayerTreeHostImpl( 471 LayerTreeHostImpl(
469 const LayerTreeSettings& settings, 472 const LayerTreeSettings& settings,
470 LayerTreeHostImplClient* client, 473 LayerTreeHostImplClient* client,
471 Proxy* proxy, 474 Proxy* proxy,
472 RenderingStatsInstrumentation* rendering_stats_instrumentation, 475 RenderingStatsInstrumentation* rendering_stats_instrumentation,
473 SharedBitmapManager* manager, 476 SharedBitmapManager* manager,
474 int id); 477 int id);
475 478
476 gfx::SizeF ComputeInnerViewportContainerSize() const; 479 gfx::SizeF ComputeInnerViewportContainerSize() const;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 692
690 SharedBitmapManager* shared_bitmap_manager_; 693 SharedBitmapManager* shared_bitmap_manager_;
691 int id_; 694 int id_;
692 695
693 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 696 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
694 697
695 size_t transfer_buffer_memory_limit_; 698 size_t transfer_buffer_memory_limit_;
696 699
697 std::vector<PictureLayerImpl*> picture_layers_; 700 std::vector<PictureLayerImpl*> picture_layers_;
698 701
702 // The number of layers on the most recent frame,
703 // whether or not they were drawn.
704 // Default value is 0.
705 size_t num_layers_;
dneto 2014/07/10 01:29:03 Not sure if size_t is appropriate here, or overkil
Ian Vollick 2014/07/10 03:16:23 I agree that this is overkill, but there's no harm
danakj 2014/07/10 18:03:41 "unsigned" is generally banned. You'd use an int o
dneto 2014/07/10 18:44:16 Acknowledged.
dneto 2014/07/10 18:44:17 Acknowledged.
706
699 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 707 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
700 }; 708 };
701 709
702 } // namespace cc 710 } // namespace cc
703 711
704 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 712 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698