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

Unified Diff: gpu/ipc/service/gpu_vsync_provider_win.cc

Issue 2710183004: Support GPU VSync when DirectComposition isn't enabled (Closed)
Patch Set: Created 3 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 | « no previous file | gpu/ipc/service/image_transport_surface_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_vsync_provider_win.cc
diff --git a/gpu/ipc/service/gpu_vsync_provider_win.cc b/gpu/ipc/service/gpu_vsync_provider_win.cc
index 97eb39494530ea17714a9963382c002847b22d6c..dccb12248e123f7336f6f013324d3a6e37e9d151 100644
--- a/gpu/ipc/service/gpu_vsync_provider_win.cc
+++ b/gpu/ipc/service/gpu_vsync_provider_win.cc
@@ -190,11 +190,12 @@ void GpuVSyncWorker::WaitForVSyncOnThread() {
OpenAdapter(monitor_info.szDevice);
}
- if (WaitForVBlankEvent()) {
- vsync_provider_->GetVSyncParameters(
- base::Bind(&GpuVSyncWorker::SendVSyncUpdate, base::Unretained(this),
- base::TimeTicks::Now()));
- }
+ // Crash if WaitForVBlankEvent fails to avoid spinning the loop.
+ CHECK(WaitForVBlankEvent());
+
+ vsync_provider_->GetVSyncParameters(
+ base::Bind(&GpuVSyncWorker::SendVSyncUpdate, base::Unretained(this),
+ base::TimeTicks::Now()));
Reschedule();
}
@@ -209,7 +210,7 @@ void GpuVSyncWorker::SendVSyncUpdate(base::TimeTicks now,
// be up to 2-3 vsync cycles in the past or in the future.
// The adjustment formula was suggested here:
// http://www.vsynctester.com/firefoxisbroken.html
- base::TimeDelta adjustment =
+ adjustment =
((now - timestamp + interval / 8) % interval + interval) % interval -
interval / 8;
timestamp = now - adjustment;
« no previous file with comments | « no previous file | gpu/ipc/service/image_transport_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698