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
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
12QT_BEGIN_NAMESPACE
13
14class QWindowsDirect2DPaintEnginePrivate;
16
18{
22public:
28 Q_DECLARE_FLAGS(Flags, Flag)
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
50 void penChanged() 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};
90Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowsDirect2DPaintEngine::Flags)
91
103
104QT_END_NAMESPACE
105
106#endif // QWINDOWSDIRECT2DPAINTENGINE_H
\inmodule QtCore\reentrant
Definition qpoint.h:29
void resize(const QSize &size, const QRegion &staticContents) override
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
void endPaint() override
This function is called after painting onto the surface has ended.
void flush(QWindow *targetWindow, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
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
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...
QImage toImage(const QRect &rect) const override
void fromImage(const QImage &image, Qt::ImageConversionFlags flags) override
void resize(int width, int height) override
QWindowsDirect2DPlatformPixmap(PixelType pixelType, QWindowsDirect2DPaintEngine::Flags flags, QWindowsDirect2DBitmap *bitmap)
void setDevicePixelRatio(qreal scaleFactor) override
void fill(const QColor &color) override
QPaintEngine * paintEngine() const override
int metric(QPaintDevice::PaintDeviceMetric metric) const override
static QWindowsDirect2DPlatformPixmap * platformPixmap(QPixmap *p)
static QWindowsDirect2DWindow * nativeWindow(QWindow *window)
static QWindowsDirect2DBitmap * bitmap(QPixmap *p)