OpenCoverage

qxlibeglintegration.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/platformsupport/eglconvenience/qxlibeglintegration.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2const QLoggingCategory &lcXlibEglDebug() { static const QLoggingCategory category("qt.egl.xlib.debug"); return
never executed: return category;
category;
never executed: return category;
}
0
3-
4VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay eglDisplay, EGLConfig config)-
5{-
6 VisualID visualId = 0;-
7 EGLint eglValue = 0;-
8-
9 EGLint configRedSize = 0;-
10 eglGetConfigAttrib(eglDisplay, config, 0x3024, &configRedSize);-
11-
12 EGLint configGreenSize = 0;-
13 eglGetConfigAttrib(eglDisplay, config, 0x3023, &configGreenSize);-
14-
15 EGLint configBlueSize = 0;-
16 eglGetConfigAttrib(eglDisplay, config, 0x3022, &configBlueSize);-
17-
18 EGLint configAlphaSize = 0;-
19 eglGetConfigAttrib(eglDisplay, config, 0x3021, &configAlphaSize);-
20-
21 eglGetConfigAttrib(eglDisplay, config, 0x3028, &eglValue);-
22 int configId = eglValue;-
23-
24-
25 eglGetConfigAttrib(eglDisplay, config, 0x302E, &eglValue);-
26 visualId = (VisualID)eglValue;-
27 if (visualId
visualIdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
28-
29 XVisualInfo visualInfoTemplate;-
30 memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));-
31 visualInfoTemplate.visualid = visualId;-
32-
33 XVisualInfo *chosenVisualInfo;-
34 int matchingCount = 0;-
35 chosenVisualInfo = XGetVisualInfo(display, 0x1, &visualInfoTemplate, &matchingCount);-
36 if (chosenVisualInfo
chosenVisualInfoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
37-
38-
39 if (q_hasEglExtension(eglDisplay,"EGL_NV_post_convert_rounding")
q_hasEglExtens...ert_rounding")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
40 XFree(chosenVisualInfo);-
41 return
never executed: return visualId;
visualId;
never executed: return visualId;
0
42 }-
43-
44 const char *vendor = eglQueryString(eglDisplay, 0x3053);-
45 if (vendor
vendorDescription
TRUEnever evaluated
FALSEnever evaluated
&& strstr(vendor, "Vivante")
strstr(vendor, "Vivante")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
46 XFree(chosenVisualInfo);-
47 return
never executed: return visualId;
visualId;
never executed: return visualId;
0
48 }-
49-
50 int visualRedSize = qPopulationCount(chosenVisualInfo->red_mask);-
51 int visualGreenSize = qPopulationCount(chosenVisualInfo->green_mask);-
52 int visualBlueSize = qPopulationCount(chosenVisualInfo->blue_mask);-
53 int visualAlphaSize = chosenVisualInfo->depth == 32
chosenVisualInfo->depth == 32Description
TRUEnever evaluated
FALSEnever evaluated
? 8 : 0;
0
54-
55 const bool visualMatchesConfig = visualRedSize == configRedSize
visualRedSize == configRedSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
56 && visualGreenSize == configGreenSize
visualGreenSiz...onfigGreenSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
57 && visualBlueSize == configBlueSize
visualBlueSize...configBlueSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
58 && visualAlphaSize == configAlphaSize
visualAlphaSiz...onfigAlphaSizeDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
59-
60-
61-
62 if (!visualMatchesConfig
!visualMatchesConfigDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
63 visualId = 0;-
64 for (bool qt_category_enabled = lcXlibEglDebug().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(
never executed: QMessageLogger( __FILE__ , 109 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %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, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize) ;
0
650
660
670
68 __FILE__
never executed: QMessageLogger( __FILE__ , 109 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %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, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize) ;
0
69 ,
never executed: QMessageLogger( __FILE__ , 109 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %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, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize) ;
0
700
710
720
73 109
never executed: QMessageLogger( __FILE__ , 109 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %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, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize) ;
0
74 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %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, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize)
never executed: QMessageLogger( __FILE__ , 109 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %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, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize) ;
0
750
760
770
78 ;
never executed: QMessageLogger( __FILE__ , 109 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %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, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize) ;
0
79 }
never executed: end of block
0
80 }
never executed: end of block
else {
0
81 for (bool qt_category_enabled = lcXlibEglDebug().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(
never executed: QMessageLogger( __FILE__ , 113 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", (int)visualId, configId) ;
0
82 __FILE__
never executed: QMessageLogger( __FILE__ , 113 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", (int)visualId, configId) ;
0
83 ,
never executed: QMessageLogger( __FILE__ , 113 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", (int)visualId, configId) ;
0
84 113
never executed: QMessageLogger( __FILE__ , 113 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", (int)visualId, configId) ;
0
85 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", (int)visualId, configId)
never executed: QMessageLogger( __FILE__ , 113 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", (int)visualId, configId) ;
0
86 ;
never executed: QMessageLogger( __FILE__ , 113 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", (int)visualId, configId) ;
0
87 visualId = 0;-
88 }
never executed: end of block
0
89 XFree(chosenVisualInfo);-
90 }
never executed: end of block
0
91 else-
92 for (bool qt_category_enabled = lcXlibEglDebug().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 119, __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
never executed: QMessageLogger(__FILE__, 119, __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
0
93-
94 if (visualId
visualIdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
95 for (bool qt_category_enabled = lcXlibEglDebug().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(
never executed: QMessageLogger( __FILE__ , 124 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug(configAlphaSize > 0 ? "Using ARGB Visual ID %d provided by EGL for config %d" : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId) ;
0
960
97 __FILE__
never executed: QMessageLogger( __FILE__ , 124 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug(configAlphaSize > 0 ? "Using ARGB Visual ID %d provided by EGL for config %d" : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId) ;
0
98 ,
never executed: QMessageLogger( __FILE__ , 124 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug(configAlphaSize > 0 ? "Using ARGB Visual ID %d provided by EGL for config %d" : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId) ;
0
990
100 124
never executed: QMessageLogger( __FILE__ , 124 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug(configAlphaSize > 0 ? "Using ARGB Visual ID %d provided by EGL for config %d" : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId) ;
0
101 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug(configAlphaSize > 0 ? "Using ARGB Visual ID %d provided by EGL for config %d" : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId)
never executed: QMessageLogger( __FILE__ , 124 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug(configAlphaSize > 0 ? "Using ARGB Visual ID %d provided by EGL for config %d" : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId) ;
0
1020
103 ;
never executed: QMessageLogger( __FILE__ , 124 , __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug(configAlphaSize > 0 ? "Using ARGB Visual ID %d provided by EGL for config %d" : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId) ;
0
104 return
never executed: return visualId;
visualId;
never executed: return visualId;
0
105 }-
106-
107-
108 if (!visualId
!visualIdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
109 XVisualInfo visualInfoTemplate;-
110 memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));-
111 XVisualInfo *matchingVisuals;-
112 int matchingCount = 0;-
113-
114 visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize + configAlphaSize;-
115 matchingVisuals = XGetVisualInfo(display,-
116 0x4,-
117 &visualInfoTemplate,-
118 &matchingCount);-
119 if (!matchingVisuals
!matchingVisualsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
120-
121 visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize;-
122 matchingVisuals = XGetVisualInfo(display,-
123 0x4,-
124 &visualInfoTemplate,-
125 &matchingCount);-
126 }
never executed: end of block
0
127-
128 if (matchingVisuals
matchingVisualsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
129 visualId = matchingVisuals[0].visualid;-
130 XFree(matchingVisuals);-
131 }
never executed: end of block
0
132 }
never executed: end of block
0
133-
134 if (visualId
visualIdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
135 for (bool qt_category_enabled = lcXlibEglDebug().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 156, __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
never executed: QMessageLogger(__FILE__, 156, __PRETTY_FUNCTION__, lcXlibEglDebug().categoryName()).debug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
0
136 return
never executed: return visualId;
visualId;
never executed: return visualId;
0
137 }-
138-
139 QMessageLogger(__FILE__, 160, __PRETTY_FUNCTION__).warning("Unable to find an X11 visual which matches EGL config %d", configId);-
140 return
never executed: return (VisualID)0;
(VisualID)0;
never executed: return (VisualID)0;
0
141}-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9