Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowsdirect2dpaintengine.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
4#ifndef QWINDOWSDIRECT2DPAINTENGINE_H
5#define QWINDOWSDIRECT2DPAINTENGINE_H
6
7#include <QtCore/qscopedpointer.h>
8#include <QtGui/private/qpaintengineex_p.h>
9
10struct ID2D1Geometry;
11
13
16
18{
19 Q_DECLARE_PRIVATE(QWindowsDirect2DPaintEngine)
22public:
29
31
32 bool begin(QPaintDevice *pdev) override;
33 bool end() override;
34
35 Type type() const override;
36
37 void setState(QPainterState *s) override;
38
39 void draw(const QVectorPath &path) override;
40
41 void fill(const QVectorPath &path, const QBrush &brush) override;
42 void fill(ID2D1Geometry *geometry, const QBrush &brush);
43
44 void stroke(const QVectorPath &path, const QPen &pen) override;
45 void stroke(ID2D1Geometry *geometry, const QPen &pen);
46
47 void clip(const QVectorPath &path, Qt::ClipOperation op) override;
48
49 void clipEnabledChanged() override;
50 void penChanged() override;
51 void brushChanged() override;
52 void brushOriginChanged() override;
53 void opacityChanged() override;
54 void compositionModeChanged() override;
55 void renderHintsChanged() override;
56 void transformChanged() override;
57
58 void fillRect(const QRectF &rect, const QBrush &brush) override;
59
60 void drawRects(const QRect *rects, int rectCount) override;
61 void drawRects(const QRectF *rects, int rectCount) override;
62
63 void drawEllipse(const QRectF &r) override;
64 void drawEllipse(const QRect &r) override;
65
66 void drawImage(const QRectF &rectangle, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override;
67 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
68
69 void drawStaticTextItem(QStaticTextItem *staticTextItem) override;
70 void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
71
72private:
73 void ensureBrush();
74 void ensureBrush(const QBrush &brush);
75 void ensurePen();
76 void ensurePen(const QPen &pen);
77
78 void rasterFill(const QVectorPath &path, const QBrush &brush);
79
80 enum EmulationType { PenEmulation, BrushEmulation };
81 bool emulationRequired(EmulationType type) const;
82
83 bool antiAliasingEnabled() const;
84 void adjustForAliasing(QRectF *rect);
85 void adjustForAliasing(QPointF *point);
86
87 void suspend();
88 void resume();
89};
91
94{
95 Q_DISABLE_COPY_MOVE(QWindowsDirect2DPaintEngineSuspender)
97 QScopedPointer<QWindowsDirect2DPaintEngineSuspenderPrivate> d_ptr;
98public:
101 void resume();
102};
103
105
106#endif // QWINDOWSDIRECT2DPAINTENGINE_H
\inmodule QtGui
Definition qbrush.h:30
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
Definition qpen.h:28
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtGui
QWindowsDirect2DPaintEngineSuspender(QWindowsDirect2DPaintEngine *engine)
void fillRect(const QRectF &rect, const QBrush &brush) override
Type type() const override
Reimplement this function to return the paint engine \l{Type}.
void stroke(ID2D1Geometry *geometry, const QPen &pen)
void fill(ID2D1Geometry *geometry, const QBrush &brush)
void drawRects(const QRect *rects, int rectCount) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void draw(const QVectorPath &path) override
void drawEllipse(const QRectF &r) override
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
This function draws the text item textItem at position p.
void setState(QPainterState *s) override
void stroke(const QVectorPath &path, const QPen &pen) override
void drawStaticTextItem(QStaticTextItem *staticTextItem) override
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
void fill(const QVectorPath &path, const QBrush &brush) override
void clip(const QVectorPath &path, Qt::ClipOperation op) override
QWindowsDirect2DPaintEngine(QWindowsDirect2DBitmap *bitmap, Flags flags)
bool end() override
Reimplement this function to finish painting on the current paint device.
void drawImage(const QRectF &rectangle, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override
Reimplement this function to draw the part of the image specified by the sr rectangle in the given re...
bool begin(QPaintDevice *pdev) override
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
rect
[4]
Combined button and popup list for selecting options.
@ AutoColor
Definition qnamespace.h:478
ClipOperation
Definition brush.cpp:5
Definition image.cpp:4
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
Flags
GLboolean r
[2]
GLenum type
GLbitfield flags
GLdouble s
[6]
Definition qopenglext.h:235
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
GLsizei const GLchar *const * path
GLfloat GLfloat p
[1]
QJSEngine engine
[0]
Definition moc.h:23