diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-11-11 15:55:16 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-11-14 08:08:12 +0000 |
commit | cf9c2c3db39e4b4d2f0dd3daaa7d6050f19c6b62 (patch) | |
tree | 5e35b2105e01bd14c0f1fb2bc301db899b754398 /src/quick | |
parent | 769002ffe4a93995447a71393371579b1df41e12 (diff) |
Fix performance regression in rich text with images
In a3da23d5a92ab0f9b8280b9ed591986f8ac6a2d6 we added linear filtering
to the image node in rich text when smooth was set to true (which it
is by default). But we also enabled mipmapping, which caused a bad
performance regression when updating the text item.
If we want to support mipmapping, we would have to add a separate
property for this like in the image node, but since the original
bug report only called for supporting smooth scaling like in
Image, we can simply revert part of the change.
[ChangeLog][QtQuick][Text] Fixed a performance regression when
rendering a rich text item with scaled images.
Task-number: QTBUG-54723
Change-Id: Ib930112b76f0fe0b2e658f86520a9290354b8f6f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquicktextnode.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp index b0bb60f566..26a84ed42a 100644 --- a/src/quick/items/qquicktextnode.cpp +++ b/src/quick/items/qquicktextnode.cpp @@ -160,18 +160,14 @@ void QQuickTextNode::addImage(const QRectF &rect, const QImage &image) QSGRenderContext *sg = QQuickItemPrivate::get(m_ownerElement)->sceneGraphRenderContext(); QSGImageNode *node = sg->sceneGraphContext()->createImageNode(); QSGTexture *texture = sg->createTexture(image); - if (m_ownerElement->smooth()) { + if (m_ownerElement->smooth()) texture->setFiltering(QSGTexture::Linear); - texture->setMipmapFiltering(QSGTexture::Linear); - } m_textures.append(texture); node->setTargetRect(rect); node->setInnerTargetRect(rect); node->setTexture(texture); - if (m_ownerElement->smooth()) { + if (m_ownerElement->smooth()) node->setFiltering(QSGTexture::Linear); - node->setMipmapFiltering(QSGTexture::Linear); - } appendChildNode(node); node->update(); } |