detection of non-translating transformations fixed

This commit is contained in:
Uwe Rathmann 2019-12-05 11:26:48 +01:00
parent 06959dfc86
commit 8fccc35156
2 changed files with 16 additions and 13 deletions

View File

@ -907,7 +907,12 @@ void QskGraphic::updateState( const QPaintEngineState& state )
{
if ( !( m_data->commandTypes & QskGraphic::Transformation ) )
{
if ( !state.transform().isTranslating() )
/*
QTransform::isScaling() returns true for all type
of transformations beside simple translations
even if it is f.e a rotation
*/
if ( state.transform().isScaling() )
m_data->commandTypes |= QskGraphic::Transformation;
}
}

View File

@ -53,9 +53,16 @@ void QskGraphicNode::setGraphic(
QSize textureSize;
constexpr auto mask = QskGraphic::VectorData | QskGraphic::Transformation;
if ( graphic.commandTypes() & mask )
if ( graphic.commandTypes() == QskGraphic::RasterData )
{
/*
simple raster data - usually a QImage/QPixmap only.
There is no benefit in rescaling it into the target rectangle
by the CPU and creating a new texture.
*/
textureSize = graphic.defaultSize().toSize();
}
else
{
textureSize = rect.size().toSize();
@ -66,15 +73,6 @@ void QskGraphicNode::setGraphic(
( rect.height() != static_cast< int >( oldRect.height() ) );
}
}
else
{
/*
simple raster data - usually a QImage/QPixmap only.
There is no benefit in rescaling it into the target rectangle
by the CPU and creating a new texture.
*/
textureSize = graphic.defaultSize().toSize();
}
QskTextureNode::setRect( rect );