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

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

Issue 2631333002: [animations] Adds metrics for jank on selected layer animations (Closed)
Patch Set: Adds UMA reporting for ripples and overview mode (extern constexpr) 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
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 #include "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <deque> 10 #include <deque>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 ui::ContextFactory* context_factory, 76 ui::ContextFactory* context_factory,
77 ui::ContextFactoryPrivate* context_factory_private, 77 ui::ContextFactoryPrivate* context_factory_private,
78 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 78 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
79 : context_factory_(context_factory), 79 : context_factory_(context_factory),
80 context_factory_private_(context_factory_private), 80 context_factory_private_(context_factory_private),
81 root_layer_(NULL), 81 root_layer_(NULL),
82 widget_(gfx::kNullAcceleratedWidget), 82 widget_(gfx::kNullAcceleratedWidget),
83 #if defined(USE_AURA) 83 #if defined(USE_AURA)
84 window_(nullptr), 84 window_(nullptr),
85 #endif 85 #endif
86 submitted_frame_number_(0),
86 widget_valid_(false), 87 widget_valid_(false),
87 compositor_frame_sink_requested_(false), 88 compositor_frame_sink_requested_(false),
88 frame_sink_id_(frame_sink_id), 89 frame_sink_id_(frame_sink_id),
89 task_runner_(task_runner), 90 task_runner_(task_runner),
90 vsync_manager_(new CompositorVSyncManager()), 91 vsync_manager_(new CompositorVSyncManager()),
91 device_scale_factor_(0.0f), 92 device_scale_factor_(0.0f),
92 locks_will_time_out_(true), 93 locks_will_time_out_(true),
93 compositor_lock_(NULL), 94 compositor_lock_(NULL),
94 layer_animator_collection_(this), 95 layer_animator_collection_(this),
95 weak_ptr_factory_(this) { 96 weak_ptr_factory_(this) {
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 for (auto& observer : observer_list_) 518 for (auto& observer : observer_list_)
518 observer.OnCompositingDidCommit(this); 519 observer.OnCompositingDidCommit(this);
519 } 520 }
520 521
521 void Compositor::DidReceiveCompositorFrameAck() { 522 void Compositor::DidReceiveCompositorFrameAck() {
522 for (auto& observer : observer_list_) 523 for (auto& observer : observer_list_)
523 observer.OnCompositingEnded(this); 524 observer.OnCompositingEnded(this);
524 } 525 }
525 526
526 void Compositor::DidSubmitCompositorFrame() { 527 void Compositor::DidSubmitCompositorFrame() {
528 ++submitted_frame_number_;
reveman 2017/01/21 15:27:39 This doesn't mean the frame was displayed. If we s
danakj 2017/01/23 15:52:05 Depends if we wanna measure the production of fram
varkha 2017/01/24 00:18:57 Looking at how WaitForSwap() is implemented I thin
527 base::TimeTicks start_time = base::TimeTicks::Now(); 529 base::TimeTicks start_time = base::TimeTicks::Now();
528 for (auto& observer : observer_list_) 530 for (auto& observer : observer_list_)
529 observer.OnCompositingStarted(this, start_time); 531 observer.OnCompositingStarted(this, start_time);
530 } 532 }
531 533
532 void Compositor::SetOutputIsSecure(bool output_is_secure) { 534 void Compositor::SetOutputIsSecure(bool output_is_secure) {
533 if (context_factory_private_) 535 if (context_factory_private_)
534 context_factory_private_->SetOutputIsSecure(this, output_is_secure); 536 context_factory_private_->SetOutputIsSecure(this, output_is_secure);
535 } 537 }
536 538
(...skipping 27 matching lines...) Expand all
564 for (auto& observer : observer_list_) 566 for (auto& observer : observer_list_)
565 observer.OnCompositingLockStateChanged(this); 567 observer.OnCompositingLockStateChanged(this);
566 } 568 }
567 569
568 void Compositor::CancelCompositorLock() { 570 void Compositor::CancelCompositorLock() {
569 if (compositor_lock_) 571 if (compositor_lock_)
570 compositor_lock_->CancelLock(); 572 compositor_lock_->CancelLock();
571 } 573 }
572 574
573 } // namespace ui 575 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698