From f311ab75f8a37d22ad208fb12ef451066a57c95e Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 4 Dec 2014 16:23:07 +0100 Subject: Use the new QSGSimpleTextureNode::sourceRect QtWebEngine always receives 256x256 large tiles, but is being told which part of the texture should be painted if the content is effectively smaller on a tile. Change-Id: Ie979562fb948c853e22155e3f7f3807ae10558ef Reviewed-by: Simon Hausmann --- src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp') diff --git a/src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp b/src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp index bcec035939..4574fcbd71 100644 --- a/src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp +++ b/src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp @@ -72,7 +72,11 @@ bool RenderingVisitor::visit(QSGGeometryNode *node) QSGTexture *texture = tn->texture(); if (PixmapTexture *pt = dynamic_cast(texture)) { const QPixmap &pm = pt->pixmap(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) + painter->drawPixmap(tn->rect(), pm, tn->sourceRect()); +#else painter->drawPixmap(tn->rect(), pm, QRectF(0, 0, pm.width(), pm.height())); +#endif } else if (QSGPlainTexture *pt = dynamic_cast(texture)) { const QImage &im = pt->image(); painter->drawImage(tn->rect(), im, QRectF(0, 0, im.width(), im.height())); -- cgit v1.2.3