MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / getVisualFromConfig

Function getVisualFromConfig

server/faker-egl.cpp:107–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105
106
107static XVisualInfo *getVisualFromConfig(faker::EGLXDisplay *eglxdpy,
108 EGLConfig config)
109{
110 if(!eglxdpy || !config) return NULL;
111
112 EGLint redSize, greenSize, blueSize, alphaSize;
113 int depth = 24;
114
115 if(_eglGetConfigAttrib(eglxdpy->edpy, config, EGL_RED_SIZE, &redSize)
116 && _eglGetConfigAttrib(eglxdpy->edpy, config, EGL_GREEN_SIZE, &greenSize)
117 && _eglGetConfigAttrib(eglxdpy->edpy, config, EGL_BLUE_SIZE, &blueSize)
118 && redSize == 10 && greenSize == 10 && blueSize == 10)
119 depth = 30;
120
121 if(fconfig.chromeHack
122 && _eglGetConfigAttrib(eglxdpy->edpy, config, EGL_ALPHA_SIZE, &alphaSize)
123 && alphaSize == 8)
124 {
125 VisualID bestVisualID =
126 glxvisual::getHighestScoringVisualID(eglxdpy->x11dpy, eglxdpy->screen);
127 if(bestVisualID)
128 return glxvisual::visualFromID(eglxdpy->x11dpy, eglxdpy->screen,
129 bestVisualID);
130 }
131
132 return getVisual(eglxdpy->x11dpy, eglxdpy->screen, depth, TrueColor);
133}
134
135
136// Interposed EGL functions

Callers 2

eglChooseConfigFunction · 0.70
eglGetConfigAttribFunction · 0.70

Calls 3

visualFromIDFunction · 0.85
getVisualFunction · 0.85

Tested by

no test coverage detected