From b2c709eb2dddfa9cb84cf36722a23663c3e3dd22 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 3 Feb 2012 11:48:24 +1000 Subject: [PATCH] Cleanup: remove some debugging and use QQuickTextNode::addImage Change-Id: I20f38f590b158d5d615923c30e85e2a7cfd99763 Reviewed-by: Martin Jones --- src/quick/items/qquicktext.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index e767347..00a40ab 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -63,8 +63,6 @@ #include #include -DEFINE_BOOL_CONFIG_OPTION(qmlTextDebug, QML_TEXT_DEBUG) - QT_BEGIN_NAMESPACE extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled; @@ -2055,22 +2053,9 @@ QSGNode *QQuickText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data } foreach (QDeclarativeStyledTextImgTag *img, d->visibleImgTags) { - if (qmlTextDebug()) { - QSGRectangleNode *rectangle = d->sceneGraphContext()->createRectangleNode(); - rectangle->setRect(QRectF(img->pos.x(), img->pos.y() + bounds.y(),img->size.width(), img->size.height())); - rectangle->setColor(QColor("red")); - rectangle->update(); - node->appendChildNode(rectangle); - } QDeclarativePixmap *pix = img->pix; - if (pix && pix->isReady()) { - QSGTexture *texture = d->sceneGraphContext()->textureForFactory(pix->textureFactory()); - QSGImageNode *imgnode = d->sceneGraphContext()->createImageNode(); - imgnode->setTexture(texture); - imgnode->setTargetRect(QRectF(img->pos.x(), img->pos.y() + bounds.y(), pix->width(), pix->height())); - node->appendChildNode(imgnode); - imgnode->update(); - } + if (pix && pix->isReady()) + node->addImage(QRectF(img->pos.x(), img->pos.y() + bounds.y(), pix->width(), pix->height()), pix->image()); } return node; } -- 2.7.4