From c88ae446877d07bb5dcf4b90fa008db7e6c28466 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 15 Mar 2018 20:18:53 +0100 Subject: [PATCH] unused color table removed --- src/graphic/QskGraphic.cpp | 51 -------------------------------------- src/graphic/QskGraphic.h | 2 -- 2 files changed, 53 deletions(-) diff --git a/src/graphic/QskGraphic.cpp b/src/graphic/QskGraphic.cpp index b71be4d2..f05d3486 100644 --- a/src/graphic/QskGraphic.cpp +++ b/src/graphic/QskGraphic.cpp @@ -17,18 +17,6 @@ #include #include -#include - -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() { return qGuiApp ? qGuiApp->devicePixelRatio() : 1.0; @@ -358,7 +346,6 @@ public: defaultSize( other.defaultSize ), commands( other.commands ), pathInfos( other.pathInfos ), - colorTable( other.colorTable ), boundingRect( other.boundingRect ), pointRect( other.pointRect ), hasRasterData( other.hasRasterData ), @@ -379,7 +366,6 @@ public: QSizeF defaultSize; QVector< QskPainterCommand > commands; QVector< PathInfo > pathInfos; - QVector< QRgb > colorTable; QRectF boundingRect; QRectF pointRect; @@ -553,11 +539,6 @@ QRectF QskGraphic::controlPointRect() const return m_data->pointRect; } -QVector QskGraphic::colorTable() const -{ - return m_data->colorTable; -} - QRectF QskGraphic::scaledBoundingRect( qreal sx, qreal sy ) const { 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 ) { 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 ) diff --git a/src/graphic/QskGraphic.h b/src/graphic/QskGraphic.h index dcb96ce1..86f89938 100644 --- a/src/graphic/QskGraphic.h +++ b/src/graphic/QskGraphic.h @@ -80,8 +80,6 @@ public: QRectF boundingRect() const; QRectF controlPointRect() const; - QVector< QRgb > colorTable() const; - const QVector< QskPainterCommand >& commands() const; void setCommands( const QVector< QskPainterCommand >& );