aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-05 12:20:12 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-08 14:10:50 +0200
commitb83cc28964cbcb3c67b536dadc475c08225e383f (patch)
tree0459a6225968fd5cc2a4f61fcb9a9f50bcce06b4
parent433dc99229c7c980f410b6692c1df17734c95385 (diff)
Remove customRenderStage from QQuickWindowPrivate
This is not maintained and probably not compatible with QRhi-based rendering anyways. Remove it for now. Task-number: QTBUG-84718 Task-number: QTBUG-84623 Change-Id: I423b45e247c751c94f1407cfb53f056d6ea7a10c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--src/quick/items/qquickwindow.cpp78
-rw-r--r--src/quick/items/qquickwindow_p.h9
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp4
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp2
4 files changed, 41 insertions, 52 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index aac5a0c527..7fe5325f5b 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -661,49 +661,49 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size, const QSize &surfa
animationController->advance();
emit q->beforeRendering();
runAndClearJobs(&beforeRenderingJobs);
- if (!customRenderStage || !customRenderStage->render()) {
- QSGAbstractRenderer::MatrixTransformFlags matrixFlags;
- const bool flipY = rhi ? !rhi->isYUpInNDC() : false;
- if (flipY)
- matrixFlags |= QSGAbstractRenderer::MatrixTransformFlipY;
- const qreal devicePixelRatio = q->effectiveDevicePixelRatio();
- if (redirect.rt.renderTarget) {
- QRect rect(QPoint(0, 0), redirect.rt.renderTarget->pixelSize());
- renderer->setDeviceRect(rect);
- renderer->setViewportRect(rect);
- if (QQuickRenderControl::renderWindowFor(q)) {
- renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), size), matrixFlags);
- renderer->setDevicePixelRatio(devicePixelRatio);
- } else {
- renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), rect.size()), matrixFlags);
- renderer->setDevicePixelRatio(1);
- }
- } else {
- QSize pixelSize;
- QSizeF logicalSize;
- if (surfaceSize.isEmpty()) {
- pixelSize = size * devicePixelRatio;
- logicalSize = size;
- } else {
- pixelSize = surfaceSize;
- logicalSize = QSizeF(surfaceSize) / devicePixelRatio;
- }
- QRect rect(QPoint(0, 0), pixelSize);
- renderer->setDeviceRect(rect);
- renderer->setViewportRect(rect);
- renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), logicalSize), matrixFlags);
+
+ QSGAbstractRenderer::MatrixTransformFlags matrixFlags;
+ const bool flipY = rhi ? !rhi->isYUpInNDC() : false;
+ if (flipY)
+ matrixFlags |= QSGAbstractRenderer::MatrixTransformFlipY;
+ const qreal devicePixelRatio = q->effectiveDevicePixelRatio();
+ if (redirect.rt.renderTarget) {
+ QRect rect(QPoint(0, 0), redirect.rt.renderTarget->pixelSize());
+ renderer->setDeviceRect(rect);
+ renderer->setViewportRect(rect);
+ if (QQuickRenderControl::renderWindowFor(q)) {
+ renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), size), matrixFlags);
renderer->setDevicePixelRatio(devicePixelRatio);
+ } else {
+ renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), rect.size()), matrixFlags);
+ renderer->setDevicePixelRatio(1);
}
-
- if (rhi) {
- context->renderNextRhiFrame(renderer);
+ } else {
+ QSize pixelSize;
+ QSizeF logicalSize;
+ if (surfaceSize.isEmpty()) {
+ pixelSize = size * devicePixelRatio;
+ logicalSize = size;
} else {
- // This is the software backend (or some custom scenegraph context
- // plugin) in practice, because the default implementation always
- // hits the QRhi-based path in Qt 6.
- context->renderNextFrame(renderer);
+ pixelSize = surfaceSize;
+ logicalSize = QSizeF(surfaceSize) / devicePixelRatio;
}
+ QRect rect(QPoint(0, 0), pixelSize);
+ renderer->setDeviceRect(rect);
+ renderer->setViewportRect(rect);
+ renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), logicalSize), matrixFlags);
+ renderer->setDevicePixelRatio(devicePixelRatio);
}
+
+ if (rhi) {
+ context->renderNextRhiFrame(renderer);
+ } else {
+ // This is the software backend (or some custom scenegraph context
+ // plugin) in practice, because the default implementation always
+ // hits the QRhi-based path in Qt 6.
+ context->renderNextFrame(renderer);
+ }
+
emit q->afterRendering();
runAndClearJobs(&afterRenderingJobs);
@@ -740,7 +740,6 @@ QQuickWindowPrivate::QQuickWindowPrivate()
, windowManager(nullptr)
, renderControl(nullptr)
, pointerEventRecursionGuard(0)
- , customRenderStage(nullptr)
, clearColor(Qt::white)
, clearBeforeRendering(true)
, persistentGLContext(true)
@@ -764,7 +763,6 @@ QQuickWindowPrivate::QQuickWindowPrivate()
QQuickWindowPrivate::~QQuickWindowPrivate()
{
redirect.rt.reset(rhi, renderer);
- delete customRenderStage;
if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>())
service->removeWindow(q_func());
}
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 67dc0e92d8..c1a49b69ff 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -99,14 +99,6 @@ public Q_SLOTS:
void setHeight(int h) {QQuickItem::setHeight(qreal(h));}
};
-class Q_QUICK_PRIVATE_EXPORT QQuickCustomRenderStage
-{
-public:
- virtual ~QQuickCustomRenderStage() {}
- virtual bool render() = 0;
- virtual bool swap() = 0;
-};
-
class QQuickWindowRenderTarget
{
public:
@@ -278,7 +270,6 @@ public:
QScopedPointer<QTouchEvent> delayedTouch;
int pointerEventRecursionGuard;
- QQuickCustomRenderStage *customRenderStage;
QColor clearColor;
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
index 7075d3e1cb..0ba6e1994a 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
@@ -472,7 +472,7 @@ void QSGSoftwareRenderThread::syncAndRender()
syncResultedInChanges = false;
QQuickWindowPrivate *wd = QQuickWindowPrivate::get(exposedWindow);
- const bool repaintRequested = (pendingUpdate & RepaintRequest) || wd->customRenderStage;
+ const bool repaintRequested = pendingUpdate & RepaintRequest;
const bool syncRequested = pendingUpdate & SyncRequest;
const bool exposeRequested = (pendingUpdate & ExposeRequest) == ExposeRequest;
pendingUpdate = 0;
@@ -514,7 +514,7 @@ void QSGSoftwareRenderThread::syncAndRender()
QQuickProfiler::SceneGraphRenderLoopRender);
Q_TRACE(QSG_swap_entry);
- if (softwareRenderer && (!wd->customRenderStage || !wd->customRenderStage->swap()))
+ if (softwareRenderer)
backingStore->flush(softwareRenderer->flushRegion());
// Since there is no V-Sync with QBackingStore, throttle rendering the refresh
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 736ab5cfb9..abcf3638ea 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -658,7 +658,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage)
syncResultedInChanges = false;
QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);
- const bool repaintRequested = (pendingUpdate & RepaintRequest) || d->customRenderStage || grabImage;
+ const bool repaintRequested = (pendingUpdate & RepaintRequest) || grabImage;
const bool syncRequested = (pendingUpdate & SyncRequest) || grabImage;
const bool exposeRequested = (pendingUpdate & ExposeRequest) == ExposeRequest;
const bool grabRequested = grabImage != nullptr;