Index: gpu/ipc/service/image_transport_surface_win.cc |
diff --git a/gpu/ipc/service/image_transport_surface_win.cc b/gpu/ipc/service/image_transport_surface_win.cc |
index 7d484e900577fc2d2284d66ce5417d66ab937b2b..5fcaf7f59d3efe036931163335c1ef2761872620 100644 |
--- a/gpu/ipc/service/image_transport_surface_win.cc |
+++ b/gpu/ipc/service/image_transport_surface_win.cc |
@@ -6,19 +6,32 @@ |
#include <memory> |
+#include "base/win/windows_version.h" |
#include "gpu/ipc/service/child_window_surface_win.h" |
#include "gpu/ipc/service/direct_composition_surface_win.h" |
+#include "gpu/ipc/service/gpu_vsync_provider_win.h" |
#include "gpu/ipc/service/pass_through_image_transport_surface.h" |
#include "gpu/ipc/service/switches.h" |
#include "ui/gfx/native_widget_types.h" |
#include "ui/gl/gl_bindings.h" |
#include "ui/gl/gl_implementation.h" |
#include "ui/gl/gl_surface_egl.h" |
+#include "ui/gl/gl_switches.h" |
#include "ui/gl/init/gl_factory.h" |
#include "ui/gl/vsync_provider_win.h" |
namespace gpu { |
+namespace { |
+bool IsGpuVSyncSignalSupported() { |
+ // TODO(stanisc): http://crbug.com/467617 Limit to Windows 8+ for now because |
+ // of locking issue caused by waiting for VSync on Win7. |
+ return base::win::GetVersion() >= base::win::VERSION_WIN8 && |
+ base::FeatureList::IsEnabled(features::kD3DVsync); |
+} |
+ |
+} // namespace |
+ |
// static |
scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface( |
base::WeakPtr<ImageTransportSurfaceDelegate> delegate, |
@@ -29,8 +42,13 @@ scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface( |
scoped_refptr<gl::GLSurface> surface; |
if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2 && |
gl::GLSurfaceEGL::IsDirectCompositionSupported()) { |
- std::unique_ptr<gfx::VSyncProvider> vsync_provider( |
- new gl::VSyncProviderWin(surface_handle)); |
+ std::unique_ptr<gfx::VSyncProvider> vsync_provider; |
+ |
+ if (IsGpuVSyncSignalSupported()) |
+ vsync_provider.reset(new GpuVSyncProviderWin(delegate, surface_handle)); |
+ else |
+ vsync_provider.reset(new gl::VSyncProviderWin(surface_handle)); |
+ |
if (base::FeatureList::IsEnabled(switches::kDirectCompositionOverlays)) { |
scoped_refptr<DirectCompositionSurfaceWin> egl_surface = |
make_scoped_refptr( |