Skip to content

Commit ac0deea

Browse files
committed
Revert "[Revert] ui/gl: Remove WGL support on Windows"
This reverts commit eb969a8. Change-Id: I7ce00e6976ffab58e08c7c5103e1b6de35958c9c Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/595116 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
1 parent 1df21e7 commit ac0deea

15 files changed

+1
-1997
lines changed

chromium/ui/gl/BUILD.gn

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,8 @@ jumbo_component("gl") {
339339
"direct_composition_surface_win.h",
340340
"gl_angle_util_win.cc",
341341
"gl_angle_util_win.h",
342-
"gl_bindings_autogen_wgl.cc",
343-
"gl_bindings_autogen_wgl.h",
344-
"gl_context_wgl.cc",
345-
"gl_context_wgl.h",
346342
"gl_fence_win.cc",
347343
"gl_fence_win.h",
348-
"gl_surface_wgl.cc",
349-
"gl_surface_wgl.h",
350-
"gl_wgl_api_implementation.cc",
351-
"gl_wgl_api_implementation.h",
352344
"hdr_metadata_helper_win.cc",
353345
"hdr_metadata_helper_win.h",
354346
"swap_chain_presenter.cc",
@@ -615,7 +607,6 @@ test("gl_unittests") {
615607
"direct_composition_surface_win_unittest.cc",
616608
"gl_fence_win_unittest.cc",
617609
"hdr_metadata_helper_win_unittest.cc",
618-
"wgl_api_unittest.cc",
619610
]
620611
}
621612

chromium/ui/gl/generate_bindings.py

Lines changed: 1 addition & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
]
2323

2424
UNCONDITIONALLY_BOUND_EXTENSIONS = set([
25-
'WGL_ARB_extensions_string',
26-
'WGL_EXT_extensions_string',
2725
'GL_CHROMIUM_gles_depth_binding_hack', # crbug.com/448206
2826
'GL_CHROMIUM_glgetstringi_hack', # crbug.com/470396
2927
'GL_CHROMIUM_egl_khr_fence_sync_hack', # crbug.com/504758
@@ -2965,232 +2963,6 @@
29652963
'EGL_NOK_texture_from_pixmap',
29662964
]
29672965

2968-
WGL_FUNCTIONS = [
2969-
{ 'return_type': 'BOOL',
2970-
'names': ['wglChoosePixelFormatARB'],
2971-
'arguments':
2972-
'HDC dc, const int* int_attrib_list, const float* float_attrib_list, '
2973-
'UINT max_formats, int* formats, UINT* num_formats', },
2974-
{ 'return_type': 'BOOL',
2975-
'names': ['wglCopyContext'],
2976-
'arguments': 'HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask', },
2977-
{ 'return_type': 'HGLRC',
2978-
'names': ['wglCreateContext'],
2979-
'arguments': 'HDC hdc', },
2980-
{ 'return_type': 'HGLRC',
2981-
'names': ['wglCreateContextAttribsARB'],
2982-
'arguments': 'HDC hDC, HGLRC hShareContext, const int* attribList', },
2983-
{ 'return_type': 'HGLRC',
2984-
'names': ['wglCreateLayerContext'],
2985-
'arguments': 'HDC hdc, int iLayerPlane', },
2986-
{ 'return_type': 'HPBUFFERARB',
2987-
'names': ['wglCreatePbufferARB'],
2988-
'arguments': 'HDC hDC, int iPixelFormat, int iWidth, int iHeight, '
2989-
'const int* piAttribList', },
2990-
{ 'return_type': 'BOOL',
2991-
'names': ['wglDeleteContext'],
2992-
'arguments': 'HGLRC hglrc', },
2993-
{ 'return_type': 'BOOL',
2994-
'names': ['wglDestroyPbufferARB'],
2995-
'arguments': 'HPBUFFERARB hPbuffer', },
2996-
{ 'return_type': 'HGLRC',
2997-
'names': ['wglGetCurrentContext'],
2998-
'arguments': '', },
2999-
{ 'return_type': 'HDC',
3000-
'names': ['wglGetCurrentDC'],
3001-
'arguments': '', },
3002-
{ 'return_type': 'const char*',
3003-
'names': ['wglGetExtensionsStringARB'],
3004-
'arguments': 'HDC hDC', },
3005-
{ 'return_type': 'const char*',
3006-
'names': ['wglGetExtensionsStringEXT'],
3007-
'arguments': '', },
3008-
{ 'return_type': 'HDC',
3009-
'names': ['wglGetPbufferDCARB'],
3010-
'arguments': 'HPBUFFERARB hPbuffer', },
3011-
{ 'return_type': 'BOOL',
3012-
'names': ['wglMakeCurrent'],
3013-
'arguments': 'HDC hdc, HGLRC hglrc', },
3014-
{ 'return_type': 'BOOL',
3015-
'names': ['wglQueryPbufferARB'],
3016-
'arguments': 'HPBUFFERARB hPbuffer, int iAttribute, int* piValue', },
3017-
{ 'return_type': 'int',
3018-
'names': ['wglReleasePbufferDCARB'],
3019-
'arguments': 'HPBUFFERARB hPbuffer, HDC hDC', },
3020-
{ 'return_type': 'BOOL',
3021-
'names': ['wglShareLists'],
3022-
'arguments': 'HGLRC hglrc1, HGLRC hglrc2', },
3023-
{ 'return_type': 'BOOL',
3024-
'names': ['wglSwapIntervalEXT'],
3025-
'arguments': 'int interval', },
3026-
{ 'return_type': 'BOOL',
3027-
'names': ['wglSwapLayerBuffers'],
3028-
'arguments': 'HDC hdc, UINT fuPlanes', },
3029-
]
3030-
3031-
GLX_FUNCTIONS = [
3032-
{ 'return_type': 'void',
3033-
'names': ['glXBindTexImageEXT'],
3034-
'arguments':
3035-
'Display* dpy, GLXDrawable drawable, int buffer, int* attribList', },
3036-
{ 'return_type': 'GLXFBConfig*',
3037-
'names': ['glXChooseFBConfig'],
3038-
'arguments':
3039-
'Display* dpy, int screen, const int* attribList, int* nitems', },
3040-
{ 'return_type': 'XVisualInfo*',
3041-
'names': ['glXChooseVisual'],
3042-
'arguments': 'Display* dpy, int screen, int* attribList', },
3043-
{ 'return_type': 'void',
3044-
'names': ['glXCopyContext'],
3045-
'arguments':
3046-
'Display* dpy, GLXContext src, GLXContext dst, unsigned long mask', },
3047-
{ 'return_type': 'void',
3048-
'names': ['glXCopySubBufferMESA'],
3049-
'arguments': 'Display* dpy, GLXDrawable drawable, '
3050-
'int x, int y, int width, int height', },
3051-
{ 'return_type': 'GLXContext',
3052-
'names': ['glXCreateContext'],
3053-
'arguments':
3054-
'Display* dpy, XVisualInfo* vis, GLXContext shareList, int direct', },
3055-
{ 'return_type': 'GLXContext',
3056-
'names': ['glXCreateContextAttribsARB'],
3057-
'arguments':
3058-
'Display* dpy, GLXFBConfig config, GLXContext share_context, int direct, '
3059-
'const int* attrib_list', },
3060-
{ 'return_type': 'GLXPixmap',
3061-
'names': ['glXCreateGLXPixmap'],
3062-
'arguments': 'Display* dpy, XVisualInfo* visual, Pixmap pixmap', },
3063-
{ 'return_type': 'GLXContext',
3064-
'names': ['glXCreateNewContext'],
3065-
'arguments': 'Display* dpy, GLXFBConfig config, int renderType, '
3066-
'GLXContext shareList, int direct', },
3067-
{ 'return_type': 'GLXPbuffer',
3068-
'names': ['glXCreatePbuffer'],
3069-
'arguments': 'Display* dpy, GLXFBConfig config, const int* attribList', },
3070-
{ 'return_type': 'GLXPixmap',
3071-
'names': ['glXCreatePixmap'],
3072-
'arguments': 'Display* dpy, GLXFBConfig config, '
3073-
'Pixmap pixmap, const int* attribList', },
3074-
{ 'return_type': 'GLXWindow',
3075-
'names': ['glXCreateWindow'],
3076-
'arguments':
3077-
'Display* dpy, GLXFBConfig config, Window win, const int* attribList', },
3078-
{ 'return_type': 'void',
3079-
'names': ['glXDestroyContext'],
3080-
'arguments': 'Display* dpy, GLXContext ctx', },
3081-
{ 'return_type': 'void',
3082-
'names': ['glXDestroyGLXPixmap'],
3083-
'arguments': 'Display* dpy, GLXPixmap pixmap', },
3084-
{ 'return_type': 'void',
3085-
'names': ['glXDestroyPbuffer'],
3086-
'arguments': 'Display* dpy, GLXPbuffer pbuf', },
3087-
{ 'return_type': 'void',
3088-
'names': ['glXDestroyPixmap'],
3089-
'arguments': 'Display* dpy, GLXPixmap pixmap', },
3090-
{ 'return_type': 'void',
3091-
'names': ['glXDestroyWindow'],
3092-
'arguments': 'Display* dpy, GLXWindow window', },
3093-
{ 'return_type': 'const char*',
3094-
'names': ['glXGetClientString'],
3095-
'arguments': 'Display* dpy, int name', },
3096-
{ 'return_type': 'int',
3097-
'names': ['glXGetConfig'],
3098-
'arguments': 'Display* dpy, XVisualInfo* visual, int attrib, int* value', },
3099-
{ 'return_type': 'GLXContext',
3100-
'names': ['glXGetCurrentContext'],
3101-
'arguments': 'void', },
3102-
{ 'return_type': 'Display*',
3103-
'names': ['glXGetCurrentDisplay'],
3104-
'arguments': 'void', },
3105-
{ 'return_type': 'GLXDrawable',
3106-
'names': ['glXGetCurrentDrawable'],
3107-
'arguments': 'void', },
3108-
{ 'return_type': 'GLXDrawable',
3109-
'names': ['glXGetCurrentReadDrawable'],
3110-
'arguments': 'void', },
3111-
{ 'return_type': 'int',
3112-
'names': ['glXGetFBConfigAttrib'],
3113-
'arguments': 'Display* dpy, GLXFBConfig config, int attribute, int* value', },
3114-
{ 'return_type': 'GLXFBConfig',
3115-
'names': ['glXGetFBConfigFromVisualSGIX'],
3116-
'arguments': 'Display* dpy, XVisualInfo* visualInfo', },
3117-
{ 'return_type': 'GLXFBConfig*',
3118-
'names': ['glXGetFBConfigs'],
3119-
'arguments': 'Display* dpy, int screen, int* nelements', },
3120-
{ 'return_type': 'bool',
3121-
'names': ['glXGetMscRateOML'],
3122-
'arguments':
3123-
'Display* dpy, GLXDrawable drawable, int32_t* numerator, '
3124-
'int32_t* denominator' },
3125-
{ 'return_type': 'void',
3126-
'names': ['glXGetSelectedEvent'],
3127-
'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long* mask', },
3128-
{ 'return_type': 'bool',
3129-
'names': ['glXGetSyncValuesOML'],
3130-
'arguments':
3131-
'Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, '
3132-
'int64_t* sbc' },
3133-
{ 'return_type': 'XVisualInfo*',
3134-
'names': ['glXGetVisualFromFBConfig'],
3135-
'arguments': 'Display* dpy, GLXFBConfig config', },
3136-
{ 'return_type': 'int',
3137-
'names': ['glXIsDirect'],
3138-
'arguments': 'Display* dpy, GLXContext ctx', },
3139-
{ 'return_type': 'int',
3140-
'names': ['glXMakeContextCurrent'],
3141-
'arguments':
3142-
'Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx', },
3143-
{ 'return_type': 'int',
3144-
'names': ['glXMakeCurrent'],
3145-
'arguments': 'Display* dpy, GLXDrawable drawable, GLXContext ctx', },
3146-
{ 'return_type': 'int',
3147-
'names': ['glXQueryContext'],
3148-
'arguments': 'Display* dpy, GLXContext ctx, int attribute, int* value', },
3149-
{ 'return_type': 'void',
3150-
'names': ['glXQueryDrawable'],
3151-
'arguments':
3152-
'Display* dpy, GLXDrawable draw, int attribute, unsigned int* value', },
3153-
{ 'return_type': 'int',
3154-
'names': ['glXQueryExtension'],
3155-
'arguments': 'Display* dpy, int* errorb, int* event', },
3156-
{ 'return_type': 'const char*',
3157-
'names': ['glXQueryExtensionsString'],
3158-
'arguments': 'Display* dpy, int screen', },
3159-
{ 'return_type': 'const char*',
3160-
'names': ['glXQueryServerString'],
3161-
'arguments': 'Display* dpy, int screen, int name', },
3162-
{ 'return_type': 'int',
3163-
'names': ['glXQueryVersion'],
3164-
'arguments': 'Display* dpy, int* maj, int* min', },
3165-
{ 'return_type': 'void',
3166-
'names': ['glXReleaseTexImageEXT'],
3167-
'arguments': 'Display* dpy, GLXDrawable drawable, int buffer', },
3168-
{ 'return_type': 'void',
3169-
'names': ['glXSelectEvent'],
3170-
'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long mask', },
3171-
{ 'return_type': 'void',
3172-
'names': ['glXSwapBuffers'],
3173-
'arguments': 'Display* dpy, GLXDrawable drawable', },
3174-
{ 'return_type': 'void',
3175-
'names': ['glXSwapIntervalEXT'],
3176-
'arguments': 'Display* dpy, GLXDrawable drawable, int interval', },
3177-
{ 'return_type': 'void',
3178-
'names': ['glXSwapIntervalMESA'],
3179-
'arguments': 'unsigned int interval', },
3180-
{ 'return_type': 'void',
3181-
'names': ['glXUseXFont'],
3182-
'arguments': 'Font font, int first, int count, int list', },
3183-
{ 'return_type': 'void',
3184-
'names': ['glXWaitGL'],
3185-
'arguments': 'void', },
3186-
{ 'return_type': 'int',
3187-
'names': ['glXWaitVideoSyncSGI'],
3188-
'arguments': 'int divisor, int remainder, unsigned int* count', },
3189-
{ 'return_type': 'void',
3190-
'names': ['glXWaitX'],
3191-
'arguments': 'void', },
3192-
]
3193-
31942966
FUNCTION_SETS = [
31952967
[GL_FUNCTIONS, 'gl', [
31962968
'GL/gl.h',
@@ -3221,8 +2993,6 @@
32212993
'EGL_ANGLE_surface_d3d_texture_2d_share_handle',
32222994
],
32232995
],
3224-
[WGL_FUNCTIONS, 'wgl', ['noninclude/GL/wglext.h'], []],
3225-
[GLX_FUNCTIONS, 'glx', ['GL/glx.h', 'noninclude/GL/glxext.h'], []],
32262996
]
32272997

32282998
GLES2_HEADERS_WITH_ENUMS = [
@@ -4060,7 +3830,7 @@ def ParseFunctionsFromHeader(header_file, extensions, versions):
40603830
version_start = re.compile(
40613831
r'#ifndef GL_(ES_|)VERSION((?:_[0-9])+)$')
40623832
extension_start = re.compile(
4063-
r'#ifndef ((?:GL|EGL|WGL|GLX)_[A-Z]+_[a-zA-Z]\w+)')
3833+
r'#ifndef ((?:GL|EGL)_[A-Z]+_[a-zA-Z]\w+)')
40643834
extension_function = re.compile(r'.+\s+([a-z]+\w+)\s*\(')
40653835
typedef = re.compile(r'typedef .*')
40663836
macro_start = re.compile(r'^#(if|ifdef|ifndef).*')

chromium/ui/gl/gl_bindings.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,13 @@
1515
#include "ui/gfx/x/glx.h"
1616
#endif
1717

18-
#if defined(OS_WIN)
19-
#include "ui/gl/gl_surface_wgl.h"
20-
#endif
21-
2218
#if defined(USE_EGL)
2319
#include "ui/gl/gl_display.h"
2420
#include "ui/gl/gl_surface_egl.h"
2521
#endif
2622

2723
namespace gl {
2824

29-
#if defined(OS_WIN)
30-
std::string DriverWGL::GetPlatformExtensions() {
31-
const char* str = nullptr;
32-
str = wglGetExtensionsStringARB(GLSurfaceWGL::GetDisplayDC());
33-
if (str)
34-
return str;
35-
return wglGetExtensionsStringEXT();
36-
}
37-
#endif
38-
3925
#if defined(USE_EGL)
4026
void DisplayExtensionsEGL::UpdateConditionalExtensionSettings(
4127
EGLDisplay display) {

chromium/ui/gl/gl_bindings.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,6 @@ typedef uint64_t EGLuint64CHROMIUM;
505505
#include "gl_bindings_autogen_egl.h"
506506
#endif
507507

508-
#if defined(OS_WIN)
509-
#include "gl_bindings_autogen_wgl.h"
510-
#endif
511-
512508
#if defined(USE_GLX)
513509
#include "gl_bindings_autogen_glx.h"
514510
#endif
@@ -538,20 +534,6 @@ struct GL_EXPORT CurrentGL {
538534
raw_ptr<const GLVersionInfo, AcrossTasksDanglingUntriaged> Version = nullptr;
539535
};
540536

541-
#if defined(OS_WIN)
542-
struct GL_EXPORT DriverWGL {
543-
void InitializeStaticBindings();
544-
void InitializeExtensionBindings();
545-
void ClearBindings();
546-
547-
ProcsWGL fn;
548-
ExtensionsWGL ext;
549-
550-
private:
551-
static std::string GetPlatformExtensions();
552-
};
553-
#endif
554-
555537
#if defined(USE_EGL)
556538
struct GL_EXPORT DriverEGL {
557539
void InitializeStaticBindings();
@@ -592,11 +574,6 @@ GL_EXPORT extern EGLApi* g_current_egl_context;
592574
GL_EXPORT extern DriverEGL g_driver_egl;
593575
#endif
594576

595-
#if defined(OS_WIN)
596-
GL_EXPORT extern WGLApi* g_current_wgl_context;
597-
GL_EXPORT extern DriverWGL g_driver_wgl;
598-
#endif
599-
600577
#if defined(USE_GLX)
601578
GL_EXPORT extern GLXApi* g_current_glx_context;
602579
GL_EXPORT extern DriverGLX g_driver_glx;

0 commit comments

Comments
 (0)