aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@theqtcompany.com>2015-09-09 15:51:37 +0200
committerAndy Nichols <andy.nichols@theqtcompany.com>2015-09-09 16:56:50 +0300
commitccc5a0357c9b046ea89b63b221d96f85bd0bcd00 (patch)
tree9d0853b3541f55326b9464a05bab974a1efd32ab /src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
parentfa8b3f078318c5a2aa0dd48348f518083f08d2f7 (diff)
Fix rendering regressions with texture mirroring.
Change-Id: I8d48b9332712aa30857402a93a35c77f22fae221 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'src/plugins/scenegraph/softwarecontext/softwarelayer.cpp')
-rw-r--r--src/plugins/scenegraph/softwarecontext/softwarelayer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp b/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
index 13531c5549..8fcf3abc8f 100644
--- a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
+++ b/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp
@@ -216,12 +216,11 @@ void SoftwareLayer::grab()
m_renderer->setDeviceRect(m_size);
m_renderer->setViewportRect(m_size);
- m_renderer->m_mirrorHorizontal = m_mirrorHorizontal;
- m_renderer->m_mirrorVertical = m_mirrorVertical;
- m_renderer->m_projectionRect = QRect(m_rect.x() * m_device_pixel_ratio,
- m_rect.y() * m_device_pixel_ratio,
- m_rect.width() * m_device_pixel_ratio,
- m_rect.height() * m_device_pixel_ratio);
+ QRect mirrored(m_mirrorHorizontal ? m_rect.right() * m_device_pixel_ratio : m_rect.left() * m_device_pixel_ratio,
+ m_mirrorVertical ? m_rect.top() * m_device_pixel_ratio : m_rect.bottom() * m_device_pixel_ratio,
+ m_mirrorHorizontal ? -m_rect.width() * m_device_pixel_ratio : m_rect.width() * m_device_pixel_ratio,
+ m_mirrorVertical ? m_rect.height() * m_device_pixel_ratio : -m_rect.height() * m_device_pixel_ratio);
+ m_renderer->m_projectionRect = mirrored;
m_renderer->setClearColor(Qt::transparent);
m_renderer->renderScene();