diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2016-01-19 23:00:00 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2016-01-26 09:43:55 +0000 |
commit | 9d584120493a1ec23a1ebeb6a134c00a96829545 (patch) | |
tree | a7fddd98128d45d68191ccec3e38dcadf5e5e1d4 | |
parent | b83b358634f7b5d5a80f29216233f3b462948922 (diff) | |
download | qtdeclarative-9d584120493a1ec23a1ebeb6a134c00a96829545.tar.gz |
QQuickTextNode: Nuke some dead code.
This has been commented out since the initial introduction in 2011. I doubt it's
actually useful anymore, and if it is, it's in git history regardless.
Change-Id: Ife36f423a21d4b12ebca154b4ad14848844e4eef
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
-rw-r--r-- | src/quick/items/qquicktextnode.cpp | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp index d40dedd798..2c7ab254f8 100644 --- a/src/quick/items/qquicktextnode.cpp +++ b/src/quick/items/qquicktextnode.cpp @@ -84,50 +84,6 @@ QQuickTextNode::~QQuickTextNode() qDeleteAll(m_textures); } -#if 0 -void QQuickTextNode::setColor(const QColor &color) -{ - if (m_usePixmapCache) { - setUpdateFlag(UpdateNodes); - } else { - for (QSGNode *childNode = firstChild(); childNode; childNode = childNode->nextSibling()) { - if (childNode->subType() == GlyphNodeSubType) { - QSGGlyphNode *glyphNode = static_cast<QSGGlyphNode *>(childNode); - if (glyphNode->color() == m_color) - glyphNode->setColor(color); - } else if (childNode->subType() == SolidRectNodeSubType) { - QSGSimpleRectNode *solidRectNode = static_cast<QSGSimpleRectNode *>(childNode); - if (solidRectNode->color() == m_color) - solidRectNode->setColor(color); - } - } - } - m_color = color; -} - -void QQuickTextNode::setStyleColor(const QColor &styleColor) -{ - if (m_textStyle != QQuickTextNode::NormalTextStyle) { - if (m_usePixmapCache) { - setUpdateFlag(UpdateNodes); - } else { - for (QSGNode *childNode = firstChild(); childNode; childNode = childNode->nextSibling()) { - if (childNode->subType() == GlyphNodeSubType) { - QSGGlyphNode *glyphNode = static_cast<QSGGlyphNode *>(childNode); - if (glyphNode->color() == m_styleColor) - glyphNode->setColor(styleColor); - } else if (childNode->subType() == SolidRectNodeSubType) { - QSGSimpleRectNode *solidRectNode = static_cast<QSGSimpleRectNode *>(childNode); - if (solidRectNode->color() == m_styleColor) - solidRectNode->setColor(styleColor); - } - } - } - } - m_styleColor = styleColor; -} -#endif - QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color, QQuickText::TextStyle style, const QColor &styleColor, QSGNode *parentNode) @@ -312,78 +268,4 @@ void QQuickTextNode::deleteContent() m_textures.clear(); } -#if 0 -void QQuickTextNode::updateNodes() -{ - return; - deleteContent(); - if (m_text.isEmpty()) - return; - - if (m_usePixmapCache) { - // ### gunnar: port properly -// QPixmap pixmap = generatedPixmap(); -// if (pixmap.isNull()) -// return; - -// QSGImageNode *pixmapNode = m_context->createImageNode(); -// pixmapNode->setRect(pixmap.rect()); -// pixmapNode->setSourceRect(pixmap.rect()); -// pixmapNode->setOpacity(m_opacity); -// pixmapNode->setClampToEdge(true); -// pixmapNode->setLinearFiltering(m_linearFiltering); - -// appendChildNode(pixmapNode); - } else { - if (m_text.isEmpty()) - return; - - // Implement styling by drawing text several times at slight shifts. shiftForStyle - // contains the sequence of shifted positions at which to draw the text. All except - // the last will be drawn with styleColor. - QList<QPointF> shiftForStyle; - switch (m_textStyle) { - case OutlineTextStyle: - // ### Should be made faster by implementing outline material - shiftForStyle << QPointF(-1, 0); - shiftForStyle << QPointF(0, -1); - shiftForStyle << QPointF(1, 0); - shiftForStyle << QPointF(0, 1); - break; - case SunkenTextStyle: - shiftForStyle << QPointF(0, -1); - break; - case RaisedTextStyle: - shiftForStyle << QPointF(0, 1); - break; - default: - break; - } - - shiftForStyle << QPointF(0, 0); // Regular position - while (!shiftForStyle.isEmpty()) { - QPointF shift = shiftForStyle.takeFirst(); - - // Use styleColor for all but last shift - if (m_richText) { - QColor overrideColor = shiftForStyle.isEmpty() ? QColor() : m_styleColor; - - QTextFrame *textFrame = m_textDocument->rootFrame(); - QPointF p = m_textDocument->documentLayout()->frameBoundingRect(textFrame).topLeft(); - - QTextFrame::iterator it = textFrame->begin(); - while (!it.atEnd()) { - addTextBlock(shift + p, it.currentBlock(), overrideColor); - ++it; - } - } else { - addTextLayout(shift, m_textLayout, shiftForStyle.isEmpty() - ? m_color - : m_styleColor); - } - } - } -} -#endif - QT_END_NAMESPACE |