From 3f1245aabc125c416f26028a12923f9055765e4f Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 20 Nov 2013 12:05:49 +0100 Subject: Enforce window rendering in sequence on llvmpipe. When rendering multiple windows in parallel on llvmpipe we end up with crashes deep inside llvmpipe as multiple threads seem to access unprotected resources. Work around this bug by enforcing that scene graph rendering happens on one window at a time. Task-number: QTCREATORBUG-10666 Change-Id: I2f734e8f653b2a9b4108eb189280ab922581e2c0 Reviewed-by: Kai Koehne --- src/quick/scenegraph/qsgcontext.cpp | 12 ++++++++++++ src/quick/scenegraph/qsgcontext_p.h | 1 + 2 files changed, 13 insertions(+) (limited to 'src/quick') diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index fa095b8165..afde7939f2 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -340,6 +340,7 @@ QSGRenderContext::QSGRenderContext(QSGContext *context) , m_depthStencilManager(0) , m_distanceFieldCacheManager(0) , m_brokenIBOs(false) + , m_serializedRender(false) { } @@ -348,8 +349,13 @@ QSGRenderContext::~QSGRenderContext() invalidate(); } +static QBasicMutex qsg_framerender_mutex; + void QSGRenderContext::renderNextFrame(QSGRenderer *renderer, GLuint fboId) { + if (m_serializedRender) + qsg_framerender_mutex.lock(); + if (fboId) { QSGBindableFboId bindable(fboId); renderer->renderScene(bindable); @@ -357,6 +363,9 @@ void QSGRenderContext::renderNextFrame(QSGRenderer *renderer, GLuint fboId) renderer->renderScene(); } + if (m_serializedRender) + qsg_framerender_mutex.unlock(); + } /*! @@ -442,6 +451,9 @@ void QSGRenderContext::initialize(QOpenGLContext *context) const char *vendor = (const char *) glGetString(GL_VENDOR); if (strstr(vendor, "nouveau")) m_brokenIBOs = true; + const char *renderer = (const char *) glGetString(GL_RENDERER); + if (strstr(renderer, "llvmpipe")) + m_serializedRender = true; #endif emit initialized(); diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index 270f108373..c562a909c5 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -132,6 +132,7 @@ protected: QSet m_fontEnginesToClean; bool m_brokenIBOs; + bool m_serializedRender; }; -- cgit v1.2.3 From 802921d40b8b48239958c6035c74d986fe606860 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 21 Nov 2013 11:06:24 +0100 Subject: TextInput: add editingFinished signal Autotest is included. Task-number: QTBUG-34780 [ChangeLog][QtDeclarative][TextInput] add editingFinished signal Change-Id: Ib633daee67cd4e5f15739a6004adbe882ab3d3fc Reviewed-by: Lars Knoll Reviewed-by: J-P Nurmi Reviewed-by: Thomas Hartmann Reviewed-by: Jens Bache-Wiig Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> --- src/quick/items/qquickitemsmodule.cpp | 1 + src/quick/items/qquicktextinput.cpp | 15 +++++++++++++++ src/quick/items/qquicktextinput_p.h | 1 + 3 files changed, 17 insertions(+) (limited to 'src/quick') diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index ebc32c89eb..a5b78b28e1 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -188,6 +188,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType(uri,major,minor,"TextEdit"); qmlRegisterType(uri,2,1,"TextEdit"); qmlRegisterType(uri,major,minor,"TextInput"); + qmlRegisterType(uri,2,2,"TextInput"); qmlRegisterType(uri,major,minor,"ViewSection"); qmlRegisterType(); diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 93ea677d2c..b46387ba47 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -1212,6 +1212,17 @@ bool QQuickTextInput::hasAcceptableInput() const state. */ +/*! + \qmlsignal QtQuick::TextInput::onEditingFinished() + \since 5.2 + + This handler is called when the Return or Enter key is pressed or + the text input loses focus. Note that if there is a validator or + inputMask set on the text input and enter/return is pressed, this + handler will only be called if the input follows + the inputMask and the validator returns an acceptable state. +*/ + #ifndef QT_NO_IM Qt::InputMethodHints QQuickTextInputPrivate::effectiveInputMethodHints() const { @@ -2522,6 +2533,9 @@ void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event) && !persistentSelection) deselect(); + if (hasAcceptableInput(m_text) || fixup()) + emit q->editingFinished(); + #ifndef QT_NO_IM q->disconnect(qApp->inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)), q, SLOT(q_updateAlignment())); @@ -4105,6 +4119,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event) if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { if (hasAcceptableInput(m_text) || fixup()) { emit q->accepted(); + emit q->editingFinished(); } event->ignore(); return; diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index 2b72afb9dc..5f0250aaf1 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -284,6 +284,7 @@ Q_SIGNALS: void selectedTextChanged(); void accepted(); void acceptableInputChanged(); + Q_REVISION(2) void editingFinished(); void colorChanged(); void selectionColorChanged(); void selectedTextColorChanged(); -- cgit v1.2.3 From 8eca830fab1f8a27d62602f2725afc7cdc3561aa Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 20 Nov 2013 13:27:02 +0100 Subject: Safeguard the threaded renderloop against incorrectly exposed windows. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Mac we had a situation where we got expose events for windows which were either 0x24 in size or completely off the screen. These would result in makeCurrent failing and lead to crashes later on in the scene graph. Safeguard against invalid dimensions during initialization and abort after a call to makeCurrent if any of them fail. Task-number: QTCREATORBUG-10814 Change-Id: I9063ea4d078eea3914666e4c155d141a1502e2ff Reviewed-by: Tor Arne Vestbø --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/quick') diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 0c46747e53..2de9827ab1 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -506,7 +506,10 @@ void QSGRenderThread::sync() Q_ASSERT_X(wm->m_locked, "QSGRenderThread::sync()", "sync triggered on bad terms as gui is not already locked..."); - if (windowSize.width() > 0 && windowSize.height() > 0) { + bool current = false; + if (windowSize.width() > 0 && windowSize.height() > 0) + current = gl->makeCurrent(window); + if (current) { gl->makeCurrent(window); QQuickWindowPrivate *d = QQuickWindowPrivate::get(window); bool hadRenderer = d->renderer != 0; @@ -578,8 +581,10 @@ void QSGRenderThread::syncAndRender() d->animationController->unlock(); } - if (d->renderer && windowSize.width() > 0 && windowSize.height() > 0) { - gl->makeCurrent(window); + bool current = false; + if (d->renderer && windowSize.width() > 0 && windowSize.height() > 0) + current = gl->makeCurrent(window); + if (current) { d->renderSceneGraph(windowSize); #ifndef QSG_NO_RENDER_TIMING if (profileFrames) @@ -654,10 +659,8 @@ void QSGRenderThread::run() while (active) { if (window) { - if (!sgrc->openglContext()) { - gl->makeCurrent(window); + if (!sgrc->openglContext() && windowSize.width() > 0 && windowSize.height() > 0 && gl->makeCurrent(window)) sgrc->initialize(gl); - } syncAndRender(); } -- cgit v1.2.3 From 99480d5420c0beea6771be582c039b550a4461f5 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 21 Nov 2013 14:13:07 +0100 Subject: Be even more tolerant towards broken platform behavior. When the platform (Mac in particular) sends us exposes for windows which are not renderable, we store it for later and fake expose events when we get resized. Task-number: QTCREATORBUG-10814 Change-Id: I909bb5a920550589322afd97ae1834884754cf81 Reviewed-by: Lars Knoll --- src/quick/designer/designerwindowmanager.cpp | 4 ---- src/quick/designer/designerwindowmanager_p.h | 1 - src/quick/items/qquickwindow.cpp | 1 + src/quick/scenegraph/qsgrenderloop_p.h | 1 + src/quick/scenegraph/qsgthreadedrenderloop.cpp | 21 +++++++++++++++++++++ src/quick/scenegraph/qsgthreadedrenderloop_p.h | 2 ++ src/quick/scenegraph/qsgwindowsrenderloop_p.h | 2 -- 7 files changed, 25 insertions(+), 7 deletions(-) (limited to 'src/quick') diff --git a/src/quick/designer/designerwindowmanager.cpp b/src/quick/designer/designerwindowmanager.cpp index c4a95d254b..25ea5e7f93 100644 --- a/src/quick/designer/designerwindowmanager.cpp +++ b/src/quick/designer/designerwindowmanager.cpp @@ -90,10 +90,6 @@ QImage DesignerWindowManager::grab(QQuickWindow *) return QImage(); } -void DesignerWindowManager::resize(QQuickWindow *, const QSize &) -{ -} - void DesignerWindowManager::maybeUpdate(QQuickWindow *) { } diff --git a/src/quick/designer/designerwindowmanager_p.h b/src/quick/designer/designerwindowmanager_p.h index 1bab8c8508..7414f4e3ba 100644 --- a/src/quick/designer/designerwindowmanager_p.h +++ b/src/quick/designer/designerwindowmanager_p.h @@ -82,7 +82,6 @@ public: void makeOpenGLContext(QQuickWindow *window); void exposureChanged(QQuickWindow *window); QImage grab(QQuickWindow *window); - void resize(QQuickWindow *window, const QSize &size); void maybeUpdate(QQuickWindow *window); void update(QQuickWindow *window); // identical for this implementation. diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 41a1781394..796ddcfbe4 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -216,6 +216,7 @@ void QQuickWindow::exposeEvent(QExposeEvent *) /*! \reimp */ void QQuickWindow::resizeEvent(QResizeEvent *) { + d_func()->windowManager->resize(this); } /*! \reimp */ diff --git a/src/quick/scenegraph/qsgrenderloop_p.h b/src/quick/scenegraph/qsgrenderloop_p.h index 7b06399f08..72bad16c63 100644 --- a/src/quick/scenegraph/qsgrenderloop_p.h +++ b/src/quick/scenegraph/qsgrenderloop_p.h @@ -61,6 +61,7 @@ public: virtual void show(QQuickWindow *window) = 0; virtual void hide(QQuickWindow *window) = 0; + virtual void resize(QQuickWindow *) {}; virtual void windowDestroyed(QQuickWindow *window) = 0; diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 2de9827ab1..e50d034529 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -817,6 +817,7 @@ void QSGThreadedRenderLoop::show(QQuickWindow *window) win.thread = new QSGRenderThread(this, QQuickWindowPrivate::get(window)->context); win.timerId = 0; win.updateDuringSync = false; + win.gotBrokenExposeFromPlatformPlugin = false; m_windows << win; } @@ -882,6 +883,17 @@ void QSGThreadedRenderLoop::exposureChanged(QQuickWindow *window) } } +void QSGThreadedRenderLoop::resize(QQuickWindow *window) +{ + Window *w = windowFor(m_windows, window); + if (w->gotBrokenExposeFromPlatformPlugin + && window->width() > 0 && window->height() > 0 + && w->window->geometry().intersects(w->window->screen()->availableGeometry())) { + w->gotBrokenExposeFromPlatformPlugin = false; + handleExposure(w); + } +} + /*! Will post an event to the render thread that this window should @@ -891,6 +903,15 @@ void QSGThreadedRenderLoop::handleExposure(Window *w) { QSG_GUI_DEBUG(w->window, "handleExposure"); + if (w->window->width() <= 0 || w->window->height() <= 0 + || !w->window->geometry().intersects(w->window->screen()->availableGeometry())) { +#ifndef QT_NO_DEBUG + qWarning("QSGThreadedRenderLoop: expose event received for window with invalid geometry."); +#endif + w->gotBrokenExposeFromPlatformPlugin = true; + return; + } + // Because we are going to bind a GL context to it, make sure it // is created. if (!w->window->handle()) diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h index 5943d0bd08..844d180788 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h +++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h @@ -60,6 +60,7 @@ public: void show(QQuickWindow *window); void hide(QQuickWindow *window); + void resize(QQuickWindow *window); void windowDestroyed(QQuickWindow *window); void exposureChanged(QQuickWindow *window); @@ -89,6 +90,7 @@ private: QSGRenderThread *thread; int timerId; uint updateDuringSync : 1; + uint gotBrokenExposeFromPlatformPlugin : 1; }; friend class QSGRenderThread; diff --git a/src/quick/scenegraph/qsgwindowsrenderloop_p.h b/src/quick/scenegraph/qsgwindowsrenderloop_p.h index ff5529646b..e4ee688c9f 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop_p.h +++ b/src/quick/scenegraph/qsgwindowsrenderloop_p.h @@ -81,8 +81,6 @@ public: void render(); void renderWindow(QQuickWindow *window); - void resize(QQuickWindow *, const QSize &) { } - bool event(QEvent *event); bool anyoneShowing() const; -- cgit v1.2.3 From c962cc45711e09dddc5690d581bee29bf52f8cf9 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 25 Nov 2013 08:25:21 +0100 Subject: Do not crash when resizing invisible (non-tracked) windows. Change-Id: I776c21a0f675d2dbe831325cef2c1c2a103e03e5 Reviewed-by: Simon Hausmann --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/quick') diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index e50d034529..bca7736e79 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -886,9 +886,10 @@ void QSGThreadedRenderLoop::exposureChanged(QQuickWindow *window) void QSGThreadedRenderLoop::resize(QQuickWindow *window) { Window *w = windowFor(m_windows, window); - if (w->gotBrokenExposeFromPlatformPlugin - && window->width() > 0 && window->height() > 0 - && w->window->geometry().intersects(w->window->screen()->availableGeometry())) { + if (w + && w->gotBrokenExposeFromPlatformPlugin + && window->width() > 0 && window->height() > 0 + && w->window->geometry().intersects(w->window->screen()->availableGeometry())) { w->gotBrokenExposeFromPlatformPlugin = false; handleExposure(w); } -- cgit v1.2.3 From 0d1e1ddbf5732f1755d31020f82c540f2a69f756 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 22 Nov 2013 19:13:20 +0100 Subject: No assert when the focus changes and a window has no active focus item. [ChangeLog][QtQuick] Fix crash when showing and hiding a window that has no active focus item. QtQuickControls hit the situation where a popup window was shown without ever having an active focus item. When then closing the popup, clearFocusInScope would assume it had to always modify the old focus, but in this case the focus would be on the window itself, so there is nothing to update. Task-number: QTBUG-35057 Change-Id: Ifbde4689d39f98b13e6f90573cb22e28bb86f2c4 Reviewed-by: J-P Nurmi Reviewed-by: Liang Qi --- src/quick/items/qquickwindow.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 796ddcfbe4..848eeca2a6 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -771,23 +771,24 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, oldActiveFocusItem = activeFocusItem; newActiveFocusItem = scope; - Q_ASSERT(oldActiveFocusItem); - #ifndef QT_NO_IM qApp->inputMethod()->commit(); #endif activeFocusItem = 0; - QFocusEvent event(QEvent::FocusOut, reason); - q->sendEvent(oldActiveFocusItem, &event); - QQuickItem *afi = oldActiveFocusItem; - while (afi && afi != scope) { - if (QQuickItemPrivate::get(afi)->activeFocus) { - QQuickItemPrivate::get(afi)->activeFocus = false; - changed << afi; + if (oldActiveFocusItem) { + QFocusEvent event(QEvent::FocusOut, reason); + q->sendEvent(oldActiveFocusItem, &event); + + QQuickItem *afi = oldActiveFocusItem; + while (afi && afi != scope) { + if (QQuickItemPrivate::get(afi)->activeFocus) { + QQuickItemPrivate::get(afi)->activeFocus = false; + changed << afi; + } + afi = afi->parentItem(); } - afi = afi->parentItem(); } } -- cgit v1.2.3 From c81632df3e9d52011487cfe0bd2e40ba5c5f2d54 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 25 Nov 2013 10:06:36 +0100 Subject: Fix rendering of Flipable content. When a batch is merged in the renderer, we use the z component to stack the item front to back. This works because each item is guaranteed to have a z-range of 0->1. However, when a projective matrix is used, we need to compensate for the implicit [x,y,z]/w, which GL applies to gl_Position after the vertex stage completes, so that this guarantee still holds. Task-number: QTBUG-35020 Change-Id: I254a3d4dc9ad22f53717160ec6ad8f3a27b43d1c Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp index 909def2c19..2849eff304 100644 --- a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp +++ b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp @@ -222,7 +222,7 @@ QByteArray qsgShaderRewriter_insertZAttributes(const char *input, QSurfaceFormat braceDepth--; if (braceDepth == 0) { result += QByteArray::fromRawData(voidPos, tok.pos - 1 - voidPos); - result += QByteArrayLiteral(" gl_Position.z = gl_Position.z * _qt_zRange + _qt_order;\n"); + result += QByteArrayLiteral(" gl_Position.z = (gl_Position.z * _qt_zRange + _qt_order) * gl_Position.w;\n"); result += QByteArray(tok.pos - 1); return result; } -- cgit v1.2.3 From 2331a5ef5765d1b99472cd05e1af4b84d59c0177 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 25 Nov 2013 11:40:12 +0100 Subject: Stop render thread regardless when the window is being destroyed When a window is shown and quickly hidden again we can get to a state, on a asynchronous windowing system API, where the isExposed=true event has been pushed to the event queue but not yet processed at the time the user calls hide(). As hide() immediately sets isVisible() to false, we end up with isExposed=true and isVisible=false which prevent the WM_Obscure event to be sent to render loop which means the render thread thought the window was still on screen when we reched the shutdown in WM_TryRelease. Changed WM_TryRelease handling to disregard window state when the window is being deleted. This forces SG and GL cleanup and stops the thread. Task-number: QTBUG-35055 Change-Id: Ibac5aa27354d6450f30a61450214cb785ab855bf Reviewed-by: J-P Nurmi Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index bca7736e79..850a463c3e 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -402,8 +402,8 @@ bool QSGRenderThread::event(QEvent *e) case WM_TryRelease: { QSG_RT_DEBUG("WM_TryRelease"); mutex.lock(); - if (!window) { - WMTryReleaseEvent *wme = static_cast(e); + WMTryReleaseEvent *wme = static_cast(e); + if (!window || wme->inDestructor) { QSG_RT_DEBUG(" - setting exit flag and invalidating GL"); invalidateOpenGL(wme->window, wme->inDestructor); active = gl; -- cgit v1.2.3 From 87da2a2526aa03dd43254730a6e675e83c7c1342 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 22 Nov 2013 18:52:22 +0100 Subject: Use QFontDatabase to check if a font is scalable. The flag set in QFontEngine was not always correctly set, use QFontDatabase instead which is slower but should always be correct. We fallback to native font rendering when the font is not scalable. Change-Id: Ie9a2397abd42890d0fb05bc2f9c46a60040296f2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/items/qquicktextnode.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp index dd314c892d..18ee1a479d 100644 --- a/src/quick/items/qquicktextnode.cpp +++ b/src/quick/items/qquicktextnode.cpp @@ -143,10 +143,13 @@ QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun QSGNode *parentNode) { QSGRenderContext *sg = QQuickItemPrivate::get(m_ownerElement)->sceneGraphRenderContext(); - QRawFontPrivate *fontP = QRawFontPrivate::get(glyphs.rawFont()); - QSGGlyphNode *node = m_useNativeRenderer || !fontP->fontEngine->smoothScalable + QRawFont font = glyphs.rawFont(); + bool smoothScalable = QFontDatabase().isSmoothlyScalable(font.familyName(), + font.styleName()); + QSGGlyphNode *node = m_useNativeRenderer || !smoothScalable ? sg->sceneGraphContext()->createNativeGlyphNode(sg) : sg->sceneGraphContext()->createGlyphNode(sg); + node->setOwnerElement(m_ownerElement); node->setGlyphs(position + QPointF(0, glyphs.rawFont().ascent()), glyphs); node->setStyle(style); -- cgit v1.2.3