Commit 1ad53a56 authored by marcheu's avatar marcheu Committed by Commit bot

Fix refresh rate query for internal monitors

GetSelectedModeForDisplayId doesn't work for internal displays. This
results in failing the query, and falling back to refresh rate
approximation in the scheduler. To fix this, we use
GetActiveModeForDisplayId which exists even on internal displays.
This fixes the swap interval that the cc scheduler sees.

BUG=chromium:415359
TEST=make a trace on pixel, look at interval_us, it is a constant 16677 now (before it was variable and inaccurate)

Review URL: https://codereview.chromium.org/582543002

Cr-Commit-Position: refs/heads/master@{#295505}
parent 07a803b3
...@@ -127,9 +127,9 @@ void SetDisplayPropertiesOnHost(AshWindowTreeHost* ash_host, ...@@ -127,9 +127,9 @@ void SetDisplayPropertiesOnHost(AshWindowTreeHost* ash_host,
CreateRootWindowTransformerForDisplay(host->window(), display)); CreateRootWindowTransformerForDisplay(host->window(), display));
ash_host->SetRootWindowTransformer(transformer.Pass()); ash_host->SetRootWindowTransformer(transformer.Pass());
DisplayMode mode; DisplayMode mode =
if (GetDisplayManager()->GetSelectedModeForDisplayId(display.id(), &mode) && GetDisplayManager()->GetActiveModeForDisplayId(display.id());
mode.refresh_rate > 0.0f) { if (mode.refresh_rate > 0.0f) {
host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval( host->compositor()->vsync_manager()->SetAuthoritativeVSyncInterval(
base::TimeDelta::FromMicroseconds( base::TimeDelta::FromMicroseconds(
base::Time::kMicrosecondsPerSecond / mode.refresh_rate)); base::Time::kMicrosecondsPerSecond / mode.refresh_rate));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment