no reason for recreating a texture, when it is only translated
This commit is contained in:
parent
6edeca7360
commit
ed9433c229
@ -42,7 +42,14 @@ void QskGraphicNode::setGraphic(
|
|||||||
const QskGraphic& graphic, const QskColorFilter& colorFilter,
|
const QskGraphic& graphic, const QskColorFilter& colorFilter,
|
||||||
QskGraphicTextureFactory::RenderMode renderMode, const QRect& rect )
|
QskGraphicTextureFactory::RenderMode renderMode, const QRect& rect )
|
||||||
{
|
{
|
||||||
bool isDirty = rect != QskTextureNode::rect();
|
bool isTextureDirty = ( QskTextureNode::textureId() == 0 );
|
||||||
|
|
||||||
|
if ( !isTextureDirty )
|
||||||
|
{
|
||||||
|
const auto oldRect = QskTextureNode::rect();
|
||||||
|
isTextureDirty = ( rect.width() != static_cast<int>( oldRect.width() ) )
|
||||||
|
|| ( rect.height() != static_cast<int>( oldRect.height() ) );
|
||||||
|
}
|
||||||
|
|
||||||
QskTextureNode::setRect( rect );
|
QskTextureNode::setRect( rect );
|
||||||
|
|
||||||
@ -50,10 +57,10 @@ void QskGraphicNode::setGraphic(
|
|||||||
if ( hash != m_hash )
|
if ( hash != m_hash )
|
||||||
{
|
{
|
||||||
m_hash = hash;
|
m_hash = hash;
|
||||||
isDirty = true;
|
isTextureDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isDirty )
|
if ( isTextureDirty )
|
||||||
{
|
{
|
||||||
const QRect textureRect( 0, 0, rect.width(), rect.height() );
|
const QRect textureRect( 0, 0, rect.width(), rect.height() );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user