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

Unified Diff: ui/gl/init/gl_factory_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 | « ui/gl/init/gl_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_factory_win.cc
diff --git a/ui/gl/init/gl_factory_win.cc b/ui/gl/init/gl_factory_win.cc
index da07adc39bdad5f9fded0ed160b98cc7f53ba98c..198147d3f572308889f9522dcac87b5fd754443a 100644
--- a/ui/gl/init/gl_factory_win.cc
+++ b/ui/gl/init/gl_factory_win.cc
@@ -82,15 +82,9 @@ scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) {
return InitializeGLSurface(new GLSurfaceOSMesaWin(window));
case kGLImplementationSwiftShaderGL:
case kGLImplementationEGLGLES2: {
- DCHECK(window != gfx::kNullAcceleratedWidget);
- scoped_refptr<NativeViewGLSurfaceEGL> surface(
- new NativeViewGLSurfaceEGL(window));
- std::unique_ptr<gfx::VSyncProvider> sync_provider;
- sync_provider.reset(new VSyncProviderWin(window));
- if (!surface->Initialize(std::move(sync_provider)))
- return nullptr;
-
- return surface;
+ std::unique_ptr<gfx::VSyncProvider> sync_provider(
+ new VSyncProviderWin(window));
+ return CreateNativeViewGLSurfaceEGL(window, std::move(sync_provider));
}
case kGLImplementationDesktopGL:
return InitializeGLSurface(new NativeViewGLSurfaceWGL(window));
@@ -103,6 +97,21 @@ scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) {
}
}
+scoped_refptr<GLSurface> CreateNativeViewGLSurfaceEGL(
+ gfx::AcceleratedWidget window,
+ std::unique_ptr<gfx::VSyncProvider> sync_provider) {
+ DCHECK_EQ(kGLImplementationEGLGLES2, GetGLImplementation());
+ DCHECK(window != gfx::kNullAcceleratedWidget);
+
+ scoped_refptr<NativeViewGLSurfaceEGL> surface(
+ new NativeViewGLSurfaceEGL(window));
+
+ if (!surface->Initialize(std::move(sync_provider)))
+ return nullptr;
+
+ return surface;
+}
+
scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
const gfx::Size& size, GLSurfaceFormat format) {
TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface");
« no previous file with comments | « ui/gl/init/gl_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698