diff options
Diffstat (limited to 'src/quick/scenegraph/adaptations')
12 files changed, 47 insertions, 28 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp index af3b901af4..ca620965a8 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp @@ -77,11 +77,6 @@ QSGSoftwareRenderableNode *QSGAbstractSoftwareRenderer::renderableNode(QSGNode * return m_nodes.value(node, nullptr); } -const QLinkedList<QSGSoftwareRenderableNode*> &QSGAbstractSoftwareRenderer::renderableNodes() const -{ - return m_renderableNodes; -} - void QSGAbstractSoftwareRenderer::addNodeMapping(QSGNode *node, QSGSoftwareRenderableNode *renderableNode) { m_nodes.insert(node, renderableNode); diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h index 875569454f..e1b477ab97 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h @@ -54,7 +54,6 @@ #include <private/qsgrenderer_p.h> #include <QtCore/QHash> -#include <QtCore/QLinkedList> QT_BEGIN_NAMESPACE @@ -88,7 +87,6 @@ protected: QRect backgroundRect(); // only known after calling optimizeRenderList() bool isOpaque() const { return m_isOpaque; } - const QLinkedList<QSGSoftwareRenderableNode*> &renderableNodes() const; private: void nodeAdded(QSGNode *node); @@ -99,7 +97,7 @@ private: void nodeOpacityUpdated(QSGNode *node); QHash<QSGNode*, QSGSoftwareRenderableNode*> m_nodes; - QLinkedList<QSGSoftwareRenderableNode*> m_renderableNodes; + QVector<QSGSoftwareRenderableNode*> m_renderableNodes; QSGSimpleRectNode *m_background; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp index 5b5bf005d8..7b5ee66df6 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp @@ -99,8 +99,9 @@ QSGInternalRectangleNode *QSGSoftwareContext::createInternalRectangleNode() return new QSGSoftwareInternalRectangleNode(); } -QSGInternalImageNode *QSGSoftwareContext::createInternalImageNode() +QSGInternalImageNode *QSGSoftwareContext::createInternalImageNode(QSGRenderContext *renderContext) { + Q_UNUSED(renderContext); return new QSGSoftwareInternalImageNode(); } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h index 1f14717416..84f468ce33 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h @@ -89,7 +89,7 @@ public: QSGRenderContext *createRenderContext() override { return new QSGSoftwareRenderContext(this); } QSGInternalRectangleNode *createInternalRectangleNode() override; - QSGInternalImageNode *createInternalImageNode() override; + QSGInternalImageNode *createInternalImageNode(QSGRenderContext *renderContext) override; QSGPainterNode *createPainterNode(QQuickPaintedItem *item) override; QSGGlyphNode *createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode) override; QSGLayer *createLayer(QSGRenderContext *renderContext) override; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp index 70378d2950..683ccb60c2 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp @@ -45,7 +45,8 @@ QT_BEGIN_NAMESPACE QSGSoftwareLayer::QSGSoftwareLayer(QSGRenderContext *renderContext) - : m_item(nullptr) + : QSGLayer(*(new QSGSoftwareLayerPrivate)) + , m_item(nullptr) , m_context(renderContext) , m_renderer(nullptr) , m_device_pixel_ratio(1) @@ -69,6 +70,11 @@ int QSGSoftwareLayer::textureId() const return 0; } +int QSGSoftwareLayerPrivate::comparisonKey() const +{ + return 0; +} + QSize QSGSoftwareLayer::textureSize() const { return m_pixmap.size(); diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer_p.h index 9f5a22e66f..1859e14514 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer_p.h @@ -53,13 +53,16 @@ #include <private/qsgadaptationlayer_p.h> #include <private/qsgcontext_p.h> +#include <private/qsgtexture_p.h> QT_BEGIN_NAMESPACE class QSGSoftwarePixmapRenderer; +class QSGSoftwareLayerPrivate; class QSGSoftwareLayer : public QSGLayer { + Q_DECLARE_PRIVATE(QSGSoftwareLayer) Q_OBJECT public: QSGSoftwareLayer(QSGRenderContext *renderContext); @@ -117,6 +120,13 @@ private: bool m_dirtyTexture; }; +class QSGSoftwareLayerPrivate : public QSGTexturePrivate +{ + Q_DECLARE_PUBLIC(QSGSoftwareLayer) +public: + int comparisonKey() const override; +}; + QT_END_NAMESPACE #endif // QSGSOFTWARELAYER_H diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp index 16e3a111ae..82a48d80ca 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp @@ -38,10 +38,12 @@ ****************************************************************************/ #include "qsgsoftwarepixmaptexture_p.h" +#include <private/qsgcontext_p.h> QT_BEGIN_NAMESPACE QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(const QImage &image, uint flags) + : QSGTexture(*(new QSGSoftwarePixmapTexturePrivate)) { // Prevent pixmap format conversion to reduce memory consumption // and surprises in calling code. (See QTBUG-47328) @@ -55,11 +57,11 @@ QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(const QImage &image, uint fla } QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(const QPixmap &pixmap) - : m_pixmap(pixmap) + : QSGTexture(*(new QSGSoftwarePixmapTexturePrivate)), + m_pixmap(pixmap) { } - int QSGSoftwarePixmapTexture::textureId() const { return 0; @@ -85,6 +87,11 @@ void QSGSoftwarePixmapTexture::bind() Q_UNREACHABLE(); } +int QSGSoftwarePixmapTexturePrivate::comparisonKey() const +{ + return 0; +} + QT_END_NAMESPACE #include "moc_qsgsoftwarepixmaptexture_p.cpp" diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture_p.h index 034fa25da9..baa62d93de 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture_p.h @@ -52,12 +52,16 @@ // #include <private/qsgtexture_p.h> +#include <QtGui/QPixmap> QT_BEGIN_NAMESPACE +class QSGSoftwarePixmapTexturePrivate; + class QSGSoftwarePixmapTexture : public QSGTexture { Q_OBJECT + Q_DECLARE_PRIVATE(QSGSoftwarePixmapTexture) public: QSGSoftwarePixmapTexture(const QImage &image, uint flags); QSGSoftwarePixmapTexture(const QPixmap &pixmap); @@ -74,6 +78,13 @@ private: QPixmap m_pixmap; }; +class QSGSoftwarePixmapTexturePrivate : public QSGTexturePrivate +{ + Q_DECLARE_PUBLIC(QSGSoftwarePixmapTexture) +public: + int comparisonKey() const override; +}; + QT_END_NAMESPACE #endif // QSGSOFTWAREPIXMAPTEXTURE_H diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp index 20286a03d5..141d8f3c6d 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp @@ -41,6 +41,7 @@ #include "qsgsoftwarelayer_p.h" #include "qsgsoftwarepixmaptexture_p.h" #include "qsgsoftwareinternalimagenode_p.h" +#include <private/qsgplaintexture_p.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp index 7fb531cca3..95c7efd4cb 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp @@ -52,7 +52,7 @@ #include <qsgsimplerectnode.h> #include <qsgsimpletexturenode.h> #include <private/qsgrendernode_p.h> -#include <private/qsgtexture_p.h> +#include <private/qsgplaintexture_p.h> #include <qmath.h> diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp index f5a41410ee..c97dcb9326 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp @@ -100,7 +100,7 @@ void QSGSoftwareRenderLoop::windowDestroyed(QQuickWindow *window) rc->invalidate(); } - delete d->animationController; + d->animationController.reset(); } void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window, bool isNewExpose) diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp index f8973af2fb..c6b463bb02 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp @@ -69,10 +69,6 @@ const QEvent::Type WM_Obscure = QEvent::Type(QEvent::User + 1); // Passed from the RL to RT when GUI has been locked, waiting for sync. const QEvent::Type WM_RequestSync = QEvent::Type(QEvent::User + 2); -// Passed by the RT to itself to trigger another render pass. This is typically -// a result of QQuickWindow::update(). -const QEvent::Type WM_RequestRepaint = QEvent::Type(QEvent::User + 3); - // Passed by the RL to the RT to maybe release resource if no windows are // rendering. const QEvent::Type WM_TryRelease = QEvent::Type(QEvent::User + 4); @@ -296,7 +292,7 @@ bool QSGSoftwareRenderThread::event(QEvent *e) QCoreApplication::processEvents(); QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); if (wme->destroying) - delete wd->animationController; + wd->animationController.reset(); } if (wme->destroying) active = false; @@ -353,13 +349,6 @@ bool QSGSoftwareRenderThread::event(QEvent *e) return true; } - case WM_RequestRepaint: - qCDebug(QSG_RASTER_LOG_RENDERLOOP, "RT - WM_RequestPaint"); - // When GUI posts this event, it is followed by a polishAndSync, so we - // must not exit the event loop yet. - pendingUpdate |= RepaintRequest; - break; - default: break; } @@ -855,7 +844,8 @@ void QSGSoftwareThreadedRenderLoop::handleExposure(QQuickWindow *window) if (!w->thread->isRunning()) { qCDebug(QSG_RASTER_LOG_RENDERLOOP, "starting render thread"); // Push a few things to the render thread. - QQuickAnimatorController *controller = QQuickWindowPrivate::get(w->window)->animationController; + QQuickAnimatorController *controller + = QQuickWindowPrivate::get(w->window)->animationController.get(); if (controller->thread() != w->thread) controller->moveToThread(w->thread); if (w->thread->thread() == QThread::currentThread()) { |