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

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

Issue 138903025: Read compositor VSync information from platform, when possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 54ddbacb Rebase. Created 6 years, 10 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 | Annotate | Revision Log
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 <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 void Compositor::RemoveObserver(CompositorObserver* observer) { 424 void Compositor::RemoveObserver(CompositorObserver* observer) {
425 observer_list_.RemoveObserver(observer); 425 observer_list_.RemoveObserver(observer);
426 } 426 }
427 427
428 bool Compositor::HasObserver(CompositorObserver* observer) { 428 bool Compositor::HasObserver(CompositorObserver* observer) {
429 return observer_list_.HasObserver(observer); 429 return observer_list_.HasObserver(observer);
430 } 430 }
431 431
432 void Compositor::OnUpdateVSyncParameters(base::TimeTicks timebase, 432 void Compositor::OnUpdateVSyncParameters(base::TimeTicks timebase,
433 base::TimeDelta interval) { 433 base::TimeDelta interval,
434 FOR_EACH_OBSERVER(CompositorObserver, 434 bool interval_is_authoritative) {
435 observer_list_, 435 if (interval_is_authoritative) {
436 OnUpdateVSyncParameters(this, timebase, interval)); 436 authoritative_vsync_interval_ = interval;
437 } else {
438 if (authoritative_vsync_interval_ != base::TimeDelta())
439 interval = authoritative_vsync_interval_;
440 }
brianderson 2014/02/03 22:56:04 The if/else above means that we always set overwri
sheu 2014/02/03 23:02:40 Yes this is intentional. The idea is that we can
brianderson 2014/02/04 01:39:51 How is the interval inaccurate? Is there a way to
441
442 if (!timebase.is_null()) {
brianderson 2014/02/03 22:56:04 Is this check actually needed? On Windows, we cur
sheu 2014/02/03 23:02:40 Would it make more sense to add to the ui::Composi
443 FOR_EACH_OBSERVER(CompositorObserver,
444 observer_list_,
445 OnUpdateVSyncParameters(this, timebase, interval));
446 }
437 } 447 }
438 448
439 void Compositor::Layout() { 449 void Compositor::Layout() {
440 // We're sending damage that will be addressed during this composite 450 // We're sending damage that will be addressed during this composite
441 // cycle, so we don't need to schedule another composite to address it. 451 // cycle, so we don't need to schedule another composite to address it.
442 disable_schedule_composite_ = true; 452 disable_schedule_composite_ = true;
443 if (root_layer_) 453 if (root_layer_)
444 root_layer_->SendDamagedRects(); 454 root_layer_->SendDamagedRects();
445 disable_schedule_composite_ = false; 455 disable_schedule_composite_ = false;
446 } 456 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 // CompositorObservers to be notified before starting another 567 // CompositorObservers to be notified before starting another
558 // draw cycle. 568 // draw cycle.
559 ScheduleDraw(); 569 ScheduleDraw();
560 } 570 }
561 FOR_EACH_OBSERVER(CompositorObserver, 571 FOR_EACH_OBSERVER(CompositorObserver,
562 observer_list_, 572 observer_list_,
563 OnCompositingEnded(this)); 573 OnCompositingEnded(this));
564 } 574 }
565 575
566 } // namespace ui 576 } // namespace ui
OLDNEW
« ash/display/display_controller.cc ('K') | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698