Support smooth for AnimatedSprite
authorGunnar Sletta <gunnar.sletta@jollamobile.com>
Mon, 12 May 2014 08:38:58 +0000 (10:38 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 14 May 2014 19:27:54 +0000 (21:27 +0200)
Task-number: QTBUG-38923
Change-Id: I1cb9ac434aa729ee390e17deced9ed470895549d
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
src/quick/items/qquickanimatedsprite.cpp

index bfe957e..533f1ca 100644 (file)
@@ -498,7 +498,6 @@ QSGGeometryNode* QQuickAnimatedSprite::buildNode()
         return 0;
     m_sheetSize = QSizeF(image.size());
     m_material->texture = window()->createTextureFromImage(image);
-    m_material->texture->setFiltering(QSGTexture::Linear);
     m_spriteEngine->start(0);
     m_material->animT = 0;
     m_material->animX1 = m_spriteEngine->spriteX() / m_sheetSize.width();
@@ -677,6 +676,7 @@ void QQuickAnimatedSprite::prepareNextFrame()
     m_material->animW = w;
     m_material->animH = h;
     m_material->animT = m_interpolate ? progress : 0.0;
+    m_material->texture->setFiltering(smooth() ? QSGTexture::Linear : QSGTexture::Nearest);
 }
 
 QT_END_NAMESPACE