Commit 6330c86a authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

gpu: Check for WaitForVBlank failure

WaitForVBlank can fail if D3D11 device is lost.

Also use InMillisecondsRoundedUp in fallback Sleep() call to match
PostDelayedTask() behavior.

Bug: 953970
Change-Id: I129a93b41be553f184682e09b21f83ca8d3aedb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1618264Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661113}
parent 79f71dd9
...@@ -95,11 +95,11 @@ void VSyncThreadWin::WaitForVSync() { ...@@ -95,11 +95,11 @@ void VSyncThreadWin::WaitForVSync() {
} }
} }
if (window_output_) { bool wait_for_vblank_succeeded =
window_output_->WaitForVBlank(); window_output_ && SUCCEEDED(window_output_->WaitForVBlank());
} else {
Sleep(static_cast<DWORD>(interval.InMilliseconds())); if (!wait_for_vblank_succeeded)
} Sleep(static_cast<DWORD>(interval.InMillisecondsRoundedUp()));
base::AutoLock auto_lock(lock_); base::AutoLock auto_lock(lock_);
DCHECK(started_); DCHECK(started_);
......
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