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

Unified Diff: gpu/ipc/service/image_transport_surface_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 | « gpu/ipc/service/gpu_vsync_provider_win.cc ('k') | ui/gl/init/gl_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5fcaf7f59d3efe036931163335c1ef2761872620..236c42c38bc18fbac8f92adeda8fff848f121478 100644
--- a/gpu/ipc/service/image_transport_surface_win.cc
+++ b/gpu/ipc/service/image_transport_surface_win.cc
@@ -40,8 +40,7 @@ scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(
DCHECK_NE(surface_handle, kNullSurfaceHandle);
scoped_refptr<gl::GLSurface> surface;
- if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2 &&
- gl::GLSurfaceEGL::IsDirectCompositionSupported()) {
+ if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2) {
std::unique_ptr<gfx::VSyncProvider> vsync_provider;
if (IsGpuVSyncSignalSupported())
@@ -49,19 +48,26 @@ scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(
else
vsync_provider.reset(new gl::VSyncProviderWin(surface_handle));
- if (base::FeatureList::IsEnabled(switches::kDirectCompositionOverlays)) {
- scoped_refptr<DirectCompositionSurfaceWin> egl_surface =
- make_scoped_refptr(
- new DirectCompositionSurfaceWin(delegate, surface_handle));
- if (!egl_surface->Initialize(std::move(vsync_provider)))
- return nullptr;
- surface = egl_surface;
+ if (gl::GLSurfaceEGL::IsDirectCompositionSupported()) {
+ if (base::FeatureList::IsEnabled(switches::kDirectCompositionOverlays)) {
+ scoped_refptr<DirectCompositionSurfaceWin> egl_surface =
+ make_scoped_refptr(
+ new DirectCompositionSurfaceWin(delegate, surface_handle));
+ if (!egl_surface->Initialize(std::move(vsync_provider)))
+ return nullptr;
+ surface = egl_surface;
+ } else {
+ scoped_refptr<ChildWindowSurfaceWin> egl_surface = make_scoped_refptr(
+ new ChildWindowSurfaceWin(delegate, surface_handle));
+ if (!egl_surface->Initialize(std::move(vsync_provider)))
+ return nullptr;
+ surface = egl_surface;
+ }
} else {
- scoped_refptr<ChildWindowSurfaceWin> egl_surface = make_scoped_refptr(
- new ChildWindowSurfaceWin(delegate, surface_handle));
- if (!egl_surface->Initialize(std::move(vsync_provider)))
+ surface = gl::init::CreateNativeViewGLSurfaceEGL(
+ surface_handle, std::move(vsync_provider));
+ if (!surface)
return nullptr;
- surface = egl_surface;
}
} else {
surface = gl::init::CreateViewGLSurface(surface_handle);
« no previous file with comments | « gpu/ipc/service/gpu_vsync_provider_win.cc ('k') | ui/gl/init/gl_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698