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 QEMULATIONPAINTENGINE_P_H
5#define QEMULATIONPAINTENGINE_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/qpaintengineex_p.h>
20
21QT_BEGIN_NAMESPACE
22
23
24class QEmulationPaintEngine : public QPaintEngineEx
25{
26public:
27 QEmulationPaintEngine(QPaintEngineEx *engine);
28
29 bool begin(QPaintDevice *pdev) override;
30 bool end() override;
31
32 Type type() const override;
33 QPainterState *createState(QPainterState *orig) const override;
34
35 void fill(const QVectorPath &path, const QBrush &brush) override;
36 void stroke(const QVectorPath &path, const QPen &pen) override;
37 void clip(const QVectorPath &path, Qt::ClipOperation op) override;
38
39 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
40 void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
41 void drawStaticTextItem(QStaticTextItem *item) override;
42 void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
43 void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags) override;
44
45 void clipEnabledChanged() override;
46 void penChanged() override;
47 void brushChanged() override;
48 void brushOriginChanged() override;
49 void opacityChanged() override;
50 void compositionModeChanged() override;
51 void renderHintsChanged() override;
52 void transformChanged() override;
53
54 void setState(QPainterState *s) override;
55
56 void beginNativePainting() override;
57 void endNativePainting() override;
58
59 uint flags() const override { return QPaintEngineEx::IsEmulationEngine | QPaintEngineEx::DoNotEmulate; }
60
61 inline QPainterState *state() { return (QPainterState *)QPaintEngine::state; }
62 inline const QPainterState *state() const { return (const QPainterState *)QPaintEngine::state; }
63
64 QPaintEngineEx *real_engine;
65private:
66 void fillBGRect(const QRectF &r);
67};
68
69QT_END_NAMESPACE
70
71#endif
72

source code of qtbase/src/gui/painting/qemulationpaintengine_p.h