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

Unified Diff: ash/display/display_controller.cc

Issue 138903025: Read compositor VSync information from platform, when possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 4b969456 piman@ comments; refactor logic into CompositorVSyncManager 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 side-by-side diff with in-line comments
Download patch
Index: ash/display/display_controller.cc
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 7b7cc5882e5592a336e718a28d2fa3c442bb5215..dabf8d42e7ffd968241cd037abb60861e359ad9b 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -33,6 +33,7 @@
#include "ui/aura/window_property.h"
#include "ui/aura/window_tracker.h"
#include "ui/compositor/compositor.h"
+#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
@@ -119,6 +120,13 @@ void SetDisplayPropertiesOnHostWindow(aura::RootWindow* root,
scoped_ptr<aura::RootWindowTransformer> transformer(
internal::CreateRootWindowTransformerForDisplay(root->window(), display));
root->host()->SetRootWindowTransformer(transformer.Pass());
+
+ internal::DisplayMode mode;
+ if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode)) {
+ root->host()->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval(
+ base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond /
+ mode.refresh_rate));
piman 2014/02/04 04:51:01 I think there's some cases where refresh_rate coul
sheu 2014/02/04 22:01:45 And the div-by-zero. Done.
+ }
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698