aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/items/qquickwindow.cpp12
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp12
2 files changed, 11 insertions, 13 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 5d993e4698..c6c7b6171e 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -591,7 +591,15 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size, const QSize &surfa
renderer->setDevicePixelRatio(1);
}
} else {
- const QSize pixelSize = surfaceSize.isEmpty() ? size * devicePixelRatio : surfaceSize;
+ 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);
@@ -599,7 +607,7 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size, const QSize &surfa
QSGAbstractRenderer::MatrixTransformFlags matrixFlags;
if (flipY)
matrixFlags |= QSGAbstractRenderer::MatrixTransformFlipY;
- renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), size), matrixFlags);
+ renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), logicalSize), matrixFlags);
renderer->setDevicePixelRatio(devicePixelRatio);
}
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 457e362b80..da0e8bdc7c 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -368,7 +368,6 @@ public:
QQuickWindow *window; // Will be 0 when window is not exposed
QSize windowSize;
- QSize windowPixelSize;
float dpr = 1;
int rhiSampleCount = 1;
bool rhiDeviceLost = false;
@@ -407,8 +406,6 @@ bool QSGRenderThread::event(QEvent *e)
stopEventProcessing = true;
window = se->window;
windowSize = se->size;
- if (window)
- windowPixelSize = window->handle()->geometry().size();
dpr = se->dpr;
pendingUpdate |= SyncRequest;
@@ -836,14 +833,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage)
}
}
if (current) {
- const QSize surfaceSize = [this, cd]{
- if (rhi)
- return cd->swapchain->currentPixelSize();
- if (windowPixelSize.isValid())
- return windowPixelSize;
- return QSize();
- }();
- d->renderSceneGraph(windowSize, surfaceSize);
+ d->renderSceneGraph(windowSize, rhi ? cd->swapchain->currentPixelSize() : QSize());
if (profileFrames)
renderTime = threadTimer.nsecsElapsed();