summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-25 01:50:14 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-25 01:50:14 (GMT)
commitfafec8f2363fd7ab3ce5b81a66cc82001a58c8ed (patch)
tree4dd0d27f1974eb2bcdd6ae4b11baa80dd9c90dd3 /src/opengl
parent9f814e1efe11ced6d7b64d1fcc52382631f9cb52 (diff)
downloadQt-fafec8f2363fd7ab3ce5b81a66cc82001a58c8ed.zip
Qt-fafec8f2363fd7ab3ce5b81a66cc82001a58c8ed.tar.gz
Qt-fafec8f2363fd7ab3ce5b81a66cc82001a58c8ed.tar.bz2
Move common EGL functions to qgl_egl.cpp
There were several copies of the same stubbed functions in qgl_wince.cpp, qgl_qws.cpp, and qgl_x11egl.cpp. Move them all to a common location for easier maintainence. Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl_egl.cpp37
-rw-r--r--src/opengl/qgl_qws.cpp39
-rw-r--r--src/opengl/qgl_wince.cpp33
-rw-r--r--src/opengl/qgl_x11egl.cpp40
4 files changed, 37 insertions, 112 deletions
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index deb7092..5ce1a45 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -129,6 +129,11 @@ void qt_egl_update_format(const QEglContext& context, QGLFormat& format)
context.clearError();
}
+bool QGLFormat::hasOpenGL()
+{
+ return true;
+}
+
void QGLContext::reset()
{
Q_D(QGLContext);
@@ -180,4 +185,36 @@ void QGLContext::swapBuffers() const
d->eglContext->swapBuffers(d->eglSurface);
}
+void QGLWidget::setMouseTracking(bool enable)
+{
+ QWidget::setMouseTracking(enable);
+}
+
+QColor QGLContext::overlayTransparentColor() const
+{
+ return d_func()->transpColor;
+}
+
+uint QGLContext::colorIndex(const QColor &c) const
+{
+ Q_UNUSED(c);
+ return 0;
+}
+
+void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
+{
+ Q_UNUSED(fnt);
+ Q_UNUSED(listBase);
+}
+
+void *QGLContext::getProcAddress(const QString &proc) const
+{
+ return (void*)eglGetProcAddress(reinterpret_cast<const char *>(proc.toLatin1().data()));
+}
+
+bool QGLWidgetPrivate::renderCxPm(QPixmap*)
+{
+ return false;
+}
+
QT_END_NAMESPACE
diff --git a/src/opengl/qgl_qws.cpp b/src/opengl/qgl_qws.cpp
index d158e44..bb23ace 100644
--- a/src/opengl/qgl_qws.cpp
+++ b/src/opengl/qgl_qws.cpp
@@ -87,12 +87,6 @@ static QGLScreen *glScreenForDevice(QPaintDevice *device)
*****************************************************************************/
//#define DEBUG_OPENGL_REGION_UPDATE
-bool QGLFormat::hasOpenGL()
-{
- return true;
-}
-
-
bool QGLFormat::hasOpenGLOverlays()
{
QGLScreen *glScreen = glScreenForDevice(0);
@@ -231,39 +225,11 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
}
-QColor QGLContext::overlayTransparentColor() const
-{
- return QColor(0, 0, 0); // Invalid color
-}
-
-uint QGLContext::colorIndex(const QColor &c) const
-{
- //### color index doesn't work on egl
- Q_UNUSED(c);
- return 0;
-}
-
-void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
-{
- Q_UNUSED(fnt);
- Q_UNUSED(listBase);
-}
-
-void *QGLContext::getProcAddress(const QString &proc) const
-{
- return (void*)eglGetProcAddress(reinterpret_cast<const char *>(proc.toLatin1().data()));
-}
-
bool QGLWidget::event(QEvent *e)
{
return QWidget::event(e);
}
-void QGLWidget::setMouseTracking(bool enable)
-{
- QWidget::setMouseTracking(enable);
-}
-
void QGLWidget::resizeEvent(QResizeEvent *)
{
@@ -328,11 +294,6 @@ void QGLWidgetPrivate::init(QGLContext *context, const QGLWidget* shareWidget)
}
}
-bool QGLWidgetPrivate::renderCxPm(QPixmap*)
-{
- return false;
-}
-
void QGLWidgetPrivate::cleanupColormaps()
{
}
diff --git a/src/opengl/qgl_wince.cpp b/src/opengl/qgl_wince.cpp
index dbb5c98..53b9e27 100644
--- a/src/opengl/qgl_wince.cpp
+++ b/src/opengl/qgl_wince.cpp
@@ -112,11 +112,6 @@ void qt_egl_add_platform_config(QEglProperties& props, QPaintDevice *device)
}
-bool QGLFormat::hasOpenGL()
-{
- return true;
-}
-
static bool opengl32dll = false;
bool QGLFormat::hasOpenGLOverlays()
@@ -416,23 +411,6 @@ const QRgb* QGLCmap::colors() const
}
-QColor QGLContext::overlayTransparentColor() const
-{
- return d_func()->transpColor;
-}
-
-
-void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
-{
- Q_UNUSED(fnt);
- Q_UNUSED(listBase);
-}
-
-void *QGLContext::getProcAddress(const QString &proc) const
-{
- return (void*)eglGetProcAddress(reinterpret_cast<const char *>(proc.toLatin1().data()));
-}
-
/*****************************************************************************
QGLWidget Win32/WGL-specific code
*****************************************************************************/
@@ -511,12 +489,6 @@ bool QGLWidget::event(QEvent *e)
}
-void QGLWidget::setMouseTracking(bool enable)
-{
- QWidget::setMouseTracking(enable);
-}
-
-
void QGLWidget::resizeEvent(QResizeEvent *)
{
Q_D(QGLWidget);
@@ -616,11 +588,6 @@ void QGLWidget::setContext(QGLContext *context,
}
-bool QGLWidgetPrivate::renderCxPm(QPixmap*)
-{
- return false;
-}
-
void QGLWidgetPrivate::cleanupColormaps()
{
Q_Q(QGLWidget);
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 2214775..67f391b 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -51,11 +51,6 @@
QT_BEGIN_NAMESPACE
-bool QGLFormat::hasOpenGL()
-{
- return true;
-}
-
bool QGLFormat::hasOpenGLOverlays()
{
return false;
@@ -118,36 +113,6 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
return true;
}
-
-QColor QGLContext::overlayTransparentColor() const
-{
- return QColor(0, 0, 0); // Invalid color
-}
-
-uint QGLContext::colorIndex(const QColor &c) const
-{
- //### color index doesn't work on egl
- Q_UNUSED(c);
- return 0;
-}
-
-void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
-{
- Q_UNUSED(fnt);
- Q_UNUSED(listBase);
-}
-
-void *QGLContext::getProcAddress(const QString &proc) const
-{
- return (void*)eglGetProcAddress(reinterpret_cast<const char *>(proc.toLatin1().data()));
-}
-
-void QGLWidget::setMouseTracking(bool enable)
-{
- QWidget::setMouseTracking(enable);
-}
-
-
void QGLWidget::resizeEvent(QResizeEvent *)
{
Q_D(QGLWidget);
@@ -391,11 +356,6 @@ void QGLWidgetPrivate::init(QGLContext *context, const QGLWidget* shareWidget)
}
}
-bool QGLWidgetPrivate::renderCxPm(QPixmap*)
-{
- return false;
-}
-
void QGLWidgetPrivate::cleanupColormaps()
{
}