From 7572d2881ecf28f282fdd3129973f94ea319ed1a Mon Sep 17 00:00:00 2001 From: Nils Jeisecke Date: Mon, 2 Jul 2012 15:38:24 +0200 Subject: [PATCH] Fix high CPU load for Qml TextEdit on Mac This removes a Mac workaround which causes an endless calling loop (updatePaintNode will call markContentsDirty will call updatePaintNode) for every TextEdit element. The only reason that this doesn't block the application is that the signal goes through the GUI thread's event loop. Task-number: QTBUG-26361 Change-Id: Ia89cc123959bbfdcbfc5b0707901ac91dec47c40 Reviewed-by: Jiang Jiang --- src/quick/items/qquicktextedit.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index 7222c17..7f31eb4 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -1605,13 +1605,6 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData * if (oldNode == 0 || d->documentDirty) { d->documentDirty = false; -#if defined(Q_OS_MAC) - // Make sure document is relayouted in the paint node on Mac - // to avoid crashes due to the font engines created in the - // shaping process - d->document->markContentsDirty(0, d->document->characterCount()); -#endif - QQuickTextNode *node = 0; if (oldNode == 0) { node = new QQuickTextNode(QQuickItemPrivate::get(this)->sceneGraphContext(), this); @@ -1629,13 +1622,6 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData * QColor(), d->selectionColor, d->selectedTextColor, selectionStart(), selectionEnd() - 1); // selectionEnd() returns first char after // selection - -#if defined(Q_OS_MAC) - // We also need to make sure the document layout is redone when - // control is returned to the main thread, as all the font engines - // are now owned by the rendering thread - d->document->markContentsDirty(0, d->document->characterCount()); -#endif } if (d->cursorComponent == 0 && !isReadOnly()) { -- 2.7.4