diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-04-15 12:10:50 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-04-16 12:52:12 (GMT) |
commit | 5480e3b68da98253ae6ec58bd0db0075225a4e22 (patch) | |
tree | a23c222a11182edb210c9fc41a77431af1087540 /src | |
parent | dda010b51b8e3ec6955b64290ad47c0f43dcda73 (diff) | |
download | Qt-5480e3b68da98253ae6ec58bd0db0075225a4e22.zip Qt-5480e3b68da98253ae6ec58bd0db0075225a4e22.tar.gz Qt-5480e3b68da98253ae6ec58bd0db0075225a4e22.tar.bz2 |
Cleanup & remove unused function overloads from QEgl* APIs
This should make stubbing out these APIs slightly easier.
Reviewed-By: TrustMe
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/egl/qegl.cpp | 58 | ||||
-rw-r--r-- | src/gui/egl/qegl_p.h | 5 | ||||
-rw-r--r-- | src/gui/egl/qeglcontext_p.h | 6 | ||||
-rw-r--r-- | src/gui/egl/qeglproperties.cpp | 14 | ||||
-rw-r--r-- | src/gui/egl/qeglproperties_p.h | 2 | ||||
-rw-r--r-- | src/opengl/qgl_egl.cpp | 2 | ||||
-rw-r--r-- | src/opengl/qglpixelbuffer_egl.cpp | 4 | ||||
-rw-r--r-- | src/openvg/qwindowsurface_vgegl.cpp | 21 |
8 files changed, 10 insertions, 102 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index 0fe5cbe..bf9f530 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -484,42 +484,6 @@ bool QEglContext::swapBuffers(EGLSurface surface) return ok; } -// Wait for native rendering operations to complete before starting -// to use OpenGL/OpenVG operations. -void QEglContext::waitNative() -{ -#ifdef EGL_CORE_NATIVE_ENGINE - eglWaitNative(EGL_CORE_NATIVE_ENGINE); -#endif -} - -// Wait for client OpenGL/OpenVG operations to complete before -// using native rendering operations. -void QEglContext::waitClient() -{ -#ifdef EGL_OPENGL_ES_API - if (apiType == QEgl::OpenGL) { - eglBindAPI(EGL_OPENGL_ES_API); - eglWaitClient(); - } -#else - if (apiType == QEgl::OpenGL) - eglWaitGL(); -#endif -#ifdef EGL_OPENVG_API - if (apiType == QEgl::OpenVG) { - eglBindAPI(EGL_OPENVG_API); - eglWaitClient(); - } -#endif -} - -// Query the value of a configuration attribute. -bool QEglContext::configAttrib(int name, EGLint *value) const -{ - return eglGetConfigAttrib(QEgl::display(), cfg, name, value); -} - int QEglContext::configAttrib(int name) const { EGLint value; @@ -530,12 +494,6 @@ int QEglContext::configAttrib(int name) const return EGL_DONT_CARE; } -QEglProperties QEglContext::configProperties() const -{ - return QEglProperties(config()); -} - - typedef EGLImageKHR (EGLAPIENTRY *_eglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint*); typedef EGLBoolean (EGLAPIENTRY *_eglDestroyImageKHR)(EGLDisplay, EGLImageKHR); @@ -673,22 +631,6 @@ QString QEgl::errorString(EGLint code) } } -QString QEgl::errorString() -{ - return errorString(error()); -} - -void QEgl::clearError() -{ - eglGetError(); -} - -EGLint QEgl::error() -{ - return eglGetError(); -} - - // Dump all of the EGL configurations supported by the system. void QEgl::dumpAllConfigs() { diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h index 6345d5d..83bdb5e 100644 --- a/src/gui/egl/qegl_p.h +++ b/src/gui/egl/qegl_p.h @@ -182,10 +182,7 @@ namespace QEgl { Q_GUI_EXPORT void dumpAllConfigs(); - Q_GUI_EXPORT void clearError(); - Q_GUI_EXPORT EGLint error(); - Q_GUI_EXPORT QString errorString(EGLint code); - Q_GUI_EXPORT QString errorString(); + Q_GUI_EXPORT QString errorString(EGLint code = eglGetError()); Q_GUI_EXPORT QString extensions(); Q_GUI_EXPORT bool hasExtension(const char* extensionName); diff --git a/src/gui/egl/qeglcontext_p.h b/src/gui/egl/qeglcontext_p.h index 7eec7eb..ccde00d 100644 --- a/src/gui/egl/qeglcontext_p.h +++ b/src/gui/egl/qeglcontext_p.h @@ -85,10 +85,6 @@ public: bool lazyDoneCurrent(); bool swapBuffers(EGLSurface surface); - void waitNative(); - void waitClient(); - - bool configAttrib(int name, EGLint *value) const; int configAttrib(int name) const; EGLContext context() const { return ctx; } @@ -99,8 +95,6 @@ public: EGLConfig config() const { return cfg; } void setConfig(EGLConfig config) { cfg = config; } - QEglProperties configProperties() const; - private: QEgl::API apiType; EGLContext ctx; diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp index b34d2c3..5543547 100644 --- a/src/gui/egl/qeglproperties.cpp +++ b/src/gui/egl/qeglproperties.cpp @@ -292,20 +292,6 @@ static void addTag(QString& str, const QString& tag) str += tag; } -void QEglProperties::dumpAllConfigs() -{ - EGLint count = 0; - eglGetConfigs(QEgl::display(), 0, 0, &count); - if (count < 1) - return; - - EGLConfig *configs = new EGLConfig [count]; - eglGetConfigs(QEgl::display(), configs, count, &count); - for (EGLint index = 0; index < count; ++index) - qWarning() << QEglProperties(configs[index]).toString(); - delete [] configs; -} - // Convert a property list to a string suitable for debug output. QString QEglProperties::toString() const { diff --git a/src/gui/egl/qeglproperties_p.h b/src/gui/egl/qeglproperties_p.h index eebcf72..b1f9642 100644 --- a/src/gui/egl/qeglproperties_p.h +++ b/src/gui/egl/qeglproperties_p.h @@ -90,8 +90,6 @@ public: QString toString() const; - static void dumpAllConfigs(); - private: QVarLengthArray<int> props; }; diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index 822c9f6..0fbbbf9 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -147,7 +147,7 @@ void qt_glformat_from_eglconfig(QGLFormat& format, const EGLConfig config) // Clear the EGL error state because some of the above may // have errored out because the attribute is not applicable // to the surface type. Such errors don't matter. - QEgl::clearError(); + eglGetError(); } bool QGLFormat::hasOpenGL() diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp index db9e754..0b94f5a 100644 --- a/src/opengl/qglpixelbuffer_egl.cpp +++ b/src/opengl/qglpixelbuffer_egl.cpp @@ -75,9 +75,9 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge ctx->setConfig(shareContext->config()); #if QGL_RENDER_TEXTURE EGLint value = EGL_FALSE; - if (ctx->configAttrib(EGL_BIND_TO_TEXTURE_RGBA, &value) && value) + if (ctx->configAttrib(EGL_BIND_TO_TEXTURE_RGBA) == EGL_TRUE) textureFormat = EGL_TEXTURE_RGBA; - else if (ctx->configAttrib(EGL_BIND_TO_TEXTURE_RGB, &value) && value) + else if (ctx->configAttrib(EGL_BIND_TO_TEXTURE_RGB) == EGL_TRUE) textureFormat = EGL_TEXTURE_RGB; #endif } else { diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index 13ae807..7850a5b 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -71,18 +71,13 @@ VGImageFormat qt_vg_config_to_vg_format(QEglContext *context) QImage::Format qt_vg_config_to_image_format(QEglContext *context) { - EGLint red = 0; - EGLint green = 0; - EGLint blue = 0; - EGLint alpha = 0; - context->configAttrib(EGL_RED_SIZE, &red); - context->configAttrib(EGL_GREEN_SIZE, &green); - context->configAttrib(EGL_BLUE_SIZE, &blue); - context->configAttrib(EGL_ALPHA_SIZE, &alpha); + EGLint red = context->configAttrib(EGL_RED_SIZE); + EGLint green = context->configAttrib(EGL_GREEN_SIZE); + EGLint blue = context->configAttrib(EGL_BLUE_SIZE); + EGLint alpha = context->configAttrib(EGL_ALPHA_SIZE); QImage::Format argbFormat; #ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT - EGLint type = 0; - context->configAttrib(EGL_SURFACE_TYPE, &type); + EGLint type = context->configAttrib(EGL_SURFACE_TYPE); if ((type & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0) argbFormat = QImage::Format_ARGB32_Premultiplied; else @@ -210,11 +205,7 @@ void qt_vg_unregister_pixmap(QVGPixmapData *pd) static bool isPremultipliedContext(const QEglContext *context) { - EGLint value = 0; - if (context->configAttrib(EGL_SURFACE_TYPE, &value)) - return (value & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0; - else - return false; + return context->configAttrib(EGL_SURFACE_TYPE) & EGL_VG_ALPHA_FORMAT_PRE_BIT; } #endif |