diff options
Diffstat (limited to 'src/core/gl_context_qt.cpp')
-rw-r--r-- | src/core/gl_context_qt.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp index 6aec2d3b3..e1255219d 100644 --- a/src/core/gl_context_qt.cpp +++ b/src/core/gl_context_qt.cpp @@ -41,11 +41,16 @@ #include <QThread> #include <qpa/qplatformnativeinterface.h> #include "ui/gl/gl_context_egl.h" +#include "ui/gl/gl_implementation.h" #if defined(USE_X11) #include <X11/Xlib.h> #endif +#if defined(OS_WIN) +#include "ui/gl/gl_context_wgl.h" +#endif + QT_BEGIN_NAMESPACE Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); @@ -135,7 +140,16 @@ namespace gfx { scoped_refptr<GLContext> GLContext::CreateGLContext(GLShareGroup* share_group, GLSurface* compatible_surface, GpuPreference gpu_preference) { - scoped_refptr<GLContext> context(new GLContextEGL(share_group)); +#if defined(OS_WIN) + scoped_refptr<GLContext> context; + if (GetGLImplementation() == kGLImplementationDesktopGL) + context = new GLContextWGL(share_group); + else + context = new GLContextEGL(share_group); +#else + scoped_refptr<GLContext> context = new GLContextEGL(share_group); +#endif + if (!GLContextHelper::initializeContext(context.get(), compatible_surface)) return NULL; |