? QSize(qCeil(qAbs(sourceRect.width())), qCeil(qAbs(sourceRect.height())))
: m_textureSize;
Q_ASSERT(!textureSize.isEmpty());
+
+ // Crate large textures on high-dpi displays.
+ if (sourceItem() && sourceItem()->window())
+ textureSize *= sourceItem()->window()->devicePixelRatio();
+
QQuickItemPrivate *d = static_cast<QQuickItemPrivate *>(QObjectPrivate::get(this));
const QSize minTextureSize = d->sceneGraphContext()->minimumFBOSize();
// Keep power-of-two by doubling the size.
Q_Q(QQuickWindow);
emit q->beforeRendering();
int fboId = 0;
- renderer->setDeviceRect(QRect(QPoint(0, 0), size));
+ const qreal devicePixelRatio = q->devicePixelRatio();
+ renderer->setDeviceRect(QRect(QPoint(0, 0), size * devicePixelRatio));
if (renderTargetId) {
fboId = renderTargetId;
renderer->setViewportRect(QRect(QPoint(0, 0), renderTargetSize));
} else {
- renderer->setViewportRect(QRect(QPoint(0, 0), size));
+ renderer->setViewportRect(QRect(QPoint(0, 0), size * devicePixelRatio));
}
- renderer->setProjectionMatrixToDeviceRect();
+ renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), size));
context->renderNextFrame(renderer, fboId);
emit q->afterRendering();