Skip to content

Commit eb94d3a

Browse files
author
Allan Sandfeld Jensen
committed
Restore GLX usage
Reverts https://chromium-review.googlesource.com/c/chromium/src/+/4079269 Get rid of more unnecessary legacy code. Fixed: QTBUG-65682 Change-Id: Iadd7de101dfbe2c484fbb674bbdf563d1c4e52ca Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/480139 Reviewed-by: Peter Varga <[email protected]>
1 parent a5b5e64 commit eb94d3a

18 files changed

+2565
-9
lines changed

chromium/tools/v8_context_snapshot/qt_overrides.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ bool GLSurfaceGLX::IsCreateContextES2ProfileSupported() {
4646
bool GLSurfaceGLX::IsCreateContextSupported() {
4747
return false;
4848
}
49-
bool GLSurfaceGLX::InitializeExtensionSettingsOneOff() {
50-
return false;
51-
}
5249
} // namespace gl
5350
#endif // if BUILDFLAG(IS_LINUX) && BUILDFLAG(IS_OZONE_X11)
5451

chromium/ui/gl/BUILD.gn

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ declare_args() {
1919
# Whether service side logging (actual calls into the GL driver) is enabled
2020
# or not.
2121
enable_gpu_service_logging = false
22+
use_glx = false
2223
}
2324

25+
use_glx = ozone_platform_x11
26+
2427
if (is_android) {
2528
import("//build/config/android/config.gni")
2629
import("//build/config/android/rules.gni")
@@ -41,6 +44,11 @@ buildflag_header("buildflags") {
4144

4245
config("gl_config") {
4346
defines = []
47+
if (use_glx) {
48+
defines += [
49+
"USE_GLX",
50+
]
51+
}
4452
if (use_egl) {
4553
defines += [ "USE_EGL" ]
4654
}
@@ -258,6 +266,8 @@ jumbo_component("gl") {
258266
"gl_surface_egl_x11.h",
259267
"gl_surface_egl_x11_gles2.cc",
260268
"gl_surface_egl_x11_gles2.h",
269+
"gl_surface_glx_x11.cc",
270+
"gl_surface_glx_x11.h",
261271
]
262272

263273
deps += [
@@ -277,6 +287,23 @@ jumbo_component("gl") {
277287
}
278288
}
279289

290+
if (use_glx) {
291+
sources += [
292+
"gl_bindings_autogen_glx.cc",
293+
"gl_bindings_autogen_glx.h",
294+
"gl_context_glx.cc",
295+
"gl_context_glx.h",
296+
"gl_glx_api_implementation.cc",
297+
"gl_glx_api_implementation.h",
298+
"gl_surface_glx.h",
299+
]
300+
301+
deps += [
302+
"//ui/base/x",
303+
"//ui/gfx/x",
304+
]
305+
}
306+
280307
if (is_win) {
281308
sources += [
282309
"child_window_win.cc",
@@ -561,6 +588,10 @@ test("gl_unittests") {
561588
]
562589
}
563590

591+
if (use_glx) {
592+
sources += [ "glx_api_unittest.cc" ]
593+
}
594+
564595
if (is_win) {
565596
sources += [
566597
"dcomp_presenter_unittest.cc",

chromium/ui/gl/gl_bindings.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include <GL/wglext.h>
3737
#elif BUILDFLAG(IS_MAC)
3838
#include <OpenGL/OpenGL.h>
39-
#elif BUILDFLAG(IS_LINUX)
39+
#elif defined(USE_GLX)
4040
using Display = struct _XDisplay;
4141
using Bool = int;
4242
using Status = int;
@@ -45,6 +45,18 @@ using Colormap = XID;
4545
using Font = XID;
4646
using Pixmap = XID;
4747
using Window = XID;
48+
using GLXPixmap = XID;
49+
using GLXWindow = XID;
50+
using GLXDrawable = XID;
51+
using GLXPbuffer = XID;
52+
using GLXContextID = XID;
53+
using GLXContext = struct __GLXcontextRec*;
54+
using GLXFBConfig = struct __GLXFBConfigRec*;
55+
struct XVisualInfo;
56+
57+
58+
#include <GL/glxext.h>
59+
#include <GL/glxtokens.h>
4860
#endif
4961

5062
// GLES2 defines not part of Desktop GL
@@ -535,7 +547,12 @@ struct GL_EXPORT DriverEGL {
535547
#if defined(USE_GLX)
536548
struct GL_EXPORT DriverGLX {
537549
void InitializeStaticBindings();
550+
#if BUILDFLAG(IS_QTWEBENGINE)
551+
void InitializeExtensionBindings(const std::string&);
552+
#else
538553
void InitializeExtensionBindings();
554+
#endif
555+
539556
void ClearBindings();
540557

541558
ProcsGLX fn;
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
// Copyright 2016 The Chromium Authors
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
//
5+
// This file is auto-generated from
6+
// ui/gl/generate_bindings.py
7+
// It's formatted by clang-format using chromium coding style:
8+
// clang-format -i -style=chromium filename
9+
// DO NOT EDIT!
10+
11+
// Silence presubmit and Tricium warnings about include guards
12+
// no-include-guard-because-multiply-included
13+
// NOLINT(build/header_guard)
14+
15+
void glXBindTexImageEXTFn(Display* dpy,
16+
GLXDrawable drawable,
17+
int buffer,
18+
int* attribList) override;
19+
GLXFBConfig* glXChooseFBConfigFn(Display* dpy,
20+
int screen,
21+
const int* attribList,
22+
int* nitems) override;
23+
XVisualInfo* glXChooseVisualFn(Display* dpy,
24+
int screen,
25+
int* attribList) override;
26+
void glXCopyContextFn(Display* dpy,
27+
GLXContext src,
28+
GLXContext dst,
29+
unsigned long mask) override;
30+
void glXCopySubBufferMESAFn(Display* dpy,
31+
GLXDrawable drawable,
32+
int x,
33+
int y,
34+
int width,
35+
int height) override;
36+
GLXContext glXCreateContextFn(Display* dpy,
37+
XVisualInfo* vis,
38+
GLXContext shareList,
39+
int direct) override;
40+
GLXContext glXCreateContextAttribsARBFn(Display* dpy,
41+
GLXFBConfig config,
42+
GLXContext share_context,
43+
int direct,
44+
const int* attrib_list) override;
45+
GLXPixmap glXCreateGLXPixmapFn(Display* dpy,
46+
XVisualInfo* visual,
47+
Pixmap pixmap) override;
48+
GLXContext glXCreateNewContextFn(Display* dpy,
49+
GLXFBConfig config,
50+
int renderType,
51+
GLXContext shareList,
52+
int direct) override;
53+
GLXPbuffer glXCreatePbufferFn(Display* dpy,
54+
GLXFBConfig config,
55+
const int* attribList) override;
56+
GLXPixmap glXCreatePixmapFn(Display* dpy,
57+
GLXFBConfig config,
58+
Pixmap pixmap,
59+
const int* attribList) override;
60+
GLXWindow glXCreateWindowFn(Display* dpy,
61+
GLXFBConfig config,
62+
Window win,
63+
const int* attribList) override;
64+
void glXDestroyContextFn(Display* dpy, GLXContext ctx) override;
65+
void glXDestroyGLXPixmapFn(Display* dpy, GLXPixmap pixmap) override;
66+
void glXDestroyPbufferFn(Display* dpy, GLXPbuffer pbuf) override;
67+
void glXDestroyPixmapFn(Display* dpy, GLXPixmap pixmap) override;
68+
void glXDestroyWindowFn(Display* dpy, GLXWindow window) override;
69+
const char* glXGetClientStringFn(Display* dpy, int name) override;
70+
int glXGetConfigFn(Display* dpy,
71+
XVisualInfo* visual,
72+
int attrib,
73+
int* value) override;
74+
GLXContext glXGetCurrentContextFn(void) override;
75+
Display* glXGetCurrentDisplayFn(void) override;
76+
GLXDrawable glXGetCurrentDrawableFn(void) override;
77+
GLXDrawable glXGetCurrentReadDrawableFn(void) override;
78+
int glXGetFBConfigAttribFn(Display* dpy,
79+
GLXFBConfig config,
80+
int attribute,
81+
int* value) override;
82+
GLXFBConfig glXGetFBConfigFromVisualSGIXFn(Display* dpy,
83+
XVisualInfo* visualInfo) override;
84+
GLXFBConfig* glXGetFBConfigsFn(Display* dpy,
85+
int screen,
86+
int* nelements) override;
87+
bool glXGetMscRateOMLFn(Display* dpy,
88+
GLXDrawable drawable,
89+
int32_t* numerator,
90+
int32_t* denominator) override;
91+
void glXGetSelectedEventFn(Display* dpy,
92+
GLXDrawable drawable,
93+
unsigned long* mask) override;
94+
bool glXGetSyncValuesOMLFn(Display* dpy,
95+
GLXDrawable drawable,
96+
int64_t* ust,
97+
int64_t* msc,
98+
int64_t* sbc) override;
99+
XVisualInfo* glXGetVisualFromFBConfigFn(Display* dpy,
100+
GLXFBConfig config) override;
101+
int glXIsDirectFn(Display* dpy, GLXContext ctx) override;
102+
int glXMakeContextCurrentFn(Display* dpy,
103+
GLXDrawable draw,
104+
GLXDrawable read,
105+
GLXContext ctx) override;
106+
int glXMakeCurrentFn(Display* dpy,
107+
GLXDrawable drawable,
108+
GLXContext ctx) override;
109+
int glXQueryContextFn(Display* dpy,
110+
GLXContext ctx,
111+
int attribute,
112+
int* value) override;
113+
void glXQueryDrawableFn(Display* dpy,
114+
GLXDrawable draw,
115+
int attribute,
116+
unsigned int* value) override;
117+
int glXQueryExtensionFn(Display* dpy, int* errorb, int* event) override;
118+
const char* glXQueryExtensionsStringFn(Display* dpy, int screen) override;
119+
const char* glXQueryServerStringFn(Display* dpy, int screen, int name) override;
120+
int glXQueryVersionFn(Display* dpy, int* maj, int* min) override;
121+
void glXReleaseTexImageEXTFn(Display* dpy,
122+
GLXDrawable drawable,
123+
int buffer) override;
124+
void glXSelectEventFn(Display* dpy,
125+
GLXDrawable drawable,
126+
unsigned long mask) override;
127+
void glXSwapBuffersFn(Display* dpy, GLXDrawable drawable) override;
128+
void glXSwapIntervalEXTFn(Display* dpy,
129+
GLXDrawable drawable,
130+
int interval) override;
131+
void glXSwapIntervalMESAFn(unsigned int interval) override;
132+
void glXUseXFontFn(Font font, int first, int count, int list) override;
133+
void glXWaitGLFn(void) override;
134+
int glXWaitVideoSyncSGIFn(int divisor,
135+
int remainder,
136+
unsigned int* count) override;
137+
void glXWaitXFn(void) override;

0 commit comments

Comments
 (0)