| 105 | |
| 106 | |
| 107 | static 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 |
no test coverage detected