summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-03-04 12:03:51 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-03-04 12:30:38 (GMT)
commited1f672efb19932fe279a3ebfedb973c02c4fee4 (patch)
tree5893413c590b8c3bc8a6e74163d46270cca87cb0 /src/gui
parentcd2afafbc9c29393a80d415145c49eb5f439da55 (diff)
downloadQt-ed1f672efb19932fe279a3ebfedb973c02c4fee4.zip
Qt-ed1f672efb19932fe279a3ebfedb973c02c4fee4.tar.gz
Qt-ed1f672efb19932fe279a3ebfedb973c02c4fee4.tar.bz2
Fix build on EGL implementations where EGLConfig is a pointer
EGLConfig is an opaque type which we really shouldn't cast to an int. Instead, we get the config id for the EGLConfig. Reviewed-By: TrustMe
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/egl/qegl_x11.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 339bd57..483c01d 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -149,6 +149,9 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
eglGetConfigAttrib(display(), config, EGL_BUFFER_SIZE, &eglValue);
int configBitDepth = eglValue;
+ eglGetConfigAttrib(display(), config, EGL_CONFIG_ID, &eglValue);
+ int configId = eglValue;
+
// See if EGL provided a valid VisualID:
eglGetConfigAttrib(display(), config, EGL_NATIVE_VISUAL_ID, &eglValue);
visualId = (VisualID)eglValue;
@@ -170,14 +173,14 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
format = XRenderFindVisualFormat(X11->display, chosenVisualInfo->visual);
if (!format || (format->type != PictTypeDirect) || (!format->direct.alphaMask)) {
qWarning("Warning: EGL suggested using X visual ID %d for config %d, but this is not ARGB",
- (int)visualId, (int)config);
+ (int)visualId, configId);
visualId = 0;
}
}
#endif
} else {
qWarning("Warning: EGL suggested using X visual ID %d (%d bpp) for config %d (%d bpp), but the depths do not match!",
- (int)visualId, chosenVisualInfo->depth, (int)config, configBitDepth);
+ (int)visualId, chosenVisualInfo->depth, configId, configBitDepth);
visualId = 0;
}
}
@@ -187,9 +190,9 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
if (visualId) {
#ifdef QT_DEBUG_X11_VISUAL_SELECTION
if (configAlphaSize > 0)
- qDebug("Using ARGB Visual ID %d provided by EGL for config %d", (int)visualId, (int)config);
+ qDebug("Using ARGB Visual ID %d provided by EGL for config %d", (int)visualId, configId);
else
- qDebug("Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, (int)config);
+ qDebug("Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId);
#endif
return visualId;
}
@@ -232,9 +235,9 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
if (visualId) {
# ifdef QT_DEBUG_X11_VISUAL_SELECTION
if (configAlphaSize > 0)
- qDebug("Using ARGB Visual ID %d provided by XRender for EGL config %d", (int)visualId, (int)config);
+ qDebug("Using ARGB Visual ID %d provided by XRender for EGL config %d", (int)visualId, configId);
else
- qDebug("Using Opaque Visual ID %d provided by XRender for EGL config %d", (int)visualId, (int)config);
+ qDebug("Using Opaque Visual ID %d provided by XRender for EGL config %d", (int)visualId, configId);
# endif // QT_DEBUG_X11_VISUAL_SELECTION
return visualId;
}
@@ -263,12 +266,12 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
if (visualId) {
#ifdef QT_DEBUG_X11_VISUAL_SELECTION
- qDebug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, (int)config);
+ qDebug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
#endif
return visualId;
}
- qWarning("Unable to find an X11 visual which matches EGL config %d", (int)config);
+ qWarning("Unable to find an X11 visual which matches EGL config %d", configId);
return (VisualID)0;
}