diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpaintengineex_p.h | 9 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 5 | ||||
-rw-r--r-- | src/gui/painting/qpdf.cpp | 11 |
3 files changed, 13 insertions, 12 deletions
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h index 9f3e577c34..29eea6032e 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/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 47af6a883a..01f9904798 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5536,6 +5536,11 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun) { Q_D(QPainter); + if (!d->engine) { + qWarning("QPainter::drawGlyphRun: Painter not active"); + return; + } + QRawFont font = glyphRun.rawFont(); if (!font.isValid()) return; diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 8fe57d3d23..cc1ad02eee 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1051,7 +1051,7 @@ void QPdfEngine::drawPath (const QPainterPath &p) if (!d->hasPen && !d->hasBrush) return; - if (d->simplePen && d->opacity == 1.0) { + if (d->simplePen) { // draw strokes natively in this case for better output *d->currentPage << QPdf::generatePath(p, QTransform(), d->hasBrush ? QPdf::FillAndStrokePath : QPdf::StrokePath); } else { @@ -1198,7 +1198,7 @@ void QPdfEngine::updateState(const QPaintEngineState &state) d->stroker.setPen(d->pen, state.renderHints()); QBrush penBrush = d->pen.brush(); bool oldSimple = d->simplePen; - d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque()); + d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque() && d->opacity == 1.0); if (oldSimple != d->simplePen) flags |= DirtyTransform; } else if (flags & DirtyHints) { @@ -1214,8 +1214,13 @@ void QPdfEngine::updateState(const QPaintEngineState &state) d->brushOrigin = state.brushOrigin(); flags |= DirtyBrush; } - if (flags & DirtyOpacity) + if (flags & DirtyOpacity) { d->opacity = state.opacity(); + if (d->simplePen && d->opacity != 1.0) { + d->simplePen = false; + flags |= DirtyTransform; + } + } bool ce = d->clipEnabled; if (flags & DirtyClipPath) { |