summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglextensions.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-03-22 09:48:39 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-03-26 12:32:53 (GMT)
commit75bb84ac0e6f17446d87a34ae8a644abff6009af (patch)
tree0aff2d7bd0d9f11042db103323ee72537cc41ae7 /src/opengl/qglextensions.cpp
parentfa40e6fd8b719e2edfdbde94ac70431c68e92449 (diff)
downloadQt-75bb84ac0e6f17446d87a34ae8a644abff6009af.zip
Qt-75bb84ac0e6f17446d87a34ae8a644abff6009af.tar.gz
Qt-75bb84ac0e6f17446d87a34ae8a644abff6009af.tar.bz2
Implement Texture-From-Pixmap using EGLImage extensions on X11/EGL
There's lots of EGLImage extensions, split between EGL and client rendering APIs like OpenGL ES & OpenVG. To implement texture-from- pixmap using EGLImage, both EGL extensions and OpenGL ES extensions are needed. This patch resolves the EGL extension function pointers after the display is initialized in QEgl::display(). These are then exported from QtGui so they can be used in QtOpenGL. The OpenGL ES extension function pointers are resolved using the usual qglextensions.cpp mechanism. Using EGLImage seems to remove a fixed ~10 millisecond overhead per pixmap bind when compared to using EGLSurface. Exact results per bind for 100 QPixmaps are: 8x8 Pixmap: 12 -> 1.71 msecs (EGLSurface -> EGLImage) 64x64 Pixmap: 11.6 -> 1.83 msecs (EGLSurface -> EGLImage) 128x128 Pixmap: 12.8 -> 2.74 msecs (EGLSurface -> EGLImage) 256x256 Pixmap: 16 -> 6.20 msecs (EGLSurface -> EGLImage) Reviewed-By: Trond
Diffstat (limited to 'src/opengl/qglextensions.cpp')
-rw-r--r--src/opengl/qglextensions.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp
index 02d5501..ef3c4cd 100644
--- a/src/opengl/qglextensions.cpp
+++ b/src/opengl/qglextensions.cpp
@@ -222,6 +222,17 @@ bool qt_resolve_buffer_extensions(QGLContext *ctx)
#endif
}
+#ifndef QT_NO_EGL
+bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx)
+{
+ if (glEGLImageTargetTexture2DOES || glEGLImageTargetRenderbufferStorageOES)
+ return true;
+ glEGLImageTargetTexture2DOES = (_glEGLImageTargetTexture2DOES) ctx->getProcAddress(QLatin1String("glEGLImageTargetTexture2DOES"));
+ glEGLImageTargetRenderbufferStorageOES = (_glEGLImageTargetRenderbufferStorageOES) ctx->getProcAddress(QLatin1String("glEGLImageTargetRenderbufferStorageOES"));
+ return glEGLImageTargetTexture2DOES && glEGLImageTargetRenderbufferStorageOES;
+}
+#endif
+
bool qt_resolve_glsl_extensions(QGLContext *ctx)
{
// Geometry shaders are optional...