diff --git a/src/declarativeimports/core/fadingnode.cpp b/src/declarativeimports/core/fadingnode.cpp index 207eff390..0c41ec1f4 100644 --- a/src/declarativeimports/core/fadingnode.cpp +++ b/src/declarativeimports/core/fadingnode.cpp @@ -37,7 +37,8 @@ public: virtual const char* fragmentShader() const; virtual const char* vertexShader() const; - virtual void updateState(const FadingMaterialState* newState, const FadingMaterialState* oldState); + using QSGSimpleMaterialShader::updateState; + virtual void updateState(const FadingMaterialState* newState, const FadingMaterialState* oldState) override; virtual QList attributes() const; virtual void initialize(); @@ -73,8 +74,8 @@ const char* FadingMaterialShader::fragmentShader() const "void main() {" "lowp vec4 tex1 = texture2D(u_target, v_coord);" "lowp vec4 tex2 = texture2D(u_src, v_coord);" - "gl_FragColor.rgb = mix(tex1.rgb, tex2.rgb, u_transitionProgress);" - "gl_FragColor.a = mix(tex1.a, tex2.a, u_transitionProgress) * qt_Opacity;" + "gl_FragColor.rgb = mix(tex2.rgb, tex1.rgb, u_transitionProgress);" + "gl_FragColor.a = mix(tex2.a, tex1.a, u_transitionProgress) * qt_Opacity;" "}"; } @@ -83,14 +84,14 @@ void FadingMaterialShader::updateState(const FadingMaterialState* newState, cons { if (!oldState || oldState->source != newState->source) { glFuncs->glActiveTexture(GL_TEXTURE1); - newState->target->bind(); + newState->source->bind(); // reset the active texture back to 0 after we changed it to something else glFuncs->glActiveTexture(GL_TEXTURE0); } if (!oldState || oldState->target != newState->target) { glFuncs->glActiveTexture(GL_TEXTURE0); - newState->source->bind(); + newState->target->bind(); } if (!oldState || oldState->progress != newState->progress) { diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index 384017d4a..cdb442da2 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -45,9 +45,7 @@ IconItem::IconItem(QQuickItem *parent) { m_loadPixmapTimer.setSingleShot(true); m_loadPixmapTimer.setInterval(150); - connect(&m_loadPixmapTimer, &QTimer::timeout, [ = ]() { - loadPixmap(); - }); + connect(&m_loadPixmapTimer, &QTimer::timeout, this, &IconItem::loadPixmap); m_animation = new QPropertyAnimation(this); connect(m_animation, SIGNAL(valueChanged(QVariant)), @@ -217,7 +215,7 @@ QSGNode* IconItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *update } if (m_animation->state() == QAbstractAnimation::Running) { - FadingNode *animatingNode = static_cast(oldNode); + FadingNode *animatingNode = dynamic_cast(oldNode); if (!animatingNode || m_textureChanged) { delete oldNode; @@ -242,7 +240,7 @@ QSGNode* IconItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *update return animatingNode; } else { - Plasma::SVGTextureNode *textureNode = static_cast(oldNode); + Plasma::SVGTextureNode *textureNode = dynamic_cast(oldNode); if (!textureNode || m_textureChanged) { delete oldNode; @@ -274,6 +272,7 @@ void IconItem::animationFinished() { m_oldIconPixmap = QPixmap(); m_textureChanged = true; + update(); } int IconItem::adjustedSize(int size)