diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-12-04 16:23:07 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-17 16:43:51 +0200 |
commit | f311ab75f8a37d22ad208fb12ef451066a57c95e (patch) | |
tree | b14144894b9549a7f66c37556ba1509be1e2fe7d /src | |
parent | 1dae7aa22fcd16ff7d3d47c173c8590e4841f141 (diff) |
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 <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp b/src/plugins/scenegraph/softwarecontext/renderingvisitor.cpp index bcec035..4574fcb 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<PixmapTexture *>(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<QSGPlainTexture *>(texture)) { const QImage &im = pt->image(); painter->drawImage(tn->rect(), im, QRectF(0, 0, im.width(), im.height())); |