author | James Willcox <snorp@snorp.net> |
Wed, 14 Mar 2018 11:24:43 -0500 | |
changeset 408590 | aa0394eb1c570b6d770af2ca55d82ca5b1809b13 |
parent 408589 | 1aa26cb6f9d6b42cc40c2928b2065b771dc99fe8 |
child 408591 | 8d73f18bc1a2097f1271d9d3af554cd23bcc9324 |
push id | 100986 |
push user | jwillcox@mozilla.com |
push date | Fri, 16 Mar 2018 22:19:42 +0000 |
treeherder | mozilla-inbound@8d73f18bc1a2 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | lsalzman |
bugs | 1401455 |
milestone | 61.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
gfx/gl/GLContextGLX.h | file | annotate | diff | comparison | revisions | |
gfx/gl/GLContextProviderGLX.cpp | file | annotate | diff | comparison | revisions |
--- a/gfx/gl/GLContextGLX.h +++ b/gfx/gl/GLContextGLX.h @@ -23,16 +23,20 @@ public: const SurfaceCaps& caps, bool isOffscreen, Display* display, GLXDrawable drawable, GLXFBConfig cfg, bool deleteDrawable, gfxXlibSurface* pixmap); + static bool + FindVisual(Display* display, int screen, bool useWebRender, + bool useAlpha, int* const out_visualId); + // Finds a GLXFBConfig compatible with the provided window. static bool FindFBConfigForWindow(Display* display, int screen, Window window, ScopedXFree<GLXFBConfig>* const out_scopedConfigArr, GLXFBConfig* const out_config, int* const out_visid, bool aWebRender); ~GLContextGLX();
--- a/gfx/gl/GLContextProviderGLX.cpp +++ b/gfx/gl/GLContextProviderGLX.cpp @@ -880,16 +880,44 @@ ChooseConfig(GLXLibrary* glx, Display* d *out_visid = visid; return true; } return false; } bool +GLContextGLX::FindVisual(Display* display, int screen, bool useWebRender, + bool useAlpha, int* const out_visualId) +{ + int attribs[] = { + LOCAL_GLX_RGBA, + LOCAL_GLX_DOUBLEBUFFER, + LOCAL_GLX_RED_SIZE, 8, + LOCAL_GLX_GREEN_SIZE, 8, + LOCAL_GLX_BLUE_SIZE, 8, + LOCAL_GLX_ALPHA_SIZE, useAlpha ? 8 : 0, + LOCAL_GLX_DEPTH_SIZE, useWebRender ? 24 : 0, + LOCAL_GL_NONE + }; + + if (!sGLXLibrary.EnsureInitialized()) { + return false; + } + + XVisualInfo* visuals = sGLXLibrary.fChooseVisual(display, screen, attribs); + if (!visuals) { + return false; + } + + *out_visualId = visuals[0].visualid; + return true; +} + +bool GLContextGLX::FindFBConfigForWindow(Display* display, int screen, Window window, ScopedXFree<GLXFBConfig>* const out_scopedConfigArr, GLXFBConfig* const out_config, int* const out_visid, bool aWebRender) { ScopedXFree<GLXFBConfig>& cfgs = *out_scopedConfigArr; int numConfigs; const int webrenderAttribs[] = {