diff options
author | Andy Nichols <andy.nichols@theqtcompany.com> | 2015-09-09 15:51:37 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@theqtcompany.com> | 2015-09-09 16:56:50 +0300 |
commit | ccc5a0357c9b046ea89b63b221d96f85bd0bcd00 (patch) | |
tree | 9d0853b3541f55326b9464a05bab974a1efd32ab /src | |
parent | fa8b3f078318c5a2aa0dd48348f518083f08d2f7 (diff) |
Fix rendering regressions with texture mirroring.
Change-Id: I8d48b9332712aa30857402a93a35c77f22fae221
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/context.cpp | 8 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/context.h | 2 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/softwarelayer.cpp | 11 |
3 files changed, 5 insertions, 16 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/context.cpp b/src/plugins/scenegraph/softwarecontext/context.cpp index 6f5c997..b3b97a7 100644 --- a/src/plugins/scenegraph/softwarecontext/context.cpp +++ b/src/plugins/scenegraph/softwarecontext/context.cpp @@ -121,8 +121,6 @@ void Renderer::nodeChanged(QSGNode *node, QSGNode::DirtyState state) PixmapRenderer::PixmapRenderer(QSGRenderContext *context) : QSGRenderer(context) - , m_mirrorHorizontal(false) - , m_mirrorVertical(false) { } @@ -149,12 +147,6 @@ void PixmapRenderer::render(QPixmap *target) painter.setRenderHint(QPainter::Antialiasing); painter.setWindow(m_projectionRect); - if (m_mirrorHorizontal || m_mirrorVertical) { - QMatrix mirroringMatrix; - mirroringMatrix.scale(m_mirrorHorizontal ? -1 : 1, m_mirrorVertical ? -1 : 1); - painter.setMatrix(mirroringMatrix); - } - RenderingVisitor(&painter).visitChildren(rootNode()); } diff --git a/src/plugins/scenegraph/softwarecontext/context.h b/src/plugins/scenegraph/softwarecontext/context.h index b8cd5bb..0d734df 100644 --- a/src/plugins/scenegraph/softwarecontext/context.h +++ b/src/plugins/scenegraph/softwarecontext/context.h @@ -68,8 +68,6 @@ public: void render(QPixmap *target); QRect m_projectionRect; - bool m_mirrorHorizontal; - bool m_mirrorVertical; }; class RenderContext : public QSGRenderContext diff --git a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp b/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp index 13531c5..8fcf3ab 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(); |