mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1401455 - Add GLContextGLX::FindVisual() r=lsalzman
MozReview-Commit-ID: IiInaCEtnIF
This commit is contained in:
parent
4e30d2b54d
commit
36df193c10
@ -28,6 +28,10 @@ public:
|
||||
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,
|
||||
|
@ -884,6 +884,34 @@ ChooseConfig(GLXLibrary* glx, Display* display, int screen, const SurfaceCaps& m
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user