diff options
Diffstat (limited to 'src/gui/egl')
-rw-r--r-- | src/gui/egl/egl.pri | 22 | ||||
-rw-r--r-- | src/gui/egl/qegl_p.h | 2 | ||||
-rw-r--r-- | src/gui/egl/qegl_qpa.cpp | 5 | ||||
-rw-r--r-- | src/gui/egl/qegl_qws.cpp | 114 | ||||
-rw-r--r-- | src/gui/egl/qegl_x11.cpp | 30 | ||||
-rw-r--r-- | src/gui/egl/qeglcontext_p.h | 4 | ||||
-rw-r--r-- | src/gui/egl/qeglproperties_p.h | 2 |
7 files changed, 30 insertions, 149 deletions
diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri index 8e8664c679..ec23da3312 100644 --- a/src/gui/egl/egl.pri +++ b/src/gui/egl/egl.pri @@ -25,19 +25,15 @@ contains(QT_CONFIG, egl): { wince*: SOURCES += egl/qegl_wince.cpp unix { - embedded { - SOURCES += egl/qegl_qws.cpp - } else { - qpa { - SOURCES += egl/qegl_qpa.cpp - } else { - symbian { - SOURCES += egl/qegl_symbian.cpp - } else { - SOURCES += egl/qegl_x11.cpp - } - } - } + qpa { + SOURCES += egl/qegl_qpa.cpp + } else { + symbian { + SOURCES += egl/qegl_symbian.cpp + } else { + SOURCES += egl/qegl_x11.cpp + } + } } } else:symbian { DEFINES += QT_NO_EGL diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h index 9b0d82e69f..e0c02aa150 100644 --- a/src/gui/egl/qegl_p.h +++ b/src/gui/egl/qegl_p.h @@ -47,7 +47,7 @@ // ------------- // // This file is not part of the Qt API. It exists for the convenience of -// the QtOpenGL and QtOpenVG modules. This header file may change from +// the QtGui and QtOpenVG modules. This header file may change from // version to version without notice, or even be removed. // // We mean it. diff --git a/src/gui/egl/qegl_qpa.cpp b/src/gui/egl/qegl_qpa.cpp index 9b99e8b94a..c3eb044b22 100644 --- a/src/gui/egl/qegl_qpa.cpp +++ b/src/gui/egl/qegl_qpa.cpp @@ -46,7 +46,6 @@ #if !defined(QT_NO_EGL) -#include <QtGui/private/qgraphicssystem_p.h> #include <QtGui/private/qapplication_p.h> #include <QtGui/qdesktopwidget.h> @@ -75,7 +74,7 @@ EGLNativePixmapType QEgl::nativePixmap(QPixmap* pixmap) static QPlatformScreen *screenForDevice(QPaintDevice *device) { - QPlatformIntegration *pi = QApplicationPrivate::platformIntegration(); + QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); QList<QPlatformScreen *> screens = pi->screens(); @@ -95,7 +94,7 @@ void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev) if (!dev) return; - // Find the QGLScreen for this paint device. + // Find the QOpenGLScreen for this paint device. QPlatformScreen *screen = screenForDevice(dev); if (!screen) return; diff --git a/src/gui/egl/qegl_qws.cpp b/src/gui/egl/qegl_qws.cpp deleted file mode 100644 index b39f4dc521..0000000000 --- a/src/gui/egl/qegl_qws.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui/qpaintdevice.h> -#include <QtGui/qpixmap.h> -#include <QtGui/qwidget.h> - -#include "qegl_p.h" -#include "qeglcontext_p.h" - -#if !defined(QT_NO_EGL) - -#include <qscreen_qws.h> -#include <qscreenproxy_qws.h> -#include <qapplication.h> -#include <qdesktopwidget.h> - -QT_BEGIN_NAMESPACE - -static QScreen *screenForDevice(QPaintDevice *device) -{ - QScreen *screen = qt_screen; - if (!screen) - return 0; - if (screen->classId() == QScreen::MultiClass) { - int screenNumber; - if (device && device->devType() == QInternal::Widget) - screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device)); - else - screenNumber = 0; - screen = screen->subScreens()[screenNumber]; - } - while (screen->classId() == QScreen::ProxyClass || - screen->classId() == QScreen::TransformedClass) { - screen = static_cast<QProxyScreen *>(screen)->screen(); - } - return screen; -} - -// Set pixel format and other properties based on a paint device. -void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev) -{ - if (!dev) - return; - - // Find the QGLScreen for this paint device. - QScreen *screen = screenForDevice(dev); - if (!screen) - return; - int devType = dev->devType(); - if (devType == QInternal::Image) - setPixelFormat(static_cast<QImage *>(dev)->format()); - else - setPixelFormat(screen->pixelFormat()); -} - -EGLNativeDisplayType QEgl::nativeDisplay() -{ - return EGLNativeDisplayType(EGL_DEFAULT_DISPLAY); -} - -EGLNativeWindowType QEgl::nativeWindow(QWidget* widget) -{ - return (EGLNativeWindowType)(widget->winId()); // Might work -} - -EGLNativePixmapType QEgl::nativePixmap(QPixmap*) -{ - qWarning("QEgl: EGL pixmap surfaces not supported on QWS"); - return (EGLNativePixmapType)0; -} - - -QT_END_NAMESPACE - -#endif // !QT_NO_EGL diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp index c0f8a240fb..4fd8a15157 100644 --- a/src/gui/egl/qegl_x11.cpp +++ b/src/gui/egl/qegl_x11.cpp @@ -43,7 +43,7 @@ #include <QtGui/private/qt_x11_p.h> #include <QtGui/qx11info_x11.h> -#include <QtGui/private/qpixmapdata_p.h> +#include <QtGui/qplatformpixmap_qpa.h> #include <QtGui/private/qpixmap_x11_p.h> #include <QtGui/private/qimagepixmapcleanuphooks_p.h> @@ -339,14 +339,14 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg return EGL_NO_SURFACE; } - QX11PixmapData *x11PixmapData = 0; + QX11PlatformPixmap *x11PlatformPixmap = 0; if (devType == QInternal::Pixmap) { - QPixmapData *pmd = static_cast<QPixmap*>(device)->data_ptr().data(); - if (pmd->classId() == QPixmapData::X11Class) - x11PixmapData = static_cast<QX11PixmapData*>(pmd); + QPlatformPixmap *pmd = static_cast<QPixmap*>(device)->data_ptr().data(); + if (pmd->classId() == QPlatformPixmap::X11Class) + x11PlatformPixmap = static_cast<QX11PlatformPixmap*>(pmd); else { - // TODO: Replace the pixmap's data with a new QX11PixmapData - qWarning("WARNING: Creating an EGL surface on a QPixmap is only supported for QX11PixmapData"); + // TODO: Replace the pixmap's data with a new QX11PlatformPixmap + qWarning("WARNING: Creating an EGL surface on a QPixmap is only supported for QX11PlatformPixmap"); return EGL_NO_SURFACE; } } else if ((devType != QInternal::Widget) && (devType != QInternal::Pbuffer)) { @@ -426,11 +426,11 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg return surf; } - if (x11PixmapData) { + if (x11PlatformPixmap) { // X11 Pixmaps are only created with a depth, so that's all we need to check EGLint configDepth; eglGetConfigAttrib(QEgl::display(), config, EGL_BUFFER_SIZE , &configDepth); - if (x11PixmapData->depth() != configDepth) { + if (x11PlatformPixmap->depth() != configDepth) { // The bit depths are wrong which means the EGLConfig isn't compatable with // this pixmap. So we need to replace the pixmap's existing data with a new // one which is created with the correct depth: @@ -438,13 +438,13 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg #ifndef QT_NO_XRENDER if (configDepth == 32) { qWarning("Warning: EGLConfig's depth (32) != pixmap's depth (%d), converting to ARGB32", - x11PixmapData->depth()); - x11PixmapData->convertToARGB32(true); + x11PlatformPixmap->depth()); + x11PlatformPixmap->convertToARGB32(true); } else #endif { qWarning("Warning: EGLConfig's depth (%d) != pixmap's depth (%d)", - configDepth, x11PixmapData->depth()); + configDepth, x11PlatformPixmap->depth()); } } @@ -458,10 +458,10 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg surfaceAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB); EGLSurface surf = eglCreatePixmapSurface(QEgl::display(), config, - (EGLNativePixmapType) x11PixmapData->handle(), + (EGLNativePixmapType) x11PlatformPixmap->handle(), surfaceAttribs.properties()); - x11PixmapData->gl_surface = (void*)surf; - QImagePixmapCleanupHooks::enableCleanupHooks(x11PixmapData); + x11PlatformPixmap->gl_surface = (void*)surf; + QImagePixmapCleanupHooks::enableCleanupHooks(x11PlatformPixmap); return surf; } diff --git a/src/gui/egl/qeglcontext_p.h b/src/gui/egl/qeglcontext_p.h index 6cd76b386c..7ea18627d1 100644 --- a/src/gui/egl/qeglcontext_p.h +++ b/src/gui/egl/qeglcontext_p.h @@ -47,7 +47,7 @@ // ------------- // // This file is not part of the Qt API. It exists for the convenience of -// the QtOpenGL and QtOpenVG modules. This header file may change from +// the QtGui and QtOpenVG modules. This header file may change from // version to version without notice, or even be removed. // // We mean it. @@ -109,7 +109,7 @@ private: static void setCurrentContext(QEgl::API api, QEglContext *context); friend class QMeeGoGraphicsSystem; - friend class QMeeGoPixmapData; + friend class QMeeGoPlatformPixmap; }; QT_END_NAMESPACE diff --git a/src/gui/egl/qeglproperties_p.h b/src/gui/egl/qeglproperties_p.h index 2d03cd0494..d8d64e01a1 100644 --- a/src/gui/egl/qeglproperties_p.h +++ b/src/gui/egl/qeglproperties_p.h @@ -47,7 +47,7 @@ // ------------- // // This file is not part of the Qt API. It exists for the convenience -// of the QtOpenGL and QtOpenVG modules. This header file may change from +// of the QtGui and QtOpenVG modules. This header file may change from // version to version without notice, or even be removed. // // We mean it. |