diff options
Diffstat (limited to 'src/openvg/qpaintengine_vg.cpp')
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index e0c99d7..da07c1d 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -2872,6 +2872,24 @@ void qt_vg_drawVGImage(QPainter *painter, const QPointF& pos, VGImage vgImg) drawVGImage(engine->vgPrivate(), pos, vgImg); } +// Used by qpixmapfilter_vg.cpp to draw filtered VGImage's as a stencil. +void qt_vg_drawVGImageStencil + (QPainter *painter, const QPointF& pos, VGImage vgImg, const QBrush& brush) +{ + QVGPaintEngine *engine = + static_cast<QVGPaintEngine *>(painter->paintEngine()); + + QVGPaintEnginePrivate *d = engine->vgPrivate(); + + QTransform transform(d->imageTransform); + transform.translate(pos.x(), pos.y()); + d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform); + + d->ensureBrush(brush); + d->setImageMode(VG_DRAW_IMAGE_STENCIL); + vgDrawImage(vgImg); +} + void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) { QPixmapData *pd = pm.pixmapData(); @@ -3328,9 +3346,6 @@ QPixmapFilter *QVGPaintEngine::pixmapFilter(int type, const QPixmapFilter *proto d->convolutionFilter.reset(new QVGPixmapConvolutionFilter); return d->convolutionFilter.data(); case QPixmapFilter::ColorizeFilter: - // Strength parameter does not work with current implementation. - if ((static_cast<const QPixmapColorizeFilter *>(prototype))->strength() != 1.0f) - break; if (!d->colorizeFilter) d->colorizeFilter.reset(new QVGPixmapColorizeFilter); return d->colorizeFilter.data(); |