From 583cf4e87f41dae1b7e6251fd33be722c9b02c5e Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 21 Dec 2023 07:14:55 +0100 Subject: [PATCH] update issues fixed --- playground/parrots/Overlay.cpp | 11 +++++++---- playground/parrots/TextureFilterNode.cpp | 5 +++++ playground/parrots/TextureFilterNode.h | 1 + src/nodes/QskSceneTexture.cpp | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/playground/parrots/Overlay.cpp b/playground/parrots/Overlay.cpp index 4f33e144..e2e7946c 100644 --- a/playground/parrots/Overlay.cpp +++ b/playground/parrots/Overlay.cpp @@ -154,21 +154,24 @@ namespace texture->setTextureNode( textureNode ); } - textureNode->setRect( rect ); - auto texture = qobject_cast< QskSceneTexture* >( textureNode->texture() ); Q_ASSERT( texture ); - if ( texture->isDirty() ) + if ( texture->isDirty() || rect != textureNode->rect() ) { texture->setFiltering( overlay->smooth() ? QSGTexture::Linear : QSGTexture::Nearest ); auto finalNode = const_cast< QSGTransformNode* >( qskItemNode( overlay ) ); - texture->render( rootNode, finalNode, overlay->geometry() ); + + texture->render( rootNode, finalNode, + rect.translated( overlay->position() ) ); + textureNode->markDirty( QSGNode::DirtyMaterial ); } + textureNode->setRect( rect ); + return textureNode; } }; diff --git a/playground/parrots/TextureFilterNode.cpp b/playground/parrots/TextureFilterNode.cpp index c9374797..a2853ca4 100644 --- a/playground/parrots/TextureFilterNode.cpp +++ b/playground/parrots/TextureFilterNode.cpp @@ -88,6 +88,11 @@ void TextureFilterNode::setRect( const QRectF& rect ) } } +QRectF TextureFilterNode::rect() const +{ + return d_func()->rect; +} + void TextureFilterNode::setOwnsTexture( bool on ) { d_func()->ownsTexture = on; diff --git a/playground/parrots/TextureFilterNode.h b/playground/parrots/TextureFilterNode.h index 05108286..50fe0860 100644 --- a/playground/parrots/TextureFilterNode.h +++ b/playground/parrots/TextureFilterNode.h @@ -27,6 +27,7 @@ class TextureFilterNode : public QSGGeometryNode bool ownsTexture() const; void setRect( const QRectF& ); + QRectF rect() const; void setTextureMaterial( TextureFilterMaterial* ); TextureFilterMaterial* textureMaterial() const; diff --git a/src/nodes/QskSceneTexture.cpp b/src/nodes/QskSceneTexture.cpp index 0441ea06..113c719f 100644 --- a/src/nodes/QskSceneTexture.cpp +++ b/src/nodes/QskSceneTexture.cpp @@ -151,6 +151,8 @@ namespace void Renderer::render() { + m_dirty = false; + qskTryBlockTrailingNodes( m_finalNode, rootNode(), true, false ); #if 0 @@ -160,8 +162,6 @@ namespace #endif Inherited::render(); qskTryBlockTrailingNodes( m_finalNode, rootNode(), false, false ); - - m_dirty = false; } void Renderer::nodeChanged( QSGNode* node, QSGNode::DirtyState state )