1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QPAINTENGINE_BLITTER_P_H |
5 | #define QPAINTENGINE_BLITTER_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtGui/private/qtguiglobal_p.h> |
19 | #include "private/qpaintengine_raster_p.h" |
20 | |
21 | #ifndef QT_NO_BLITTABLE |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QBlitterPaintEnginePrivate; |
25 | class QBlittablePlatformPixmap; |
26 | class QBlittable; |
27 | |
28 | class Q_GUI_EXPORT QBlitterPaintEngine : public QRasterPaintEngine |
29 | { |
30 | Q_DECLARE_PRIVATE(QBlitterPaintEngine) |
31 | public: |
32 | QBlitterPaintEngine(QBlittablePlatformPixmap *p); |
33 | |
34 | virtual QPaintEngine::Type type() const override |
35 | { return Blitter; } |
36 | |
37 | virtual bool begin(QPaintDevice *pdev) override; |
38 | virtual bool end() override; |
39 | |
40 | // Call down into QBlittable |
41 | void fill(const QVectorPath &path, const QBrush &brush) override; |
42 | void fillRect(const QRectF &rect, const QBrush &brush) override; |
43 | void fillRect(const QRectF &rect, const QColor &color) override; |
44 | void drawRects(const QRect *rects, int rectCount) override; |
45 | void drawRects(const QRectF *rects, int rectCount) override; |
46 | void drawPixmap(const QPointF &p, const QPixmap &pm) override; |
47 | void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; |
48 | |
49 | // State tracking |
50 | void setState(QPainterState *s) override; |
51 | virtual void clipEnabledChanged() override; |
52 | virtual void penChanged() override; |
53 | virtual void brushChanged() override; |
54 | virtual void opacityChanged() override; |
55 | virtual void compositionModeChanged() override; |
56 | virtual void renderHintsChanged() override; |
57 | virtual void transformChanged() override; |
58 | |
59 | // Override to lock the QBlittable before using raster |
60 | void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; |
61 | void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override; |
62 | void fillPath(const QPainterPath &path, QSpanData *fillData) override; |
63 | void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; |
64 | void drawEllipse(const QRectF &rect) override; |
65 | void drawImage(const QPointF &p, const QImage &img) override; |
66 | void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, |
67 | Qt::ImageConversionFlags flags = Qt::AutoColor) override; |
68 | void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) override; |
69 | void drawTextItem(const QPointF &p, const QTextItem &textItem) override; |
70 | void drawPoints(const QPointF *points, int pointCount) override; |
71 | void drawPoints(const QPoint *points, int pointCount) override; |
72 | void stroke(const QVectorPath &path, const QPen &pen) override; |
73 | void drawStaticTextItem(QStaticTextItem *) override; |
74 | bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, |
75 | QFontEngine *fontEngine) override; |
76 | }; |
77 | |
78 | QT_END_NAMESPACE |
79 | #endif //QT_NO_BLITTABLE |
80 | #endif // QPAINTENGINE_BLITTER_P_H |
81 | |
82 | |