diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-13 09:46:15 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-13 09:46:15 +0200 |
commit | 4b72f48637a87c95deedcc501cd9cc8f717117fa (patch) | |
tree | 80f00ade2cc3f3845e0f309f39a2649040d203e3 /src/quick/scenegraph | |
parent | 3d30c6d7b40ce86f49bc7bdc5c2c74ce180bb3dd (diff) | |
parent | f7e1f7b2f1f1577fd94dfffb93ef15ded5d09031 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/quick/util/qquickpixmapcache.cpp
tests/auto/quick/qquickwindow/BLACKLIST
Change-Id: Ie81612f2884f8ea508c48ba2735ec54ea1c2eca5
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 10 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgwindowsrenderloop.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders/smoothtexture.vert | 5 |
5 files changed, 17 insertions, 12 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index ec9106e86b..0c4b2f9af9 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -92,6 +92,7 @@ protected: int m_matrix_id; int m_color_id; int m_textureScale_id; + float m_devicePixelRatio; QFontEngine::GlyphFormat m_glyphFormat; }; @@ -124,7 +125,8 @@ void QSGTextMaskShader::initialize() m_matrix_id = program()->uniformLocation("matrix"); m_color_id = program()->uniformLocation("color"); m_textureScale_id = program()->uniformLocation("textureScale"); - program()->setUniformValue("dpr", (float) qsg_device_pixel_ratio(QOpenGLContext::currentContext())); + m_devicePixelRatio = (float) qsg_device_pixel_ratio(QOpenGLContext::currentContext()); + program()->setUniformValue("dpr", m_devicePixelRatio); } void QSGTextMaskShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) @@ -152,6 +154,12 @@ void QSGTextMaskShader::updateState(const RenderState &state, QSGMaterial *newEf } } + float devicePixelRatio = (float) qsg_device_pixel_ratio(QOpenGLContext::currentContext()); + if (m_devicePixelRatio != devicePixelRatio) { + m_devicePixelRatio = devicePixelRatio; + program()->setUniformValue("dpr", m_devicePixelRatio); + } + if (state.isMatrixDirty()) program()->setUniformValue(m_matrix_id, state.combinedMatrix()); } diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 61de81576c..ce3bf7d61d 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -91,12 +91,8 @@ void QSGRenderLoop::cleanup() foreach (QQuickWindow *w, s_instance->windows()) { QQuickWindowPrivate *wd = QQuickWindowPrivate::get(w); if (wd->windowManager == s_instance) { - // windowDestroyed() triggers a sendPostedEvent(DeferredDelete), - // so wd will be null if the window was deleteLater()'ed - bool wasDeleted = wd->wasDeleted; s_instance->windowDestroyed(w); - if (!wasDeleted) - wd->windowManager = 0; + wd->windowManager = 0; } } delete s_instance; @@ -300,7 +296,6 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window) d->cleanupNodesOnShutdown(); if (m_windows.size() == 0) { rc->invalidate(); - QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); delete gl; gl = 0; } else if (gl && window == gl->surface() && current) { diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index e1a54810b7..7b1e24246b 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -767,9 +767,9 @@ void QSGThreadedRenderLoop::animationStopped() void QSGThreadedRenderLoop::startOrStopAnimationTimer() { int exposedWindows = 0; - Window *theOne = 0; + const Window *theOne = 0; for (int i=0; i<m_windows.size(); ++i) { - Window &w = m_windows[i]; + const Window &w = m_windows.at(i); if (w.window->isVisible() && w.window->isExposed()) { ++exposedWindows; theOne = &w; @@ -781,7 +781,7 @@ void QSGThreadedRenderLoop::startOrStopAnimationTimer() m_animation_timer = 0; // If animations are running, make sure we keep on animating if (m_animation_driver->isRunning()) - maybePostPolishRequest(theOne); + maybePostPolishRequest(const_cast<Window *>(theOne)); } else if (m_animation_timer == 0 && exposedWindows != 1 && m_animation_driver->isRunning()) { m_animation_timer = startTimer(qsgrl_animation_interval()); diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index e4db348ef0..b88d21ce66 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -234,7 +234,6 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window) d->cleanupNodesOnShutdown(); if (m_windows.size() == 0) { d->context->invalidate(); - QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); delete m_gl; m_gl = 0; } else if (m_gl && current) { diff --git a/src/quick/scenegraph/shaders/smoothtexture.vert b/src/quick/scenegraph/shaders/smoothtexture.vert index 1ce824a68f..900fbc6a72 100644 --- a/src/quick/scenegraph/shaders/smoothtexture.vert +++ b/src/quick/scenegraph/shaders/smoothtexture.vert @@ -48,5 +48,8 @@ void main() bool onEdge = any(notEqual(vertexOffset, vec2(0.))); bool outerEdge = all(equal(texCoordOffset, vec2(0.))); - vertexOpacity = onEdge && outerEdge ? 0. : opacity; + if (onEdge && outerEdge) + vertexOpacity = 0.; + else + vertexOpacity = opacity; }
\ No newline at end of file |