Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpaintengine_alpha_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QPAINTENGINE_ALPHA_P_H
6#define QPAINTENGINE_ALPHA_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of other Qt classes. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
20
21#ifndef QT_NO_PRINTER
22#include "private/qpaintengine_p.h"
23#include <QtPrintSupport/qtprintsupportglobal.h>
24
25QT_BEGIN_NAMESPACE
26
27class QAlphaPaintEnginePrivate;
28
29class Q_PRINTSUPPORT_EXPORT QAlphaPaintEngine : public QPaintEngine
30{
31 Q_DECLARE_PRIVATE(QAlphaPaintEngine)
32public:
33 ~QAlphaPaintEngine();
34
35 bool begin(QPaintDevice *pdev) override;
36 bool end() override;
37
38 void updateState(const QPaintEngineState &state) override;
39
40 void drawPath(const QPainterPath &path) override;
41
42 void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
43
44 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
45 void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
46 void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
47
48protected:
49 QAlphaPaintEngine(QAlphaPaintEnginePrivate &data, PaintEngineFeatures devcaps = { });
50 QRegion alphaClipping() const;
51 bool continueCall() const;
52 void flushAndInit(bool init = true);
53 void cleanUp();
54};
55
57{
58 Q_DECLARE_PUBLIC(QAlphaPaintEngine)
59public:
62
63 int m_pass;
67
70
76
86
89
90 void addAlphaRect(const QRectF &rect);
91 void addDirtyRect(const QRectF &rect) { m_dirtyRects.append(rect.toAlignedRect()); }
92 bool canSeeTroughBackground(bool somethingInRectHasAlpha, const QRectF &rect) const;
93
94 QRectF addPenWidth(const QPainterPath &path);
95 void drawAlphaImage(const QRectF &rect);
96 QRect toRect(const QRectF &rect) const;
97 bool fullyContained(const QRectF &rect) const;
98
99 void resetState(QPainter *p);
100};
101
102QT_END_NAMESPACE
103
104#endif // QT_NO_PRINTER
105
106#endif // QPAINTENGINE_ALPHA_P_H
void drawAlphaImage(const QRectF &rect)
QPaintEngine::PaintEngineFeatures m_savedcaps
QRectF addPenWidth(const QPainterPath &path)
void addDirtyRect(const QRectF &rect)
void addAlphaRect(const QRectF &rect)
bool fullyContained(const QRectF &rect) const
QRect toRect(const QRectF &rect) const
bool canSeeTroughBackground(bool somethingInRectHasAlpha, const QRectF &rect) const