Qt 5 to-do in qpainterengineex_p.h

This patch apply the recommended cleanup in qpainterengineex_p.h

Task-number: QTBUG-25069
Change-Id: Ice2c3298c88ba6a7141642470aeeefa782af7f3a
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
bb10
Samuel Gaist 2013-10-27 22:11:38 +01:00
parent 07c27a13ac
commit f2b77e3ff7
2 changed files with 2 additions and 52 deletions

View File

@ -65,8 +65,6 @@ struct StrokeHandler;
QDebug Q_GUI_EXPORT &operator<<(QDebug &, const QVectorPath &path);
#endif
class QPixmapFilter;
class Q_GUI_EXPORT QPaintEngineEx : public QPaintEngine
{
Q_DECLARE_PRIVATE(QPaintEngineEx)
@ -140,13 +138,6 @@ public:
virtual void beginNativePainting() {}
virtual void endNativePainting() {}
// Return a pixmap filter of "type" that can render the parameters
// in "prototype". The returned filter is owned by the engine and
// will be destroyed when the engine is destroyed. The "prototype"
// allows the engine to pick different filters based on the parameters
// that will be requested, and not just the "type".
virtual QPixmapFilter *pixmapFilter(int /*type*/, const QPixmapFilter * /*prototype*/) { return 0; }
// These flags are needed in the implementation of paint buffers.
enum Flags
{

View File

@ -416,17 +416,7 @@ void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const Q
if (src.isNull())
return;
QPixmapFilter *filter = painter->paintEngine() && painter->paintEngine()->isExtended() ?
static_cast<QPaintEngineEx *>(painter->paintEngine())->pixmapFilter(type(), this) : 0;
QPixmapConvolutionFilter *convolutionFilter = static_cast<QPixmapConvolutionFilter*>(filter);
if (convolutionFilter) {
convolutionFilter->setConvolutionKernel(d->convolutionKernel, d->kernelWidth, d->kernelHeight);
convolutionFilter->d_func()->convoluteAlpha = d->convoluteAlpha;
convolutionFilter->draw(painter, p, src, srcRect);
return;
}
// falling back to raster implementation
// raster implementation
QImage *target = 0;
if (painter->paintEngine()->paintDevice()->devType() == QInternal::Image) {
@ -924,16 +914,6 @@ void QPixmapBlurFilter::draw(QPainter *painter, const QPointF &p, const QPixmap
if (qt_scaleForTransform(painter->transform(), &scale))
scaledRadius /= scale;
QPixmapFilter *filter = painter->paintEngine() && painter->paintEngine()->isExtended() ?
static_cast<QPaintEngineEx *>(painter->paintEngine())->pixmapFilter(type(), this) : 0;
QPixmapBlurFilter *blurFilter = static_cast<QPixmapBlurFilter*>(filter);
if (blurFilter) {
blurFilter->setRadius(scaledRadius);
blurFilter->setBlurHints(d->hints);
blurFilter->draw(painter, p, src, srcRect);
return;
}
QImage srcImage;
QImage destImage;
@ -1094,17 +1074,7 @@ void QPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const Q
if (src.isNull())
return;
QPixmapFilter *filter = painter->paintEngine() && painter->paintEngine()->isExtended() ?
static_cast<QPaintEngineEx *>(painter->paintEngine())->pixmapFilter(type(), this) : 0;
QPixmapColorizeFilter *colorizeFilter = static_cast<QPixmapColorizeFilter*>(filter);
if (colorizeFilter) {
colorizeFilter->setColor(d->color);
colorizeFilter->setStrength(d->strength);
colorizeFilter->draw(painter, dest, src, srcRect);
return;
}
// falling back to raster implementation
// raster implementation
if (!d->opaque) {
painter->drawPixmap(dest, src, srcRect);
@ -1328,17 +1298,6 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
if (px.isNull())
return;
QPixmapFilter *filter = p->paintEngine() && p->paintEngine()->isExtended() ?
static_cast<QPaintEngineEx *>(p->paintEngine())->pixmapFilter(type(), this) : 0;
QPixmapDropShadowFilter *dropShadowFilter = static_cast<QPixmapDropShadowFilter*>(filter);
if (dropShadowFilter) {
dropShadowFilter->setColor(d->color);
dropShadowFilter->setBlurRadius(d->radius);
dropShadowFilter->setOffset(d->offset);
dropShadowFilter->draw(p, pos, px, src);
return;
}
QImage tmp(px.size(), QImage::Format_ARGB32_Premultiplied);
tmp.fill(0);
QPainter tmpPainter(&tmp);