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

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: 287efe04 Rebase, oshima@ nits. 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
« no previous file with comments | « ash/display/display_change_observer_chromeos_unittest.cc ('k') | ash/display/display_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller.cc
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 0633d12ddd9e000b591adaa4c9dacccc34e2b6bd..031a6b1d9c5d15a107f3938c2bb7249739f78b1c 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -34,6 +34,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"
@@ -120,6 +121,14 @@ 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) &&
+ mode.refresh_rate > 0.0f) {
+ root->host()->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval(
+ base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond /
+ mode.refresh_rate));
+ }
}
} // namespace
« no previous file with comments | « ash/display/display_change_observer_chromeos_unittest.cc ('k') | ash/display/display_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698