diff options
author | Liang Qi <liang.qi@qt.io> | 2018-10-26 10:28:24 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-10-26 10:28:24 +0000 |
commit | 00b2e45a97205975ee91aa43f00e3dbef1a8907b (patch) | |
tree | ed44e50bc893e87434d72470c2c809b1fb34de72 /src/platformsupport/eglconvenience/qxlibeglintegration.cpp | |
parent | 9cd527bc1f384926985d63c741641316a66f17a4 (diff) | |
parent | e28e91ae99b8c3859899e04cc9370534c7c7b86d (diff) |
Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev
Diffstat (limited to 'src/platformsupport/eglconvenience/qxlibeglintegration.cpp')
-rw-r--r-- | src/platformsupport/eglconvenience/qxlibeglintegration.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp index 565dbfb11b..ac743e1e38 100644 --- a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp +++ b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp @@ -91,21 +91,21 @@ VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay int visualRedSize = qPopulationCount(chosenVisualInfo->red_mask); int visualGreenSize = qPopulationCount(chosenVisualInfo->green_mask); int visualBlueSize = qPopulationCount(chosenVisualInfo->blue_mask); - int visualAlphaSize = chosenVisualInfo->depth == 32 ? 8 : 0; + int visualAlphaSize = chosenVisualInfo->depth - visualRedSize - visualBlueSize - visualGreenSize; - const bool visualMatchesConfig = visualRedSize == configRedSize - && visualGreenSize == configGreenSize - && visualBlueSize == configBlueSize - && visualAlphaSize == configAlphaSize; + const bool visualMatchesConfig = visualRedSize >= configRedSize + && visualGreenSize >= configGreenSize + && visualBlueSize >= configBlueSize + && visualAlphaSize >= configAlphaSize; // In some cases EGL tends to suggest a 24-bit visual for 8888 // configs. In such a case we have to fall back to XGetVisualInfo. if (!visualMatchesConfig) { visualId = 0; qCDebug(lcXlibEglDebug, - "EGL suggested using X Visual ID %d (%d %d %d depth %d) for EGL config %d" + "EGL suggested using X Visual ID %d (%d %d %d %d depth %d) for EGL config %d" "(%d %d %d %d), but this is incompatible", - (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, chosenVisualInfo->depth, + (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, visualAlphaSize, chosenVisualInfo->depth, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize); } } else { |