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

Side by Side Diff: ui/compositor/compositor.h

Issue 2631333002: [animations] Adds metrics for jank on selected layer animations (Closed)
Patch Set: Adds UMA reporting for ripples and overview mode (query refresh rate) Created 3 years, 11 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 | « tools/metrics/histograms/histograms.xml ('k') | ui/compositor/compositor.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_COMPOSITOR_COMPOSITOR_H_ 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_
6 #define UI_COMPOSITOR_COMPOSITOR_H_ 6 #define UI_COMPOSITOR_COMPOSITOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 373
374 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; 374 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const;
375 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); 375 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state);
376 const cc::RendererSettings& GetRendererSettings() const; 376 const cc::RendererSettings& GetRendererSettings() const;
377 377
378 LayerAnimatorCollection* layer_animator_collection() { 378 LayerAnimatorCollection* layer_animator_collection() {
379 return &layer_animator_collection_; 379 return &layer_animator_collection_;
380 } 380 }
381 381
382 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 382 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
383 int committed_frame_number() const { return committed_frame_number_; }
384 float refresh_rate() const { return refresh_rate_; }
383 385
384 private: 386 private:
385 friend class base::RefCounted<Compositor>; 387 friend class base::RefCounted<Compositor>;
386 friend class CompositorLock; 388 friend class CompositorLock;
387 389
388 // Called by CompositorLock. 390 // Called by CompositorLock.
389 void UnlockCompositor(); 391 void UnlockCompositor();
390 392
391 // Called to release any pending CompositorLock 393 // Called to release any pending CompositorLock
392 void CancelCompositorLock(); 394 void CancelCompositorLock();
393 395
394 gfx::Size size_; 396 gfx::Size size_;
395 397
396 ui::ContextFactory* context_factory_; 398 ui::ContextFactory* context_factory_;
397 ui::ContextFactoryPrivate* context_factory_private_; 399 ui::ContextFactoryPrivate* context_factory_private_;
398 400
399 // The root of the Layer tree drawn by this compositor. 401 // The root of the Layer tree drawn by this compositor.
400 Layer* root_layer_; 402 Layer* root_layer_;
401 403
402 base::ObserverList<CompositorObserver, true> observer_list_; 404 base::ObserverList<CompositorObserver, true> observer_list_;
403 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; 405 base::ObserverList<CompositorAnimationObserver> animation_observer_list_;
404 406
405 gfx::AcceleratedWidget widget_; 407 gfx::AcceleratedWidget widget_;
408 // A sequence number of a current compositor frame for use with metrics.
409 int committed_frame_number_;
410
411 // current VSYNC refresh rate per second.
412 float refresh_rate_;
413
406 // A map from child id to parent id. 414 // A map from child id to parent id.
407 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash> child_frame_sinks_; 415 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash> child_frame_sinks_;
408 bool widget_valid_; 416 bool widget_valid_;
409 bool compositor_frame_sink_requested_; 417 bool compositor_frame_sink_requested_;
410 const cc::FrameSinkId frame_sink_id_; 418 const cc::FrameSinkId frame_sink_id_;
411 scoped_refptr<cc::Layer> root_web_layer_; 419 scoped_refptr<cc::Layer> root_web_layer_;
412 std::unique_ptr<cc::AnimationHost> animation_host_; 420 std::unique_ptr<cc::AnimationHost> animation_host_;
413 std::unique_ptr<cc::LayerTreeHost> host_; 421 std::unique_ptr<cc::LayerTreeHost> host_;
414 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 422 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
415 423
(...skipping 14 matching lines...) Expand all
430 gfx::ColorSpace color_space_; 438 gfx::ColorSpace color_space_;
431 439
432 base::WeakPtrFactory<Compositor> weak_ptr_factory_; 440 base::WeakPtrFactory<Compositor> weak_ptr_factory_;
433 441
434 DISALLOW_COPY_AND_ASSIGN(Compositor); 442 DISALLOW_COPY_AND_ASSIGN(Compositor);
435 }; 443 };
436 444
437 } // namespace ui 445 } // namespace ui
438 446
439 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 447 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698