diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-02-11 14:59:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-13 20:54:01 +0100 |
commit | ff11af4fbc2948a3a3bc635549c7ac349d249abc (patch) | |
tree | 79d6544923010bb740913842c550a010c6ae6922 /src/plugins/platforms/eglfs | |
parent | 5b422304a9b97b628dc9990fd67e2f293d535b41 (diff) |
QOpenGLWidget and new-style compositing on eglfs
Integrate with QOpenGLTextureBlitter, QOpenGLWidget and friends.
Change-Id: Ic2867b713a21a3d2820d546174fc9164b3dd220c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r-- | src/plugins/platforms/eglfs/eglfs.pri | 2 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 25 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.h | 9 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsscreen.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfswindow.cpp | 6 |
5 files changed, 22 insertions, 24 deletions
diff --git a/src/plugins/platforms/eglfs/eglfs.pri b/src/plugins/platforms/eglfs/eglfs.pri index 7afa9c9e11..6e3ba54b97 100644 --- a/src/plugins/platforms/eglfs/eglfs.pri +++ b/src/plugins/platforms/eglfs/eglfs.pri @@ -1,7 +1,5 @@ QT += core-private gui-private platformsupport-private -#DEFINES += QEGL_EXTRA_DEBUG - # Avoid X11 header collision DEFINES += MESA_EGL_NO_X11_HEADERS diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 472e58cc72..2941806f17 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -88,17 +88,6 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons return QEGLPlatformIntegration::hasCapability(cap); } -QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const -{ - return new QEglFSContext(QEglFSHooks::hooks()->surfaceFormatFor(context->format()), context->shareHandle(), display()); -} - -QPlatformOffscreenSurface *QEglFSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const -{ - QEglFSScreen *screen = static_cast<QEglFSScreen *>(surface->screen()->handle()); - return new QEGLPbuffer(screen->display(), QEglFSHooks::hooks()->surfaceFormatFor(surface->requestedFormat()), surface); -} - void QEglFSIntegration::initialize() { QEglFSHooks::hooks()->platformInit(); @@ -124,6 +113,20 @@ QEGLPlatformWindow *QEglFSIntegration::createWindow(QWindow *window) const return new QEglFSWindow(window); } +QEGLPlatformContext *QEglFSIntegration::createContext(const QSurfaceFormat &format, + QPlatformOpenGLContext *shareContext, + EGLDisplay display) const +{ + return new QEglFSContext(QEglFSHooks::hooks()->surfaceFormatFor(format), shareContext, display); +} + +QPlatformOffscreenSurface *QEglFSIntegration::createOffscreenSurface(EGLDisplay display, + const QSurfaceFormat &format, + QOffscreenSurface *surface) const +{ + return new QEGLPbuffer(display, QEglFSHooks::hooks()->surfaceFormatFor(format), surface); +} + QVariant QEglFSIntegration::styleHint(QPlatformIntegration::StyleHint hint) const { switch (hint) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 9ff5bd6f3b..99dda1ea96 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -54,9 +54,6 @@ public: QEglFSIntegration(); ~QEglFSIntegration(); - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; - QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; - void initialize() Q_DECL_OVERRIDE; bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE; @@ -67,6 +64,12 @@ public: protected: QEGLPlatformScreen *createScreen() const Q_DECL_OVERRIDE; QEGLPlatformWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE; + QEGLPlatformContext *createContext(const QSurfaceFormat &format, + QPlatformOpenGLContext *shareContext, + EGLDisplay display) const Q_DECL_OVERRIDE; + QPlatformOffscreenSurface *createOffscreenSurface(EGLDisplay display, + const QSurfaceFormat &format, + QOffscreenSurface *surface) const Q_DECL_OVERRIDE; EGLNativeDisplayType nativeDisplay() const Q_DECL_OVERRIDE; private: diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index 11c1160ce9..31f6ac5be6 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -53,10 +53,6 @@ QEglFSScreen::QEglFSScreen(EGLDisplay dpy) m_rootWindow(0), m_rootContext(0) { -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglScreen %p\n", this); -#endif - m_cursor = QEglFSHooks::hooks()->createCursor(this); } diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index 279e7bbc91..2d36c0b58e 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -58,9 +58,6 @@ QEglFSWindow::QEglFSWindow(QWindow *w) , m_window(0) , m_flags(0) { -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_window)); -#endif } QEglFSWindow::~QEglFSWindow() @@ -114,7 +111,8 @@ void QEglFSWindow::create() QOpenGLContext *context = new QOpenGLContext(QGuiApplication::instance()); context->setFormat(window()->requestedFormat()); context->setScreen(window()->screen()); - context->create(); + if (!context->create()) + qFatal("EGLFS: Failed to create compositing context"); screen->setRootContext(context); screen->setRootWindow(this); } |