diff options
author | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2013-08-26 08:18:56 +0200 |
---|---|---|
committer | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2015-02-08 10:35:22 +0000 |
commit | b09f2e8440b7a0c9532d730d52296cf05b944ee2 (patch) | |
tree | f70d559074195c454f31d0e48292e8b43bae0eb2 /examples | |
parent | 2322ef51948ef20afb3a93d1fea7830dfee4f7d6 (diff) | |
download | qtwayland-b09f2e8440b7a0c9532d730d52296cf05b944ee2.tar.gz |
Add QWaylandOutput to support multiple outputs
Add a new QWaylandOutput class to support multiple outputs.
Each QWaylandOutput need a window for rendering.
Rename OutputGlobal to Output and Output to OutputResource.
Add support for physical size, mode and available geometry.
Use better defaults for geometry and refreshRate from the QWindow
if available.
A window is no longer passed to QWaylandCompositor constructor
and all output related methods are removed, however one or more
outputs are required for hardware integration.
QWaylandCompositor returns a list of outputs and offers an API to add
or remove outputs.
Hardware integrations can run headless.
Change-Id: I742996571ddb78328f7bfa4f79b25a81995279e1
Done-with: Jan Arne Petersen <jan.petersen@kdab.com>
Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/wayland/qml-compositor/main.cpp | 5 | ||||
-rw-r--r-- | examples/wayland/qwindow-compositor/qwindowcompositor.cpp | 9 | ||||
-rw-r--r-- | examples/wayland/server-buffer/compositor/main.cpp | 5 |
3 files changed, 13 insertions, 6 deletions
diff --git a/examples/wayland/qml-compositor/main.cpp b/examples/wayland/qml-compositor/main.cpp index 26e730d4..06961dfc 100644 --- a/examples/wayland/qml-compositor/main.cpp +++ b/examples/wayland/qml-compositor/main.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** @@ -42,6 +43,7 @@ #include "qwaylandquicksurface.h" #include <QtCompositor/qwaylandsurfaceitem.h> +#include <QtCompositor/qwaylandoutput.h> #include <QGuiApplication> #include <QTimer> @@ -60,7 +62,7 @@ class QmlCompositor : public QQuickView, public QWaylandQuickCompositor public: QmlCompositor() - : QWaylandQuickCompositor(this, 0, DefaultExtensions | SubSurfaceExtension) + : QWaylandQuickCompositor(0, DefaultExtensions | SubSurfaceExtension) , m_fullscreenSurface(0) { setSource(QUrl("main.qml")); @@ -68,6 +70,7 @@ public: setColor(Qt::black); winId(); addDefaultShell(); + createOutput(this, "", ""); connect(this, SIGNAL(afterRendering()), this, SLOT(sendCallbacks())); } diff --git a/examples/wayland/qwindow-compositor/qwindowcompositor.cpp b/examples/wayland/qwindow-compositor/qwindowcompositor.cpp index c933152d..8801ad14 100644 --- a/examples/wayland/qwindow-compositor/qwindowcompositor.cpp +++ b/examples/wayland/qwindow-compositor/qwindowcompositor.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** @@ -55,6 +56,7 @@ #include <QtCompositor/qwaylandinput.h> #include <QtCompositor/qwaylandbufferref.h> #include <QtCompositor/qwaylandsurfaceview.h> +#include <QtCompositor/qwaylandoutput.h> QT_BEGIN_NAMESPACE @@ -108,7 +110,7 @@ public: }; QWindowCompositor::QWindowCompositor(CompositorWindow *window) - : QWaylandCompositor(window, 0, DefaultExtensions | SubSurfaceExtension) + : QWaylandCompositor(0, DefaultExtensions | SubSurfaceExtension) , m_window(window) , m_backgroundTexture(0) , m_textureBlitter(0) @@ -134,8 +136,7 @@ QWindowCompositor::QWindowCompositor(CompositorWindow *window) setRetainedSelectionEnabled(true); - setOutputGeometry(QRect(QPoint(0, 0), window->size())); - setOutputRefreshRate(qRound(qGuiApp->primaryScreen()->refreshRate() * 1000.0)); + createOutput(window, "", ""); addDefaultShell(); } @@ -321,7 +322,7 @@ void QWindowCompositor::render() // Draw the background image texture m_textureBlitter->drawTexture(m_backgroundTexture->textureId(), QRect(QPoint(0, 0), m_backgroundImage.size()), - window()->size(), + m_window->size(), 0, false, true); foreach (QWaylandSurface *surface, m_surfaces) { diff --git a/examples/wayland/server-buffer/compositor/main.cpp b/examples/wayland/server-buffer/compositor/main.cpp index 9f0108fa..0bf6408c 100644 --- a/examples/wayland/server-buffer/compositor/main.cpp +++ b/examples/wayland/server-buffer/compositor/main.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** @@ -54,6 +55,7 @@ #include <QQuickView> #include "qwayland-server-share-buffer.h" +#include <QtCompositor/qwaylandoutput.h> #include <QtCompositor/private/qwlcompositor_p.h> #include <QtCompositor/private/qwlserverbufferintegration_p.h> @@ -70,7 +72,7 @@ class QmlCompositor public: QmlCompositor() - : QWaylandQuickCompositor(this, 0, DefaultExtensions | SubSurfaceExtension) + : QWaylandQuickCompositor(0, DefaultExtensions | SubSurfaceExtension) , QtWaylandServer::qt_share_buffer(QWaylandCompositor::handle()->wl_display(), 1) , m_server_buffer_32_bit(0) , m_server_buffer_item_32_bit(0) @@ -82,6 +84,7 @@ public: setColor(Qt::black); create(); grabWindow(); + createOutput(this, "", ""); addDefaultShell(); connect(this, SIGNAL(afterRendering()), this, SLOT(sendCallbacks())); |