From cf9c2c3db39e4b4d2f0dd3daaa7d6050f19c6b62 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 11 Nov 2016 15:55:16 +0100 Subject: 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 --- src/quick/items/qquicktextnode.cpp | 8 ++------ 1 file 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(); } -- cgit v1.2.3