diff options
author | Andy Nichols <andy.nichols@theqtcompany.com> | 2015-08-18 14:38:12 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@theqtcompany.com> | 2015-08-18 13:57:36 +0000 |
commit | 7b2315c6fd149b49be9553bafa7a3ff6d3b3ac3f (patch) | |
tree | 2bb68675525caf6fc9861c9577fa3a53c943ab23 | |
parent | e8df467c8d15a203bffaee858dbb93507700eb61 (diff) |
Scene3DItem: Account for device pixel ratio
Change-Id: Icc1c078c228313dcc487fdc449c9399009bb8716
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/quick3d/imports/scene3d/scene3ditem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp index f3b0b67e5..79aa2b4e5 100644 --- a/src/quick3d/imports/scene3d/scene3ditem.cpp +++ b/src/quick3d/imports/scene3d/scene3ditem.cpp @@ -609,13 +609,13 @@ void Scene3DRenderer::render() ContextSaver saver; - const QSize currentSize = m_item->boundingRect().size().toSize(); + const QSize currentSize = m_item->boundingRect().size().toSize() * window->effectiveDevicePixelRatio(); const bool forceRecreate = currentSize != m_lastSize || m_multisample != m_lastMultisample; // Rebuild FBO and textures if never created or a resize has occurred if ((m_multisampledFBO.isNull() || forceRecreate) && m_multisample) { qCDebug(Scene3D) << Q_FUNC_INFO << "Creating multisample framebuffer"; - m_multisampledFBO.reset(createMultisampledFramebufferObject(m_item->boundingRect().size().toSize())); + m_multisampledFBO.reset(createMultisampledFramebufferObject(currentSize)); if (m_multisampledFBO->format().samples() == 0 || !QOpenGLFramebufferObject::hasOpenGLFramebufferBlit()) { qCDebug(Scene3D) << Q_FUNC_INFO << "Failed to create multisample framebuffer"; m_multisample = false; @@ -624,7 +624,7 @@ void Scene3DRenderer::render() } if (m_finalFBO.isNull() || forceRecreate) { - m_finalFBO.reset(createFramebufferObject(m_item->boundingRect().size().toSize())); + m_finalFBO.reset(createFramebufferObject(currentSize)); m_texture.reset(window->createTextureFromId(m_finalFBO->texture(), m_finalFBO->size(), QQuickWindow::TextureHasAlphaChannel)); m_node->setTexture(m_texture.data()); } |