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

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

Issue 12519006: cc:: Add RenderingStatsInstrumentation to manage collection of RenderingStats (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated all tests Created 7 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/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host.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 #ifndef CC_TREES_LAYER_TREE_HOST_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_
6 #define CC_TREES_LAYER_TREE_HOST_H_ 6 #define CC_TREES_LAYER_TREE_HOST_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/cancelable_callback.h" 11 #include "base/cancelable_callback.h"
12 #include "base/hash_tables.h" 12 #include "base/hash_tables.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "cc/animation/animation_events.h" 17 #include "cc/animation/animation_events.h"
18 #include "cc/base/cc_export.h" 18 #include "cc/base/cc_export.h"
19 #include "cc/base/scoped_ptr_vector.h" 19 #include "cc/base/scoped_ptr_vector.h"
20 #include "cc/debug/rendering_stats.h"
21 #include "cc/output/output_surface.h" 20 #include "cc/output/output_surface.h"
22 #include "cc/scheduler/rate_limiter.h" 21 #include "cc/scheduler/rate_limiter.h"
23 #include "cc/trees/layer_tree_host_client.h" 22 #include "cc/trees/layer_tree_host_client.h"
24 #include "cc/trees/layer_tree_host_common.h" 23 #include "cc/trees/layer_tree_host_common.h"
25 #include "cc/trees/layer_tree_settings.h" 24 #include "cc/trees/layer_tree_settings.h"
26 #include "cc/trees/occlusion_tracker.h" 25 #include "cc/trees/occlusion_tracker.h"
27 #include "cc/trees/proxy.h" 26 #include "cc/trees/proxy.h"
28 #include "skia/ext/refptr.h" 27 #include "skia/ext/refptr.h"
29 #include "third_party/skia/include/core/SkColor.h" 28 #include "third_party/skia/include/core/SkColor.h"
30 #include "third_party/skia/include/core/SkPicture.h" 29 #include "third_party/skia/include/core/SkPicture.h"
(...skipping 13 matching lines...) Expand all
44 namespace cc { 43 namespace cc {
45 44
46 class AnimationRegistrar; 45 class AnimationRegistrar;
47 class HeadsUpDisplayLayer; 46 class HeadsUpDisplayLayer;
48 class Layer; 47 class Layer;
49 class LayerTreeHostImpl; 48 class LayerTreeHostImpl;
50 class LayerTreeHostImplClient; 49 class LayerTreeHostImplClient;
51 class PrioritizedResourceManager; 50 class PrioritizedResourceManager;
52 class PrioritizedResource; 51 class PrioritizedResource;
53 class Region; 52 class Region;
53 class RenderingStatsInstrumentation;
54 class ResourceProvider; 54 class ResourceProvider;
55 class ResourceUpdateQueue; 55 class ResourceUpdateQueue;
56 class ScrollbarLayer; 56 class ScrollbarLayer;
57 class TopControlsManager; 57 class TopControlsManager;
58 struct RenderingStats;
58 struct ScrollAndScaleSet; 59 struct ScrollAndScaleSet;
59 60
60 // Provides information on an Impl's rendering capabilities back to the 61 // Provides information on an Impl's rendering capabilities back to the
61 // LayerTreeHost. 62 // LayerTreeHost.
62 struct CC_EXPORT RendererCapabilities { 63 struct CC_EXPORT RendererCapabilities {
63 RendererCapabilities(); 64 RendererCapabilities();
64 ~RendererCapabilities(); 65 ~RendererCapabilities();
65 66
66 unsigned best_texture_format; 67 unsigned best_texture_format;
67 bool using_partial_swap; 68 bool using_partial_swap;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 142
142 void SetDeferCommits(bool defer_commits); 143 void SetDeferCommits(bool defer_commits);
143 144
144 // Test only hook 145 // Test only hook
145 virtual void DidDeferCommit(); 146 virtual void DidDeferCommit();
146 147
147 int commit_number() const { return commit_number_; } 148 int commit_number() const { return commit_number_; }
148 149
149 void CollectRenderingStats(RenderingStats* stats) const; 150 void CollectRenderingStats(RenderingStats* stats) const;
150 151
152 RenderingStatsInstrumentation* rendering_stats_instrumentation() const {
153 return rendering_stats_instrumentation_.get();
154 }
155
151 const RendererCapabilities& GetRendererCapabilities() const; 156 const RendererCapabilities& GetRendererCapabilities() const;
152 157
153 void SetNeedsAnimate(); 158 void SetNeedsAnimate();
154 virtual void SetNeedsCommit(); 159 virtual void SetNeedsCommit();
155 virtual void SetNeedsFullTreeSync(); 160 virtual void SetNeedsFullTreeSync();
156 void SetNeedsRedraw(); 161 void SetNeedsRedraw();
157 bool CommitRequested() const; 162 bool CommitRequested() const;
158 163
159 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, 164 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> events,
160 base::Time wall_clock_time); 165 base::Time wall_clock_time);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 245
241 private: 246 private:
242 typedef std::vector<scoped_refptr<Layer> > LayerList; 247 typedef std::vector<scoped_refptr<Layer> > LayerList;
243 248
244 bool InitializeProxy(scoped_ptr<Proxy> proxy); 249 bool InitializeProxy(scoped_ptr<Proxy> proxy);
245 void InitializeRenderer(); 250 void InitializeRenderer();
246 251
247 bool PaintLayerContents(const LayerList& render_surface_layer_list, 252 bool PaintLayerContents(const LayerList& render_surface_layer_list,
248 ResourceUpdateQueue* quue); 253 ResourceUpdateQueue* quue);
249 bool PaintMasksForRenderSurface(Layer* render_surface_layer, 254 bool PaintMasksForRenderSurface(Layer* render_surface_layer,
250 ResourceUpdateQueue* queue); 255 ResourceUpdateQueue* queue,
256 RenderingStats* stats);
251 257
252 void UpdateLayers(Layer* root_layer, ResourceUpdateQueue* queue); 258 void UpdateLayers(Layer* root_layer, ResourceUpdateQueue* queue);
253 void UpdateHudLayer(); 259 void UpdateHudLayer();
254 void TriggerPrepaint(); 260 void TriggerPrepaint();
255 261
256 void PrioritizeTextures(const LayerList& render_surface_layer_list, 262 void PrioritizeTextures(const LayerList& render_surface_layer_list,
257 OverdrawMetrics* metrics); 263 OverdrawMetrics* metrics);
258 void SetPrioritiesForSurfaces(size_t surface_memory_bytes); 264 void SetPrioritiesForSurfaces(size_t surface_memory_bytes);
259 void SetPrioritiesForLayers(const LayerList& update_list); 265 void SetPrioritiesForLayers(const LayerList& update_list);
260 size_t CalculateMemoryForRenderSurfaces(const LayerList& update_list); 266 size_t CalculateMemoryForRenderSurfaces(const LayerList& update_list);
261 267
262 void AnimateLayers(base::TimeTicks monotonic_time); 268 void AnimateLayers(base::TimeTicks monotonic_time);
263 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); 269 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time);
264 void SetAnimationEventsRecursive(const AnimationEventsVector& events, 270 void SetAnimationEventsRecursive(const AnimationEventsVector& events,
265 Layer* layer, 271 Layer* layer,
266 base::Time wall_clock_time); 272 base::Time wall_clock_time);
267 273
268 bool animating_; 274 bool animating_;
269 bool needs_full_tree_sync_; 275 bool needs_full_tree_sync_;
270 bool needs_filter_context_; 276 bool needs_filter_context_;
271 277
272 base::CancelableClosure prepaint_callback_; 278 base::CancelableClosure prepaint_callback_;
273 279
274 LayerTreeHostClient* client_; 280 LayerTreeHostClient* client_;
275 scoped_ptr<Proxy> proxy_; 281 scoped_ptr<Proxy> proxy_;
276 282
277 int commit_number_; 283 int commit_number_;
278 RenderingStats rendering_stats_; 284 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_;
279 285
280 bool renderer_initialized_; 286 bool renderer_initialized_;
281 bool output_surface_lost_; 287 bool output_surface_lost_;
282 int num_failed_recreate_attempts_; 288 int num_failed_recreate_attempts_;
283 289
284 scoped_refptr<Layer> root_layer_; 290 scoped_refptr<Layer> root_layer_;
285 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; 291 scoped_refptr<HeadsUpDisplayLayer> hud_layer_;
286 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_horizontal_; 292 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_horizontal_;
287 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_vertical_; 293 scoped_refptr<ScrollbarLayer> pinch_zoom_scrollbar_vertical_;
288 294
(...skipping 27 matching lines...) Expand all
316 size_t partial_texture_update_requests_; 322 size_t partial_texture_update_requests_;
317 323
318 scoped_ptr<AnimationRegistrar> animation_registrar_; 324 scoped_ptr<AnimationRegistrar> animation_registrar_;
319 325
320 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 326 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
321 }; 327 };
322 328
323 } // namespace cc 329 } // namespace cc
324 330
325 #endif // CC_TREES_LAYER_TREE_HOST_H_ 331 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698