From 9474f82f8a4ca4abfc349c17debd84f26148fc20 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 7 May 2011 22:25:30 +0200 Subject: QTDIR/src compiles again --- src/plugins/platforms/eglfs/qeglfswindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index f125eab3c1..66079edacb 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -46,7 +46,7 @@ #include "qeglfsscreen.h" #include -#include +#include QT_BEGIN_NAMESPACE -- cgit v1.2.3 From fc9a648dc03ec4531553bc3d65ae4dba3c5b5980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 6 Jun 2011 08:45:02 +0200 Subject: Make building of platform plugins indifferent if its out of source This requires some source files to be shipped with the Qt install They are now copied into QT_INSTALL_DATA/platform --- src/plugins/platforms/eglfs/eglfs.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro index 471cf63dd8..bcf5c6153a 100644 --- a/src/plugins/platforms/eglfs/eglfs.pro +++ b/src/plugins/platforms/eglfs/eglfs.pro @@ -25,7 +25,7 @@ HEADERS = qeglfsintegration.h \ qeglfswindowsurface.h \ qeglfsscreen.h -include(../fontdatabases/genericunix/genericunix.pri) +load(qpa/fontdatabases/genericunix) target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target -- cgit v1.2.3 From 310519d6d11da546b23c1cba307f37c24e0a5c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 15 Jul 2011 14:07:12 +0200 Subject: Rename QPixmapData to QPlatformPixmap. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes the API symmetric with the other Lighthouse APIs. Change-Id: I8a399f3c968ea35d4624711b31f2ac5bb94b7893 Reviewed-on: http://codereview.qt.nokia.com/1735 Reviewed-by: Qt Sanity Bot Reviewed-by: Jørgen Lind --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 6 +++--- src/plugins/platforms/eglfs/qeglfsintegration.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 9e8596f19e..716ae8a78e 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -73,12 +73,12 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons } } -QPixmapData *QEglFSIntegration::createPixmapData(QPixmapData::PixelType type) const +QPlatformPixmap *QEglFSIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const { #ifdef QEGL_EXTRA_DEBUG - qWarning("QEglIntegration::createPixmapData %d\n", type); + qWarning("QEglIntegration::createPlatformPixmap %d\n", type); #endif - return new QRasterPixmapData(type); + return new QRasterPlatformPixmap(type); } QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWidget *widget, WId winId) const diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 6252a9c0e4..9b86a0484e 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -57,7 +57,7 @@ public: QEglFSIntegration(); bool hasCapability(QPlatformIntegration::Capability cap) const; - QPixmapData *createPixmapData(QPixmapData::PixelType type) const; + QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const; QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const; QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const; -- cgit v1.2.3 From e4042435ba15e6da669f541cd43580f85dbeae3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 25 Jul 2011 14:55:45 +0200 Subject: Get the eglfs plugin compiling. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5addb1a2593a670d559b9fbf9183f52af410895b Reviewed-on: http://codereview.qt.nokia.com/2176 Reviewed-by: Qt Sanity Bot Reviewed-by: Jørgen Lind --- src/plugins/platforms/eglfs/eglfs.pro | 10 +- src/plugins/platforms/eglfs/qeglfsbackingstore.cpp | 104 +++++++++++++++++++++ src/plugins/platforms/eglfs/qeglfsbackingstore.h | 68 ++++++++++++++ src/plugins/platforms/eglfs/qeglfsintegration.cpp | 42 ++++----- src/plugins/platforms/eglfs/qeglfsintegration.h | 11 +-- src/plugins/platforms/eglfs/qeglfsscreen.cpp | 48 +++++----- src/plugins/platforms/eglfs/qeglfsscreen.h | 2 + src/plugins/platforms/eglfs/qeglfswindow.cpp | 23 +---- src/plugins/platforms/eglfs/qeglfswindow.h | 5 +- .../platforms/eglfs/qeglfswindowsurface.cpp | 101 -------------------- src/plugins/platforms/eglfs/qeglfswindowsurface.h | 67 ------------- 11 files changed, 235 insertions(+), 246 deletions(-) create mode 100644 src/plugins/platforms/eglfs/qeglfsbackingstore.cpp create mode 100644 src/plugins/platforms/eglfs/qeglfsbackingstore.h delete mode 100644 src/plugins/platforms/eglfs/qeglfswindowsurface.cpp delete mode 100644 src/plugins/platforms/eglfs/qeglfswindowsurface.h (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro index bcf5c6153a..9898d0baf8 100644 --- a/src/plugins/platforms/eglfs/eglfs.pro +++ b/src/plugins/platforms/eglfs/eglfs.pro @@ -2,7 +2,7 @@ TARGET = qeglfs TEMPLATE = lib CONFIG += plugin -QT += opengl core-private gui-private opengl-private +QT += opengl core-private gui-private opengl-private platformsupport-private widgets-private DESTDIR = $$QT.gui.plugins/platforms @@ -12,17 +12,13 @@ DESTDIR = $$QT.gui.plugins/platforms SOURCES = main.cpp \ qeglfsintegration.cpp \ - ../eglconvenience/qeglconvenience.cpp \ - ../eglconvenience/qeglplatformcontext.cpp \ qeglfswindow.cpp \ - qeglfswindowsurface.cpp \ + qeglfsbackingstore.cpp \ qeglfsscreen.cpp HEADERS = qeglfsintegration.h \ - ../eglconvenience/qeglconvenience.h \ - ../eglconvenience/qeglplatformcontext.h \ qeglfswindow.h \ - qeglfswindowsurface.h \ + qeglfsbackingstore.h \ qeglfsscreen.h load(qpa/fontdatabases/genericunix) diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp new file mode 100644 index 0000000000..c3090428de --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** 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 plugins 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 + +#include "qeglfsbackingstore.h" + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QEglFSPaintDevice : public QGLPaintDevice +{ +public: + QEglFSPaintDevice(QEglFSScreen *screen) + :QGLPaintDevice(), m_screen(screen) + { + #ifdef QEGL_EXTRA_DEBUG + qWarning("QEglPaintDevice %p, %p",this, screen); + #endif + } + + QSize size() const { return m_screen->geometry().size(); } + QGLContext* context() const { return QGLContext::fromGuiGLContext(m_screen->platformContext()->context()); } + + QPaintEngine *paintEngine() const { return qt_qgl_paint_engine(); } + + void beginPaint(){ + QGLPaintDevice::beginPaint(); + } +private: + QEglFSScreen *m_screen; + QGLContext *m_context; +}; + + +QEglFSBackingStore::QEglFSBackingStore(QWindow *window) + : QPlatformBackingStore(window) +{ +#ifdef QEGL_EXTRA_DEBUG + qWarning("QEglBackingStore %p, %p", window, screen); +#endif + m_paintDevice = new QEglFSPaintDevice(static_cast(window->screen()->handle())); +} + +void QEglFSBackingStore::flush(QWindow *widget, const QRegion ®ion, const QPoint &offset) +{ + Q_UNUSED(widget); + Q_UNUSED(region); + Q_UNUSED(offset); +#ifdef QEGL_EXTRA_DEBUG + qWarning("QEglBackingStore::flush %p",widget); +#endif + static_cast(m_paintDevice)->context()->swapBuffers(); +} + +void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents) +{ + Q_UNUSED(size); + Q_UNUSED(staticContents); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.h b/src/plugins/platforms/eglfs/qeglfsbackingstore.h new file mode 100644 index 0000000000..d6a28a7665 --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** 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 plugins 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$ +** +****************************************************************************/ + +#ifndef QEGLWINDOWSURFACE_H +#define QEGLWINDOWSURFACE_H + +#include "qeglfsintegration.h" +#include "qeglfswindow.h" + +#include + +QT_BEGIN_NAMESPACE + +class QEglFSBackingStore : public QPlatformBackingStore +{ +public: + QEglFSBackingStore(QWindow *window); + ~QEglFSBackingStore() {} + + QPaintDevice *paintDevice() { return m_paintDevice; } + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); + void resize(const QSize &size, const QRegion &staticContents); + +private: + QPaintDevice *m_paintDevice; +}; + +QT_END_NAMESPACE + +#endif // QEGLWINDOWSURFACE_H diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 716ae8a78e..884c24ca54 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -42,13 +42,15 @@ #include "qeglfsintegration.h" #include "qeglfswindow.h" -#include "qeglfswindowsurface.h" +#include "qeglfsbackingstore.h" -#include "qgenericunixfontdatabase.h" +#include +#include #include -#include -#include +#include +#include +#include #include @@ -57,9 +59,8 @@ QT_BEGIN_NAMESPACE QEglFSIntegration::QEglFSIntegration() : mFontDb(new QGenericUnixFontDatabase()) { - m_primaryScreen = new QEglFSScreen(EGL_DEFAULT_DISPLAY); + screenAdded(new QEglFSScreen(EGL_DEFAULT_DISPLAY)); - mScreens.append(m_primaryScreen); #ifdef QEGL_EXTRA_DEBUG qWarning("QEglIntegration\n"); #endif @@ -73,32 +74,26 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons } } -QPlatformPixmap *QEglFSIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const +QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const { #ifdef QEGL_EXTRA_DEBUG - qWarning("QEglIntegration::createPlatformPixmap %d\n", type); + qWarning("QEglIntegration::createPlatformWindow %p\n",window); #endif - return new QRasterPlatformPixmap(type); + return new QEglFSWindow(window); } -QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWidget *widget, WId winId) const + +QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const { - Q_UNUSED(winId); #ifdef QEGL_EXTRA_DEBUG - qWarning("QEglIntegration::createPlatformWindow %p\n",widget); + qWarning("QEglIntegration::createWindowSurface %p\n",widget); #endif - return new QEglFSWindow(widget, m_primaryScreen); + return new QEglFSBackingStore(window); } - -QWindowSurface *QEglFSIntegration::createWindowSurface(QWidget *widget, WId winId) const +QPlatformGLContext *QEglFSIntegration::createPlatformGLContext(QGuiGLContext *context) const { - Q_UNUSED(winId); - -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglIntegration::createWindowSurface %p\n",widget); -#endif - return new QEglFSWindowSurface(m_primaryScreen,widget); + return static_cast(context->screen()->handle())->platformContext(); } QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const @@ -106,4 +101,9 @@ QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const return mFontDb; } +QAbstractEventDispatcher *QEglFSIntegration::createEventDispatcher() const +{ + return createUnixEventDispatcher(); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 9b86a0484e..d8770dd51b 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -57,18 +57,17 @@ public: QEglFSIntegration(); bool hasCapability(QPlatformIntegration::Capability cap) const; - QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const; - QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const; - QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const; - QList screens() const { return mScreens; } + QPlatformWindow *createPlatformWindow(QWindow *window) const; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; + QPlatformGLContext *createPlatformGLContext(QGuiGLContext *context) const; QPlatformFontDatabase *fontDatabase() const; + QAbstractEventDispatcher *createEventDispatcher() const; + private: QPlatformFontDatabase *mFontDb; - QList mScreens; - QEglFSScreen *m_primaryScreen; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index 42195364ae..953ae704dc 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -40,9 +40,10 @@ ****************************************************************************/ #include "qeglfsscreen.h" +#include "qeglfswindow.h" -#include "../eglconvenience/qeglconvenience.h" -#include "../eglconvenience/qeglplatformcontext.h" +#include +#include #ifdef Q_OPENKODE #include @@ -86,6 +87,23 @@ static struct AttrInfo attrs[] = { {-1, 0}}; #endif //QEGL_EXTRA_DEBUG +class QEglFSContext : public QEGLPlatformContext +{ +public: + QEglFSContext(const QSurfaceFormat &format, QPlatformGLContext *share, EGLDisplay display, + EGLint eglClientVersion = 2, EGLenum eglApi = EGL_OPENGL_ES_API) + : QEGLPlatformContext(format, share, display, eglClientVersion, eglApi) + { + } + + EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) + { + QEglFSWindow *window = static_cast(surface); + QEglFSScreen *screen = static_cast(window->screen()); + return screen->surface(); + } +}; + QEglFSScreen::QEglFSScreen(EGLNativeDisplayType display) : m_depth(32) , m_format(QImage::Format_Invalid) @@ -136,32 +154,29 @@ void QEglFSScreen::createAndSetPlatformContext() const { void QEglFSScreen::createAndSetPlatformContext() { - QPlatformWindowFormat platformFormat = QPlatformWindowFormat::defaultFormat(); - - platformFormat.setWindowApi(QPlatformWindowFormat::OpenGL); + QSurfaceFormat platformFormat; QByteArray depthString = qgetenv("QT_QPA_EGLFS_DEPTH"); if (depthString.toInt() == 16) { - platformFormat.setDepth(16); + platformFormat.setDepthBufferSize(16); platformFormat.setRedBufferSize(5); platformFormat.setGreenBufferSize(6); platformFormat.setBlueBufferSize(5); m_depth = 16; m_format = QImage::Format_RGB16; } else { - platformFormat.setDepth(32); + platformFormat.setDepthBufferSize(32); platformFormat.setRedBufferSize(8); platformFormat.setGreenBufferSize(8); platformFormat.setBlueBufferSize(8); m_depth = 32; m_format = QImage::Format_RGB32; } - if (!qgetenv("QT_QPA_EGLFS_MULTISAMPLE").isEmpty()) { - platformFormat.setSampleBuffers(true); - } + if (!qgetenv("QT_QPA_EGLFS_MULTISAMPLE").isEmpty()) + platformFormat.setSamples(4); - EGLConfig config = q_configFromQPlatformWindowFormat(m_dpy, platformFormat); + EGLConfig config = q_configFromGLFormat(m_dpy, platformFormat); EGLNativeWindowType eglWindow = 0; #ifdef Q_OPENKODE @@ -193,16 +208,7 @@ void QEglFSScreen::createAndSetPlatformContext() qWarning("\n"); #endif - EGLint temp; - EGLint attribList[32]; - - temp = 0; - - attribList[temp++] = EGL_CONTEXT_CLIENT_VERSION; - attribList[temp++] = 2; // GLES version 2 - attribList[temp++] = EGL_NONE; - - QEGLPlatformContext *platformContext = new QEGLPlatformContext(m_dpy,config,attribList,m_surface,EGL_OPENGL_ES_API); + QEGLPlatformContext *platformContext = new QEglFSContext(platformFormat, 0, m_dpy); m_platformContext = platformContext; EGLint w,h; // screen size detection diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h index 5cf1daca6f..230acf3a4b 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.h +++ b/src/plugins/platforms/eglfs/qeglfsscreen.h @@ -64,6 +64,8 @@ public: QPlatformGLContext *platformContext() const; + EGLSurface surface() const { return m_surface; } + private: void createAndSetPlatformContext() const; void createAndSetPlatformContext(); diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index 24b17b75e7..25da588519 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -45,8 +45,8 @@ QT_BEGIN_NAMESPACE -QEglFSWindow::QEglFSWindow(QWidget *w, QEglFSScreen *screen) - : QPlatformWindow(w), m_screen(screen) +QEglFSWindow::QEglFSWindow(QWindow *w) + : QPlatformWindow(w) { static int serialNo = 0; m_winid = ++serialNo; @@ -55,15 +55,11 @@ QEglFSWindow::QEglFSWindow(QWidget *w, QEglFSScreen *screen) #endif } - void QEglFSWindow::setGeometry(const QRect &) { // We only support full-screen windows - QRect rect(m_screen->availableGeometry()); - QWindowSystemInterface::handleGeometryChange(this->widget(), rect); - - // Since toplevels are fullscreen, propegate the screen size back to the widget - widget()->setGeometry(rect); + QRect rect(screen()->availableGeometry()); + QWindowSystemInterface::handleGeometryChange(window(), rect); QPlatformWindow::setGeometry(rect); } @@ -73,15 +69,4 @@ WId QEglFSWindow::winId() const return m_winid; } - - -QPlatformGLContext *QEglFSWindow::glContext() const -{ -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglWindow::glContext %p\n", m_screen->platformContext()); -#endif - Q_ASSERT(m_screen); - return m_screen->platformContext(); -} - QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index 4e9a728772..09f553d3b7 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -53,15 +53,12 @@ QT_BEGIN_NAMESPACE class QEglFSWindow : public QPlatformWindow { public: - QEglFSWindow(QWidget *w, QEglFSScreen *screen); + QEglFSWindow(QWindow *w); void setGeometry(const QRect &); WId winId() const; - QPlatformGLContext *glContext() const; - private: - QEglFSScreen *m_screen; WId m_winid; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfswindowsurface.cpp b/src/plugins/platforms/eglfs/qeglfswindowsurface.cpp deleted file mode 100644 index 970402015f..0000000000 --- a/src/plugins/platforms/eglfs/qeglfswindowsurface.cpp +++ /dev/null @@ -1,101 +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 plugins 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 "qeglfswindowsurface.h" - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QEglFSPaintDevice : public QGLPaintDevice -{ -public: - QEglFSPaintDevice(QEglFSScreen *screen, QWidget *widget) - :QGLPaintDevice(), m_screen(screen) - { - #ifdef QEGL_EXTRA_DEBUG - qWarning("QEglPaintDevice %p, %p, %p",this, screen, widget); - #endif - } - - QSize size() const { return m_screen->geometry().size(); } - QGLContext* context() const { return QGLContext::fromPlatformGLContext(m_screen->platformContext());} - - QPaintEngine *paintEngine() const { return qt_qgl_paint_engine(); } - - void beginPaint(){ - QGLPaintDevice::beginPaint(); - } -private: - QEglFSScreen *m_screen; - QGLContext *m_context; -}; - - -QEglFSWindowSurface::QEglFSWindowSurface( QEglFSScreen *screen, QWidget *window ) - :QWindowSurface(window) -{ -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglWindowSurface %p, %p", window, screen); -#endif - m_paintDevice = new QEglFSPaintDevice(screen,window); -} - -void QEglFSWindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoint &offset) -{ - Q_UNUSED(widget); - Q_UNUSED(region); - Q_UNUSED(offset); -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglWindowSurface::flush %p",widget); -#endif - widget->platformWindow()->glContext()->swapBuffers(); -} - -void QEglFSWindowSurface::resize(const QSize &size) -{ - Q_UNUSED(size); -} - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfswindowsurface.h b/src/plugins/platforms/eglfs/qeglfswindowsurface.h deleted file mode 100644 index 9ce8fd4f53..0000000000 --- a/src/plugins/platforms/eglfs/qeglfswindowsurface.h +++ /dev/null @@ -1,67 +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 plugins 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$ -** -****************************************************************************/ - -#ifndef QEGLWINDOWSURFACE_H -#define QEGLWINDOWSURFACE_H - -#include "qeglfsintegration.h" -#include "qeglfswindow.h" - -#include - -QT_BEGIN_NAMESPACE - -class QEglFSWindowSurface : public QWindowSurface -{ -public: - QEglFSWindowSurface(QEglFSScreen *screen, QWidget *window); - ~QEglFSWindowSurface() {} - - QPaintDevice *paintDevice() { return m_paintDevice; } - void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); - void resize(const QSize &size); -private: - QPaintDevice *m_paintDevice; -}; - -QT_END_NAMESPACE - -#endif // QEGLWINDOWSURFACE_H -- cgit v1.2.3 From 5c435189d4faa5125ead13518784360a0f74b90f Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 8 Aug 2011 09:23:19 +0200 Subject: Implement map/unmap and force geometry EglFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia2d86e84acfeb30f41b06f106b93033fe54ed839 Reviewed-on: http://codereview.qt.nokia.com/2730 Reviewed-by: Qt Sanity Bot Reviewed-by: Jørgen Lind --- src/plugins/platforms/eglfs/qeglfswindow.cpp | 17 ++++++++++++++++- src/plugins/platforms/eglfs/qeglfswindow.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index 25da588519..298592bae3 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -51,8 +51,13 @@ QEglFSWindow::QEglFSWindow(QWindow *w) static int serialNo = 0; m_winid = ++serialNo; #ifdef QEGL_EXTRA_DEBUG - qWarning("QEglWindow %p: %p %p 0x%x\n", this, w, screen, uint(m_winid)); + qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_winid)); #endif + + QRect screenGeometry(screen()->availableGeometry()); + if (w->geometry() != screenGeometry) { + QWindowSystemInterface::handleGeometryChange(w, screenGeometry); + } } void QEglFSWindow::setGeometry(const QRect &) @@ -69,4 +74,14 @@ WId QEglFSWindow::winId() const return m_winid; } +void QEglFSWindow::setVisible(bool visible) +{ + if (visible) { + QWindowSystemInterface::handleMapEvent(window()); + } else { + QWindowSystemInterface::handleUnmapEvent(window()); + } + +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index 09f553d3b7..32a6e71683 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -58,6 +58,8 @@ public: void setGeometry(const QRect &); WId winId() const; + void setVisible(bool visible); + private: WId m_winid; }; -- cgit v1.2.3 From a36f23292b8ac873e392047b39d4131bb701e76e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 5 Aug 2011 13:35:57 +0200 Subject: make eglfs compile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I724b700ed87cbc5d69647032c0c9c8e7e1d82748 Reviewed-on: http://codereview.qt.nokia.com/2689 Reviewed-by: Qt Sanity Bot Reviewed-by: Samuel Rødal --- src/plugins/platforms/eglfs/eglfs.pro | 2 +- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 2 +- src/plugins/platforms/eglfs/qeglfsintegration.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro index 9898d0baf8..73698322dd 100644 --- a/src/plugins/platforms/eglfs/eglfs.pro +++ b/src/plugins/platforms/eglfs/eglfs.pro @@ -21,7 +21,7 @@ HEADERS = qeglfsintegration.h \ qeglfsbackingstore.h \ qeglfsscreen.h -load(qpa/fontdatabases/genericunix) +include(../../../platformsupport/fontdatabases/genericunix/genericunix.pri) target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 884c24ca54..442acdf746 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -101,7 +101,7 @@ QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const return mFontDb; } -QAbstractEventDispatcher *QEglFSIntegration::createEventDispatcher() const +QAbstractEventDispatcher *QEglFSIntegration::guiThreadEventDispatcher() const { return createUnixEventDispatcher(); } diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index d8770dd51b..66fda9c673 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -64,7 +64,7 @@ public: QPlatformFontDatabase *fontDatabase() const; - QAbstractEventDispatcher *createEventDispatcher() const; + QAbstractEventDispatcher *guiThreadEventDispatcher() const; private: QPlatformFontDatabase *mFontDb; -- cgit v1.2.3 From 24c7776c622b29fa3bdf62f7ab681c55af0d9bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 8 Aug 2011 12:39:38 +0200 Subject: Made QWindow::setVisible() send show and hide events. Change-Id: Ideae15f7bd6801d7afe2354627c0893b0b6a32ca Reviewed-on: http://codereview.qt.nokia.com/2741 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- src/plugins/platforms/eglfs/qeglfswindow.cpp | 10 ---------- src/plugins/platforms/eglfs/qeglfswindow.h | 2 -- 2 files changed, 12 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index 298592bae3..a6115cc829 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -74,14 +74,4 @@ WId QEglFSWindow::winId() const return m_winid; } -void QEglFSWindow::setVisible(bool visible) -{ - if (visible) { - QWindowSystemInterface::handleMapEvent(window()); - } else { - QWindowSystemInterface::handleUnmapEvent(window()); - } - -} - QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index 32a6e71683..09f553d3b7 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -58,8 +58,6 @@ public: void setGeometry(const QRect &); WId winId() const; - void setVisible(bool visible); - private: WId m_winid; }; -- cgit v1.2.3 From 5a23825f017ddebea698f6f81a36bd7ff7edadc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 25 Aug 2011 20:19:44 +0200 Subject: Introduce new platform capability ThreadedOpenGL. Lets the platform plugin advertise whether it's safe to use OpenGL from a different thread. With XCB we only advertise this if we have a reasonably new XCB libary, as older versions suffer from the xcb_wait_for_reply() blocking bug, which cause GL rendering in a separate to stall when using Mesa drivers. Change-Id: I4829df7e583a1c8aed218ae13a159d21266cc594 Reviewed-on: http://codereview.qt.nokia.com/3613 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 442acdf746..8b2346b5fd 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -70,6 +70,8 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons { switch (cap) { case ThreadedPixmaps: return true; + case OpenGL: return true; + case ThreadedOpenGL: return true; default: return QPlatformIntegration::hasCapability(cap); } } -- cgit v1.2.3 From 6e28e8441b698c3397c2c78125c877f2e9867cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 22 Aug 2011 10:49:28 +0200 Subject: Copy core GL functionality to QtGui with QGL -> QOpenGL naming. Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/eglfs/qeglfsbackingstore.cpp | 4 ++-- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 4 ++-- src/plugins/platforms/eglfs/qeglfsintegration.h | 2 +- src/plugins/platforms/eglfs/qeglfsscreen.cpp | 4 ++-- src/plugins/platforms/eglfs/qeglfsscreen.h | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp index c3090428de..1d27be7fb3 100644 --- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp +++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp @@ -43,7 +43,7 @@ #include "qeglfsbackingstore.h" -#include +#include #include #include @@ -62,7 +62,7 @@ public: } QSize size() const { return m_screen->geometry().size(); } - QGLContext* context() const { return QGLContext::fromGuiGLContext(m_screen->platformContext()->context()); } + QGLContext* context() const { return QGLContext::fromOpenGLContext(m_screen->platformContext()->context()); } QPaintEngine *paintEngine() const { return qt_qgl_paint_engine(); } diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 8b2346b5fd..3d3e05d351 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include @@ -93,7 +93,7 @@ QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *wi return new QEglFSBackingStore(window); } -QPlatformGLContext *QEglFSIntegration::createPlatformGLContext(QGuiGLContext *context) const +QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { return static_cast(context->screen()->handle())->platformContext(); } diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 66fda9c673..9538850faf 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -60,7 +60,7 @@ public: QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; - QPlatformGLContext *createPlatformGLContext(QGuiGLContext *context) const; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; QPlatformFontDatabase *fontDatabase() const; diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index 953ae704dc..6f317a375f 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -90,7 +90,7 @@ static struct AttrInfo attrs[] = { class QEglFSContext : public QEGLPlatformContext { public: - QEglFSContext(const QSurfaceFormat &format, QPlatformGLContext *share, EGLDisplay display, + QEglFSContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLint eglClientVersion = 2, EGLenum eglApi = EGL_OPENGL_ES_API) : QEGLPlatformContext(format, share, display, eglClientVersion, eglApi) { @@ -238,7 +238,7 @@ QImage::Format QEglFSScreen::format() const createAndSetPlatformContext(); return m_format; } -QPlatformGLContext *QEglFSScreen::platformContext() const +QPlatformOpenGLContext *QEglFSScreen::platformContext() const { if (!m_platformContext) { QEglFSScreen *that = const_cast(this); diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h index 230acf3a4b..41465d871c 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.h +++ b/src/plugins/platforms/eglfs/qeglfsscreen.h @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE -class QPlatformGLContext; +class QPlatformOpenGLContext; class QEglFSScreen : public QPlatformScreen //huh: FullScreenScreen ;) just to follow namespace { @@ -62,7 +62,7 @@ public: int depth() const; QImage::Format format() const; - QPlatformGLContext *platformContext() const; + QPlatformOpenGLContext *platformContext() const; EGLSurface surface() const { return m_surface; } @@ -73,7 +73,7 @@ private: QRect m_geometry; int m_depth; QImage::Format m_format; - QPlatformGLContext *m_platformContext; + QPlatformOpenGLContext *m_platformContext; EGLDisplay m_dpy; EGLSurface m_surface; }; -- cgit v1.2.3