summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2013-10-27 22:11:38 +0100
committerSamuel Gaist <samuel.gaist@edeltech.ch>2015-02-07 00:51:14 +0000
commitf2b77e3ff71511944ad8da56cb63c4ca8daf6417 (patch)
treec7512c82b6940c731261a8325c9a01bb596613dd /src
parent07c27a13ac2d633fd10058ef55be1f1cd61a120d (diff)
downloadqtbase-f2b77e3ff71511944ad8da56cb63c4ca8daf6417.tar.gz
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>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpaintengineex_p.h9
-rw-r--r--src/widgets/effects/qpixmapfilter.cpp45
2 files changed, 2 insertions, 52 deletions
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 82fcd9765a..b831621a0c 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -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
{
diff --git a/src/widgets/effects/qpixmapfilter.cpp b/src/widgets/effects/qpixmapfilter.cpp
index 6f618b8914..216b19ca48 100644
--- a/src/widgets/effects/qpixmapfilter.cpp
+++ b/src/widgets/effects/qpixmapfilter.cpp
@@ -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);