| Index: ui/surface/accelerated_surface_win.cc
|
| diff --git a/ui/surface/accelerated_surface_win.cc b/ui/surface/accelerated_surface_win.cc
|
| index f346dbeadd6bd83750afd0d462c434c349a124ce..a8b57c5a450fa02e20df2505dcc2bbdc279da3ab 100644
|
| --- a/ui/surface/accelerated_surface_win.cc
|
| +++ b/ui/surface/accelerated_surface_win.cc
|
| @@ -28,6 +28,7 @@
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "ui/base/win/shell.h"
|
| #include "ui/events/latency_info.h"
|
| +#include "ui/gfx/frame_time.h"
|
| #include "ui/gfx/rect.h"
|
| #include "ui/gfx/win/dpi.h"
|
| #include "ui/gfx/win/hwnd_util.h"
|
| @@ -877,18 +878,22 @@ void AcceleratedPresenter::DoPresentAndAcknowledge(
|
| if (raster_status.InVBlank)
|
| clamped_scanline = display_mode.Height;
|
|
|
| - base::TimeTicks current_time = base::TimeTicks::HighResNow();
|
| -
|
| // Figure out approximately how far back in time the last vsync was based on
|
| // the ratio of the raster scanline to the display height.
|
| base::TimeTicks last_vsync_time;
|
| base::TimeDelta refresh_period;
|
| +
|
| if (display_mode.Height) {
|
| + refresh_period = base::TimeDelta::FromMicroseconds(
|
| + 1000000 / display_mode.RefreshRate);
|
| + // If FrameTime is not high resolution, we use a timebase of zero to avoid
|
| + // introducing jitter into our frame start times.
|
| + if (gfx::FrameTime::TimestampsAreHighRes()) {
|
| + base::TimeTicks current_time = gfx::FrameTime::Now();
|
| last_vsync_time = current_time -
|
| base::TimeDelta::FromMilliseconds((clamped_scanline * 1000) /
|
| (display_mode.RefreshRate * display_mode.Height));
|
| - refresh_period = base::TimeDelta::FromMicroseconds(
|
| - 1000000 / display_mode.RefreshRate);
|
| + }
|
| }
|
|
|
| // Wait for the StretchRect to complete before notifying the GPU process
|
|
|