update issues fixed

This commit is contained in:
Uwe Rathmann 2023-12-21 07:14:55 +01:00
parent f3ee4749b8
commit 583cf4e87f
4 changed files with 15 additions and 6 deletions

View File

@ -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;
}
};

View File

@ -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;

View File

@ -27,6 +27,7 @@ class TextureFilterNode : public QSGGeometryNode
bool ownsTexture() const;
void setRect( const QRectF& );
QRectF rect() const;
void setTextureMaterial( TextureFilterMaterial* );
TextureFilterMaterial* textureMaterial() const;

View File

@ -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 )