diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-03-29 16:49:31 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-03-29 16:56:20 (GMT) |
commit | 9e3304246acf5b58a2ce86eed082784da818a8f0 (patch) | |
tree | 87ca8e9321fe9ad310bdb36162ad27b95ae6cbaf /src/gui/egl | |
parent | 2be0e2ef4ec6702aaaebf7096fd527e2e161334a (diff) | |
download | Qt-9e3304246acf5b58a2ce86eed082784da818a8f0.zip Qt-9e3304246acf5b58a2ce86eed082784da818a8f0.tar.gz Qt-9e3304246acf5b58a2ce86eed082784da818a8f0.tar.bz2 |
Work-around Symbian 10.1's broken egl.h
In Symbian 10.1, egl.h itself includes eglext.h. This leads to
EGL_KHR_image & EGL_KHR_image_base being defined, but not the actual
function prototypes for eglCreateImageKHR/eglDestroyImageKHR. But,
because the extension defines were set, Qt assumed (wrongly) that
the EGL library would define eglCreateImageKHR. This left these
functions undefined. The work-around is to check the define
EGL_EGLEXT_PROTOTYPES and still define the function pointers if
it isn't set.
Reviewed-By: TrustMe
Diffstat (limited to 'src/gui/egl')
-rw-r--r-- | src/gui/egl/qegl.cpp | 2 | ||||
-rw-r--r-- | src/gui/egl/qegl_p.h | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index f36904d..498245c 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -528,7 +528,7 @@ QEglProperties QEglContext::configProperties() const return QEglProperties(config()); } -#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base) +#if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES) _eglCreateImageKHR eglCreateImageKHR = 0; _eglDestroyImageKHR eglDestroyImageKHR = 0; #endif diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h index 53abe4a..540cd3d 100644 --- a/src/gui/egl/qegl_p.h +++ b/src/gui/egl/qegl_p.h @@ -134,20 +134,25 @@ QT_BEGIN_NAMESPACE #endif +// Declare/define the bits of EGL_KHR_image_base we need: #if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base) - typedef void *EGLImageKHR; #define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) #define EGL_IMAGE_PRESERVED_KHR 0x30D2 +#endif +// It is possible that something has included eglext.h (like Symbian 10.1's broken egl.h), in +// which case, EGL_KHR_image/EGL_KHR_image_base will be defined. They may have also defined +// the actual function prototypes, but generally EGL_EGLEXT_PROTOTYPES will be defined in that +// case and we shouldn't re-define them here. +#if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES) typedef EGLImageKHR (EGLAPIENTRY *_eglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, EGLint*); typedef EGLBoolean (EGLAPIENTRY *_eglDestroyImageKHR)(EGLDisplay, EGLImageKHR); // Defined in qegl.cpp: extern Q_GUI_EXPORT _eglCreateImageKHR eglCreateImageKHR; extern Q_GUI_EXPORT _eglDestroyImageKHR eglDestroyImageKHR; - -#endif // !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base) +#endif // (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES) #if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_pixmap) #define EGL_NATIVE_PIXMAP_KHR 0x30B0 |