Raster and Blitter engines: method override markups and fixes
While investigating a rendering bug I noticed that methods marked in the blitter engine as virtual and intended to override a base implementation where in fact just shadowing a non-virtual method in the raster engine. Fix that and add Q_DECL_OVERRIDE all around to avoid similar breakage in the future. Change-Id: I24c5bb27fb6d3ac57dddb704a14dab7ce153a72a Reviewed-by: Gunnar Sletta <gunnar@sletta.org>bb10
parent
18f6cd0163
commit
a4f849ff8c
|
|
@ -66,40 +66,41 @@ public:
|
|||
virtual bool end();
|
||||
|
||||
// Call down into QBlittable
|
||||
virtual void fill(const QVectorPath &path, const QBrush &brush);
|
||||
virtual void fillRect(const QRectF &rect, const QBrush &brush);
|
||||
virtual void fillRect(const QRectF &rect, const QColor &color);
|
||||
virtual void drawRects(const QRect *rects, int rectCount);
|
||||
virtual void drawRects(const QRectF *rects, int rectCount);
|
||||
void drawPixmap(const QPointF &p, const QPixmap &pm);
|
||||
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
|
||||
void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE;
|
||||
void fillRect(const QRectF &rect, const QBrush &brush) Q_DECL_OVERRIDE;
|
||||
void fillRect(const QRectF &rect, const QColor &color) Q_DECL_OVERRIDE;
|
||||
void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
|
||||
void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
|
||||
void drawPixmap(const QPointF &p, const QPixmap &pm) Q_DECL_OVERRIDE;
|
||||
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
|
||||
|
||||
// State tracking
|
||||
void setState(QPainterState *s);
|
||||
virtual void clipEnabledChanged();
|
||||
virtual void penChanged();
|
||||
virtual void brushChanged();
|
||||
virtual void opacityChanged();
|
||||
virtual void compositionModeChanged();
|
||||
virtual void renderHintsChanged();
|
||||
virtual void transformChanged();
|
||||
void setState(QPainterState *s) Q_DECL_OVERRIDE;
|
||||
virtual void clipEnabledChanged() Q_DECL_OVERRIDE;
|
||||
virtual void penChanged() Q_DECL_OVERRIDE;
|
||||
virtual void brushChanged() Q_DECL_OVERRIDE;
|
||||
virtual void opacityChanged() Q_DECL_OVERRIDE;
|
||||
virtual void compositionModeChanged() Q_DECL_OVERRIDE;
|
||||
virtual void renderHintsChanged() Q_DECL_OVERRIDE;
|
||||
virtual void transformChanged() Q_DECL_OVERRIDE;
|
||||
|
||||
// Override to lock the QBlittable before using raster
|
||||
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
|
||||
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode);
|
||||
void fillPath(const QPainterPath &path, QSpanData *fillData);
|
||||
void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
|
||||
void drawEllipse(const QRectF &rect);
|
||||
void drawImage(const QPointF &p, const QImage &img);
|
||||
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
|
||||
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
|
||||
void fillPath(const QPainterPath &path, QSpanData *fillData) Q_DECL_OVERRIDE;
|
||||
void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
|
||||
void drawEllipse(const QRectF &rect) Q_DECL_OVERRIDE;
|
||||
void drawImage(const QPointF &p, const QImage &img) Q_DECL_OVERRIDE;
|
||||
void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
|
||||
Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr);
|
||||
void drawTextItem(const QPointF &p, const QTextItem &textItem);
|
||||
void drawPoints(const QPointF *points, int pointCount);
|
||||
void drawPoints(const QPoint *points, int pointCount);
|
||||
void stroke(const QVectorPath &path, const QPen &pen);
|
||||
void drawStaticTextItem(QStaticTextItem *);
|
||||
bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine);
|
||||
Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
|
||||
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) Q_DECL_OVERRIDE;
|
||||
void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
|
||||
void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
|
||||
void drawPoints(const QPoint *points, int pointCount) Q_DECL_OVERRIDE;
|
||||
void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE;
|
||||
void drawStaticTextItem(QStaticTextItem *) Q_DECL_OVERRIDE;
|
||||
bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
|
||||
QFontEngine *fontEngine) Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -1338,9 +1338,9 @@ void QRasterPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op)
|
|||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
///*!
|
||||
// \internal
|
||||
//*/
|
||||
void QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData)
|
||||
{
|
||||
#ifdef QT_DEBUG_DRAW
|
||||
|
|
|
|||
|
|
@ -128,20 +128,20 @@ public:
|
|||
|
||||
QRasterPaintEngine(QPaintDevice *device);
|
||||
~QRasterPaintEngine();
|
||||
bool begin(QPaintDevice *device);
|
||||
bool end();
|
||||
bool begin(QPaintDevice *device) Q_DECL_OVERRIDE;
|
||||
bool end() Q_DECL_OVERRIDE;
|
||||
|
||||
void penChanged();
|
||||
void brushChanged();
|
||||
void brushOriginChanged();
|
||||
void opacityChanged();
|
||||
void compositionModeChanged();
|
||||
void renderHintsChanged();
|
||||
void transformChanged();
|
||||
void clipEnabledChanged();
|
||||
void penChanged() Q_DECL_OVERRIDE;
|
||||
void brushChanged() Q_DECL_OVERRIDE;
|
||||
void brushOriginChanged() Q_DECL_OVERRIDE;
|
||||
void opacityChanged() Q_DECL_OVERRIDE;
|
||||
void compositionModeChanged() Q_DECL_OVERRIDE;
|
||||
void renderHintsChanged() Q_DECL_OVERRIDE;
|
||||
void transformChanged() Q_DECL_OVERRIDE;
|
||||
void clipEnabledChanged() Q_DECL_OVERRIDE;
|
||||
|
||||
void setState(QPainterState *s);
|
||||
QPainterState *createState(QPainterState *orig) const;
|
||||
void setState(QPainterState *s) Q_DECL_OVERRIDE;
|
||||
QPainterState *createState(QPainterState *orig) const Q_DECL_OVERRIDE;
|
||||
inline QRasterPaintEngineState *state() {
|
||||
return static_cast<QRasterPaintEngineState *>(QPaintEngineEx::state());
|
||||
}
|
||||
|
|
@ -154,42 +154,43 @@ public:
|
|||
|
||||
void updateMatrix(const QTransform &matrix);
|
||||
|
||||
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
|
||||
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode);
|
||||
void fillPath(const QPainterPath &path, QSpanData *fillData);
|
||||
void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
|
||||
virtual void fillPath(const QPainterPath &path, QSpanData *fillData);
|
||||
virtual void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
|
||||
|
||||
void drawEllipse(const QRectF &rect);
|
||||
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
|
||||
void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
|
||||
|
||||
void fillRect(const QRectF &rect, const QBrush &brush);
|
||||
void fillRect(const QRectF &rect, const QColor &color);
|
||||
void drawEllipse(const QRectF &rect) Q_DECL_OVERRIDE;
|
||||
|
||||
void drawRects(const QRect *rects, int rectCount);
|
||||
void drawRects(const QRectF *rects, int rectCount);
|
||||
void fillRect(const QRectF &rect, const QBrush &brush) Q_DECL_OVERRIDE;
|
||||
void fillRect(const QRectF &rect, const QColor &color) Q_DECL_OVERRIDE;
|
||||
|
||||
void drawPixmap(const QPointF &p, const QPixmap &pm);
|
||||
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
|
||||
void drawImage(const QPointF &p, const QImage &img);
|
||||
void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
|
||||
void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
|
||||
|
||||
void drawPixmap(const QPointF &p, const QPixmap &pm) Q_DECL_OVERRIDE;
|
||||
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
|
||||
void drawImage(const QPointF &p, const QImage &img) Q_DECL_OVERRIDE;
|
||||
void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
|
||||
Qt::ImageConversionFlags flags = Qt::AutoColor);
|
||||
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr);
|
||||
void drawTextItem(const QPointF &p, const QTextItem &textItem);
|
||||
Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
|
||||
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) Q_DECL_OVERRIDE;
|
||||
void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
|
||||
|
||||
void drawLines(const QLine *line, int lineCount);
|
||||
void drawLines(const QLineF *line, int lineCount);
|
||||
void drawLines(const QLine *line, int lineCount) Q_DECL_OVERRIDE;
|
||||
void drawLines(const QLineF *line, int lineCount) Q_DECL_OVERRIDE;
|
||||
|
||||
void drawPoints(const QPointF *points, int pointCount);
|
||||
void drawPoints(const QPoint *points, int pointCount);
|
||||
void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
|
||||
void drawPoints(const QPoint *points, int pointCount) Q_DECL_OVERRIDE;
|
||||
|
||||
void stroke(const QVectorPath &path, const QPen &pen);
|
||||
void fill(const QVectorPath &path, const QBrush &brush);
|
||||
void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE;
|
||||
void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE;
|
||||
|
||||
void clip(const QVectorPath &path, Qt::ClipOperation op);
|
||||
void clip(const QRect &rect, Qt::ClipOperation op);
|
||||
void clip(const QRegion ®ion, Qt::ClipOperation op);
|
||||
void clip(const QVectorPath &path, Qt::ClipOperation op) Q_DECL_OVERRIDE;
|
||||
void clip(const QRect &rect, Qt::ClipOperation op) Q_DECL_OVERRIDE;
|
||||
void clip(const QRegion ®ion, Qt::ClipOperation op) Q_DECL_OVERRIDE;
|
||||
inline const QClipData *clipData() const;
|
||||
|
||||
void drawStaticTextItem(QStaticTextItem *textItem);
|
||||
void drawStaticTextItem(QStaticTextItem *textItem) Q_DECL_OVERRIDE;
|
||||
virtual bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
|
||||
QFontEngine *fontEngine);
|
||||
|
||||
|
|
@ -219,12 +220,12 @@ public:
|
|||
QRasterBuffer *rasterBuffer();
|
||||
void alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h);
|
||||
|
||||
Type type() const { return Raster; }
|
||||
Type type() const Q_DECL_OVERRIDE { return Raster; }
|
||||
|
||||
QPoint coordinateOffset() const;
|
||||
|
||||
bool requiresPretransformedGlyphPositions(QFontEngine *fontEngine, const QTransform &m) const;
|
||||
bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const;
|
||||
bool requiresPretransformedGlyphPositions(QFontEngine *fontEngine, const QTransform &m) const Q_DECL_OVERRIDE;
|
||||
bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
QRasterPaintEngine(QRasterPaintEnginePrivate &d, QPaintDevice *);
|
||||
|
|
|
|||
Loading…
Reference in New Issue