unused color table removed

This commit is contained in:
Uwe Rathmann 2018-03-15 20:18:53 +01:00
parent 4cd45201f6
commit c88ae44687
2 changed files with 0 additions and 53 deletions

View File

@ -17,18 +17,6 @@
#include <QGuiApplication> #include <QGuiApplication>
#include <QtMath> #include <QtMath>
#include <algorithm>
static inline void qskInsertColor( const QColor& color,
QVector< QRgb >& colorTable )
{
const QRgb rgb = color.rgb(); // dropping the alpha value
const auto it = std::lower_bound( colorTable.begin(), colorTable.end(), rgb );
if ( ( it == colorTable.end() ) || ( *it != rgb ) )
colorTable.insert( it, rgb );
}
static inline qreal qskDevicePixelRatio() static inline qreal qskDevicePixelRatio()
{ {
return qGuiApp ? qGuiApp->devicePixelRatio() : 1.0; return qGuiApp ? qGuiApp->devicePixelRatio() : 1.0;
@ -358,7 +346,6 @@ public:
defaultSize( other.defaultSize ), defaultSize( other.defaultSize ),
commands( other.commands ), commands( other.commands ),
pathInfos( other.pathInfos ), pathInfos( other.pathInfos ),
colorTable( other.colorTable ),
boundingRect( other.boundingRect ), boundingRect( other.boundingRect ),
pointRect( other.pointRect ), pointRect( other.pointRect ),
hasRasterData( other.hasRasterData ), hasRasterData( other.hasRasterData ),
@ -379,7 +366,6 @@ public:
QSizeF defaultSize; QSizeF defaultSize;
QVector< QskPainterCommand > commands; QVector< QskPainterCommand > commands;
QVector< PathInfo > pathInfos; QVector< PathInfo > pathInfos;
QVector< QRgb > colorTable;
QRectF boundingRect; QRectF boundingRect;
QRectF pointRect; QRectF pointRect;
@ -553,11 +539,6 @@ QRectF QskGraphic::controlPointRect() const
return m_data->pointRect; return m_data->pointRect;
} }
QVector<QRgb> QskGraphic::colorTable() const
{
return m_data->colorTable;
}
QRectF QskGraphic::scaledBoundingRect( qreal sx, qreal sy ) const QRectF QskGraphic::scaledBoundingRect( qreal sx, qreal sy ) const
{ {
if ( sx == 1.0 && sy == 1.0 ) if ( sx == 1.0 && sy == 1.0 )
@ -899,38 +880,6 @@ void QskGraphic::drawImage( const QRectF& rect, const QImage& image,
void QskGraphic::updateState( const QPaintEngineState& state ) void QskGraphic::updateState( const QPaintEngineState& state )
{ {
m_data->commands += QskPainterCommand( state ); m_data->commands += QskPainterCommand( state );
if ( state.state() & QPaintEngine::DirtyPen )
{
const QPen pen = state.pen();
if ( pen.isSolid() )
{
qskInsertColor( pen.color(), m_data->colorTable );
}
else if ( auto gradient = pen.brush().gradient() )
{
const auto stops = gradient->stops();
for ( const auto& stop : stops )
qskInsertColor( stop.second, m_data->colorTable );
}
}
if ( state.state() & QPaintEngine::DirtyBrush )
{
const QBrush brush = state.brush();
if ( brush.style() == Qt::SolidPattern )
{
qskInsertColor( brush.color(), m_data->colorTable );
}
else if ( auto gradient = brush.gradient() )
{
const auto stops = gradient->stops();
for ( const auto& stop : stops )
qskInsertColor( stop.second, m_data->colorTable );
}
}
} }
void QskGraphic::updateBoundingRect( const QRectF& rect ) void QskGraphic::updateBoundingRect( const QRectF& rect )

View File

@ -80,8 +80,6 @@ public:
QRectF boundingRect() const; QRectF boundingRect() const;
QRectF controlPointRect() const; QRectF controlPointRect() const;
QVector< QRgb > colorTable() const;
const QVector< QskPainterCommand >& commands() const; const QVector< QskPainterCommand >& commands() const;
void setCommands( const QVector< QskPainterCommand >& ); void setCommands( const QVector< QskPainterCommand >& );