summaryrefslogtreecommitdiffstats
path: root/src/gui/egl
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-15 06:18:27 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-15 06:18:27 (GMT)
commit4c472f1694aa9f35eda248f04decadbe0ef2dd75 (patch)
tree3480002bde8c6059272fb4d61829e0e3b8f2f504 /src/gui/egl
parent6ce4e6247fa6e438a34a498cd803a5542ff338b7 (diff)
parentd20bf43e3f7b3d39fddd28eee5a5594de6930873 (diff)
downloadQt-4c472f1694aa9f35eda248f04decadbe0ef2dd75.zip
Qt-4c472f1694aa9f35eda248f04decadbe0ef2dd75.tar.gz
Qt-4c472f1694aa9f35eda248f04decadbe0ef2dd75.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix compilation of ShivaVG, which does not have EGL. Move nativePaintingActive flag to GL2 engine's private More adjustments to QTBUG-6800 Adjustments to QTBUG-6800 patch. QTBUG-6800 patch included, but only for OpenGL 2.0 Support building with desktop OpenGL managed via EGL Print more information when debugging X11 Visual selection Fix gcc compile warning in qstatictext.cpp Avoid taking sqrt of negative number in FT font engine
Diffstat (limited to 'src/gui/egl')
-rw-r--r--src/gui/egl/qegl.cpp9
-rw-r--r--src/gui/egl/qegl_x11.cpp10
-rw-r--r--src/gui/egl/qeglproperties.cpp27
3 files changed, 35 insertions, 11 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 6f215cc..3b007d7 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -326,10 +326,17 @@ EGLSurface QEglContext::createSurface(QPaintDevice* device, const QEglProperties
bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties)
{
// We need to select the correct API before calling eglCreateContext().
+#ifdef QT_OPENGL_ES
#ifdef EGL_OPENGL_ES_API
if (apiType == QEgl::OpenGL)
eglBindAPI(EGL_OPENGL_ES_API);
#endif
+#else
+#ifdef EGL_OPENGL_API
+ if (apiType == QEgl::OpenGL)
+ eglBindAPI(EGL_OPENGL_API);
+#endif
+#endif //defined(QT_OPENGL_ES)
#ifdef EGL_OPENVG_API
if (apiType == QEgl::OpenVG)
eglBindAPI(EGL_OPENVG_API);
@@ -339,7 +346,7 @@ bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties
QEglProperties contextProps;
if (properties)
contextProps = *properties;
-#if defined(QT_OPENGL_ES_2)
+#ifdef QT_OPENGL_ES_2
if (apiType == QEgl::OpenGL)
contextProps.setValue(EGL_CONTEXT_CLIENT_VERSION, 2);
#endif
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 5341ea1..cb8dcda 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -210,6 +210,11 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
}
XFree(chosenVisualInfo);
}
+#ifdef QT_DEBUG_X11_VISUAL_SELECTION
+ else
+ qDebug("EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
+#endif
+
if (visualId) {
#ifdef QT_DEBUG_X11_VISUAL_SELECTION
if (configAlphaSize > 0)
@@ -263,6 +268,11 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
# endif // QT_DEBUG_X11_VISUAL_SELECTION
return visualId;
}
+# ifdef QT_DEBUG_X11_VISUAL_SELECTION
+ else
+ qDebug("Failed to find an XVisual which matches EGL config %d using XRender", configId);
+# endif // QT_DEBUG_X11_VISUAL_SELECTION
+
#endif //!defined(QT_NO_XRENDER)
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
index b5d3103..b34d2c3 100644
--- a/src/gui/egl/qeglproperties.cpp
+++ b/src/gui/egl/qeglproperties.cpp
@@ -80,19 +80,19 @@ int QEglProperties::value(int name) const
case EGL_GREEN_SIZE: return 0;
case EGL_BLUE_SIZE: return 0;
case EGL_ALPHA_SIZE: return 0;
-#if defined(EGL_LUMINANCE_SIZE)
+#ifdef EGL_LUMINANCE_SIZE
case EGL_LUMINANCE_SIZE: return 0;
#endif
-#if defined(EGL_ALPHA_MASK_SIZE)
+#ifdef EGL_ALPHA_MASK_SIZE
case EGL_ALPHA_MASK_SIZE: return 0;
#endif
-#if defined(EGL_BIND_TO_TEXTURE_RGB)
+#ifdef EGL_BIND_TO_TEXTURE_RGB
case EGL_BIND_TO_TEXTURE_RGB: return EGL_DONT_CARE;
#endif
-#if defined(EGL_BIND_TO_TEXTURE_RGBA)
+#ifdef EGL_BIND_TO_TEXTURE_RGBA
case EGL_BIND_TO_TEXTURE_RGBA: return EGL_DONT_CARE;
#endif
-#if defined(EGL_COLOR_BUFFER_TYPE)
+#ifdef EGL_COLOR_BUFFER_TYPE
case EGL_COLOR_BUFFER_TYPE: return EGL_RGB_BUFFER;
#endif
case EGL_CONFIG_CAVEAT: return EGL_DONT_CARE;
@@ -103,7 +103,7 @@ int QEglProperties::value(int name) const
case EGL_NATIVE_VISUAL_TYPE: return EGL_DONT_CARE;
case EGL_MAX_SWAP_INTERVAL: return EGL_DONT_CARE;
case EGL_MIN_SWAP_INTERVAL: return EGL_DONT_CARE;
-#if defined(EGL_RENDERABLE_TYPE)
+#ifdef EGL_RENDERABLE_TYPE
case EGL_RENDERABLE_TYPE: return EGL_OPENGL_ES_BIT;
#endif
case EGL_SAMPLE_BUFFERS: return 0;
@@ -115,7 +115,7 @@ int QEglProperties::value(int name) const
case EGL_TRANSPARENT_GREEN_VALUE: return EGL_DONT_CARE;
case EGL_TRANSPARENT_BLUE_VALUE: return EGL_DONT_CARE;
-#if defined(EGL_VERSION_1_3)
+#ifdef EGL_VERSION_1_3
case EGL_CONFORMANT: return 0;
case EGL_MATCH_NATIVE_PIXMAP: return EGL_NONE;
#endif
@@ -215,15 +215,18 @@ void QEglProperties::setPixelFormat(QImage::Format pixelFormat)
void QEglProperties::setRenderableType(QEgl::API api)
{
-#if defined(EGL_RENDERABLE_TYPE)
+#ifdef EGL_RENDERABLE_TYPE
#if defined(QT_OPENGL_ES_2)
if (api == QEgl::OpenGL)
setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT);
#elif defined(QT_OPENGL_ES)
if (api == QEgl::OpenGL)
setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
+#elif defined(EGL_OPENGL_BIT)
+ if (api == QEgl::OpenGL)
+ setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
#endif
-#if defined(EGL_OPENVG_BIT)
+#ifdef EGL_OPENVG_BIT
if (api == QEgl::OpenVG)
setValue(EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT);
#endif
@@ -272,7 +275,7 @@ bool QEglProperties::reduceConfiguration()
return true;
if (removeValue(EGL_DEPTH_SIZE))
return true;
-#if defined(EGL_BIND_TO_TEXTURE_RGB)
+#ifdef EGL_BIND_TO_TEXTURE_RGB
if (removeValue(EGL_BIND_TO_TEXTURE_RGB))
return true;
#endif
@@ -327,6 +330,10 @@ QString QEglProperties::toString() const
if ((val & EGL_OPENGL_ES2_BIT) != 0)
types += QLatin1String("es2");
#endif
+#ifdef EGL_OPENGL_BIT
+ if ((val & EGL_OPENGL_BIT) != 0)
+ types += QLatin1String("gl");
+#endif
if ((val & EGL_OPENVG_BIT) != 0)
types += QLatin1String("vg");
if ((val & ~7) != 0)