![]() |
Qt 6.x
The Qt SDK
|
#include <qwindowsdirect2dpaintengine.h>
Public Types | |
enum | Flag { NoFlag = 0 , TranslucentTopLevelWindow = 1 , EmulateComposition = 2 } |
![]() | |
enum | Flags { DoNotEmulate = 0x01 , IsEmulationEngine = 0x02 } |
![]() | |
enum | PaintEngineFeature { PrimitiveTransform = 0x00000001 , PatternTransform = 0x00000002 , PixmapTransform = 0x00000004 , PatternBrush = 0x00000008 , LinearGradientFill = 0x00000010 , RadialGradientFill = 0x00000020 , ConicalGradientFill = 0x00000040 , AlphaBlend = 0x00000080 , PorterDuff = 0x00000100 , PainterPaths = 0x00000200 , Antialiasing = 0x00000400 , BrushStroke = 0x00000800 , ConstantOpacity = 0x00001000 , MaskedBrush = 0x00002000 , PerspectiveTransform = 0x00004000 , BlendModes = 0x00008000 , ObjectBoundingModeGradients = 0x00010000 , RasterOpModes = 0x00020000 , PaintOutsidePaintEvent = 0x20000000 , AllFeatures = 0xffffffff } |
This enum is used to describe the features or capabilities that the paint engine has. More... | |
enum | DirtyFlag { DirtyPen = 0x0001 , DirtyBrush = 0x0002 , DirtyBrushOrigin = 0x0004 , DirtyFont = 0x0008 , DirtyBackground = 0x0010 , DirtyBackgroundMode = 0x0020 , DirtyTransform = 0x0040 , DirtyClipRegion = 0x0080 , DirtyClipPath = 0x0100 , DirtyHints = 0x0200 , DirtyCompositionMode = 0x0400 , DirtyClipEnabled = 0x0800 , DirtyOpacity = 0x1000 , AllDirty = 0xffff } |
\value DirtyPen The pen is dirty and needs to be updated. More... | |
enum | PolygonDrawMode { OddEvenMode , WindingMode , ConvexMode , PolylineMode } |
\value OddEvenMode The polygon should be drawn using OddEven fill rule. More... | |
enum | Type { X11 , Windows , QuickDraw , CoreGraphics , MacPrinter , QWindowSystem , OpenGL , Picture , SVG , Raster , Direct3D , Pdf , OpenVG , OpenGL2 , PaintBuffer , Blitter , Direct2D , User = 50 , MaxUser = 100 } |
\value X11 \value Windows \value MacPrinter \value CoreGraphics \macos's Quartz2D (CoreGraphics) \value QuickDraw \macos's QuickDraw \value QWindowSystem Qt for Embedded Linux \value OpenGL \value Picture QPicture format \value SVG Scalable Vector Graphics XML format \value Raster \value Direct3D Windows only, Direct3D based engine \value Pdf Portable Document Format \value OpenVG \value User First user type ID \value MaxUser Last user type ID \value OpenGL2 \value PaintBuffer \value Blitter \value Direct2D Windows only, Direct2D based engine More... | |
Public Member Functions | |
QWindowsDirect2DPaintEngine (QWindowsDirect2DBitmap *bitmap, Flags flags) | |
bool | begin (QPaintDevice *pdev) override |
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. | |
bool | end () override |
Reimplement this function to finish painting on the current paint device. | |
Type | type () const override |
Reimplement this function to return the paint engine \l{Type}. | |
void | setState (QPainterState *s) override |
void | draw (const QVectorPath &path) override |
void | fill (const QVectorPath &path, const QBrush &brush) override |
void | fill (ID2D1Geometry *geometry, const QBrush &brush) |
void | stroke (const QVectorPath &path, const QPen &pen) override |
void | stroke (ID2D1Geometry *geometry, const QPen &pen) |
void | clip (const QVectorPath &path, Qt::ClipOperation op) override |
void | clipEnabledChanged () override |
void | penChanged () override |
void | brushChanged () override |
void | brushOriginChanged () override |
void | opacityChanged () override |
void | compositionModeChanged () override |
void | renderHintsChanged () override |
void | transformChanged () override |
void | fillRect (const QRectF &rect, const QBrush &brush) override |
void | drawRects (const QRect *rects, int rectCount) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function. | |
void | drawRects (const QRectF *rects, int rectCount) override |
Draws the first rectCount rectangles in the buffer rects. | |
void | drawEllipse (const QRectF &r) override |
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. | |
void | drawEllipse (const QRect &r) override |
The default implementation of this function calls the floating point version of this function. | |
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 rectangle using the given conversion flags flags, to convert it to a pixmap. | |
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 | drawStaticTextItem (QStaticTextItem *staticTextItem) override |
void | drawTextItem (const QPointF &p, const QTextItem &textItem) override |
This function draws the text item textItem at position p. | |
![]() | |
QPaintEngineEx () | |
virtual QPainterState * | createState (QPainterState *orig) const |
virtual void | draw (const QVectorPath &path) |
virtual void | fill (const QVectorPath &path, const QBrush &brush)=0 |
virtual void | stroke (const QVectorPath &path, const QPen &pen) |
virtual void | clip (const QVectorPath &path, Qt::ClipOperation op)=0 |
virtual void | clip (const QRect &rect, Qt::ClipOperation op) |
virtual void | clip (const QRegion ®ion, Qt::ClipOperation op) |
virtual void | clip (const QPainterPath &path, Qt::ClipOperation op) |
virtual void | clipEnabledChanged ()=0 |
virtual void | penChanged ()=0 |
virtual void | brushChanged ()=0 |
virtual void | brushOriginChanged ()=0 |
virtual void | opacityChanged ()=0 |
virtual void | compositionModeChanged ()=0 |
virtual void | renderHintsChanged ()=0 |
virtual void | transformChanged ()=0 |
virtual void | fillRect (const QRectF &rect, const QBrush &brush) |
virtual void | fillRect (const QRectF &rect, const QColor &color) |
virtual void | drawRoundedRect (const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode) |
virtual void | drawRects (const QRect *rects, int rectCount) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function. | |
virtual void | drawRects (const QRectF *rects, int rectCount) override |
Draws the first rectCount rectangles in the buffer rects. | |
virtual void | drawLines (const QLine *lines, int lineCount) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function. | |
virtual void | drawLines (const QLineF *lines, int lineCount) override |
The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine. | |
virtual void | drawEllipse (const QRectF &r) override |
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. | |
virtual void | drawEllipse (const QRect &r) override |
The default implementation of this function calls the floating point version of this function. | |
virtual void | drawPath (const QPainterPath &path) override |
The default implementation ignores the path and does nothing. | |
virtual void | drawPoints (const QPointF *points, int pointCount) override |
Draws the first pointCount points in the buffer points. | |
virtual void | drawPoints (const QPoint *points, int pointCount) override |
Draws the first pointCount points in the buffer points. | |
virtual void | drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode) override |
Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. | |
virtual void | drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. | |
virtual void | drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr) override=0 |
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r. | |
virtual void | drawPixmap (const QPointF &pos, const QPixmap &pm) |
virtual void | drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override=0 |
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap. | |
virtual void | drawImage (const QPointF &pos, const QImage &image) |
virtual void | drawTiledPixmap (const QRectF &r, const QPixmap &pixmap, const QPointF &s) override |
Reimplement this function to draw the pixmap in the given rect, starting at the given p. | |
virtual void | drawPixmapFragments (const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QFlags< QPainter::PixmapFragmentHint > hints) |
virtual void | updateState (const QPaintEngineState &state) override |
Reimplement this function to update the state of a paint engine. | |
virtual void | drawStaticTextItem (QStaticTextItem *) |
virtual void | setState (QPainterState *s) |
QPainterState * | state () |
const QPainterState * | state () const |
virtual void | sync () |
virtual void | beginNativePainting () |
virtual void | endNativePainting () |
virtual uint | flags () const |
virtual bool | requiresPretransformedGlyphPositions (QFontEngine *fontEngine, const QTransform &m) const |
virtual bool | shouldDrawCachedGlyphs (QFontEngine *fontEngine, const QTransform &m) const |
![]() | |
QPaintEngine (PaintEngineFeatures features=PaintEngineFeatures()) | |
Creates a paint engine with the featureset specified by caps. | |
virtual | ~QPaintEngine () |
Destroys the paint engine. | |
bool | isActive () const |
Returns true if the paint engine is actively drawing; otherwise returns false . | |
void | setActive (bool newState) |
Sets the active state of the paint engine to state. | |
virtual bool | begin (QPaintDevice *pdev)=0 |
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. | |
virtual bool | end ()=0 |
Reimplement this function to finish painting on the current paint device. | |
virtual void | updateState (const QPaintEngineState &state)=0 |
Reimplement this function to update the state of a paint engine. | |
virtual void | drawRects (const QRect *rects, int rectCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function. | |
virtual void | drawRects (const QRectF *rects, int rectCount) |
Draws the first rectCount rectangles in the buffer rects. | |
virtual void | drawLines (const QLine *lines, int lineCount) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first lineCount lines in lines to a QLineF and calls the floating point version of this function. | |
virtual void | drawLines (const QLineF *lines, int lineCount) |
The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine. | |
virtual void | drawEllipse (const QRectF &r) |
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. | |
virtual void | drawEllipse (const QRect &r) |
The default implementation of this function calls the floating point version of this function. | |
virtual void | drawPath (const QPainterPath &path) |
The default implementation ignores the path and does nothing. | |
virtual void | drawPoints (const QPointF *points, int pointCount) |
Draws the first pointCount points in the buffer points. | |
virtual void | drawPoints (const QPoint *points, int pointCount) |
Draws the first pointCount points in the buffer points. | |
virtual void | drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode) |
Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. | |
virtual void | drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. | |
virtual void | drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr)=0 |
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r. | |
virtual void | drawTextItem (const QPointF &p, const QTextItem &textItem) |
This function draws the text item textItem at position p. | |
virtual void | drawTiledPixmap (const QRectF &r, const QPixmap &pixmap, const QPointF &s) |
Reimplement this function to draw the pixmap in the given rect, starting at the given p. | |
virtual void | drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) |
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap. | |
void | setPaintDevice (QPaintDevice *device) |
QPaintDevice * | paintDevice () const |
Returns the device that this engine is painting on, if painting is active; otherwise returns \nullptr. | |
void | setSystemClip (const QRegion &baseClip) |
QRegion | systemClip () const |
void | setSystemRect (const QRect &rect) |
QRect | systemRect () const |
virtual QPoint | coordinateOffset () const |
virtual Type | type () const =0 |
Reimplement this function to return the paint engine \l{Type}. | |
void | fix_neg_rect (int *x, int *y, int *w, int *h) |
bool | testDirty (DirtyFlags df) |
void | setDirty (DirtyFlags df) |
void | clearDirty (DirtyFlags df) |
bool | hasFeature (PaintEngineFeatures feature) const |
Returns true if the paint engine supports the specified feature; otherwise returns false . | |
QPainter * | painter () const |
Returns the paint engine's painter. | |
void | syncState () |
bool | isExtended () const |
virtual QPixmap | createPixmap (QSize size) |
virtual QPixmap | createPixmapFromImage (QImage image, Qt::ImageConversionFlags flags=Qt::AutoColor) |
Friends | |
class | QWindowsDirect2DPaintEngineSuspenderImpl |
class | QWindowsDirect2DPaintEngineSuspenderPrivate |
Additional Inherited Members | |
![]() | |
QPaintEngineEx (QPaintEngineExPrivate &data) | |
![]() | |
QPaintEngine (QPaintEnginePrivate &data, PaintEngineFeatures devcaps=PaintEngineFeatures()) | |
![]() | |
QPaintEngineState * | state |
PaintEngineFeatures | gccaps |
uint | active: 1 |
uint | selfDestruct: 1 |
uint | extended: 1 |
QScopedPointer< QPaintEnginePrivate > | d_ptr |
Definition at line 17 of file qwindowsdirect2dpaintengine.h.
Enumerator | |
---|---|
NoFlag | |
TranslucentTopLevelWindow | |
EmulateComposition |
Definition at line 23 of file qwindowsdirect2dpaintengine.h.
QWindowsDirect2DPaintEngine::QWindowsDirect2DPaintEngine | ( | QWindowsDirect2DBitmap * | bitmap, |
Flags | flags | ||
) |
Definition at line 1030 of file qwindowsdirect2dpaintengine.cpp.
References QPaintEngine::BlendModes, QPaintEngine::gccaps, QPaintEngine::PerspectiveTransform, QPaintEngine::PorterDuff, and QPaintEngine::RasterOpModes.
|
overridevirtual |
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev.
Return true if the initialization was successful; otherwise return false.
Implements QPaintEngine.
Definition at line 1049 of file qwindowsdirect2dpaintengine.cpp.
References QRegion::boundingRect(), clip(), d, D2D_TAG, D2DDebugDrawInitialStateTag, QPaintDevice::height(), qtVectorPathForPath(), QPaintEngine::setActive(), SimpleSystemClip, QPaintEngine::systemClip(), to_d2d_rect_f(), and QPaintDevice::width().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1217 of file qwindowsdirect2dpaintengine.cpp.
References d, and QPaintEngineEx::state().
Referenced by setState().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1223 of file qwindowsdirect2dpaintengine.cpp.
References d, and QPaintEngineEx::state().
Referenced by setState().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1199 of file qwindowsdirect2dpaintengine.cpp.
References d.
Referenced by begin().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1205 of file qwindowsdirect2dpaintengine.cpp.
References d, and QPaintEngineEx::state().
Referenced by setState().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1235 of file qwindowsdirect2dpaintengine.cpp.
References d, and QPaintEngineEx::state().
Referenced by setState().
|
overridevirtual |
Reimplemented from QPaintEngineEx.
Definition at line 1134 of file qwindowsdirect2dpaintengine.cpp.
References QPainterState::brush, fill(), Qt::NoBrush, Qt::NoPen, QPainterState::pen, qbrush_style(), qpen_brush(), qpen_style(), QPaintEngineEx::state(), QPaintEngineEx::stroke(), and stroke().
The default implementation of this function calls the floating point version of this function.
Reimplemented from QPaintEngineEx.
Definition at line 1376 of file qwindowsdirect2dpaintengine.cpp.
References d, D2D_TAG, D2DDebugDrawEllipseTag, QPaintEngineEx::drawEllipse(), ellipse, and to_d2d_point_2f().
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
The default implementation calls drawPolygon().
Reimplemented from QPaintEngineEx.
Definition at line 1346 of file qwindowsdirect2dpaintengine.cpp.
References d, D2D_TAG, D2DDebugDrawEllipseFTag, QPaintEngineEx::drawEllipse(), ellipse, and to_d2d_point_2f().
|
overridevirtual |
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap.
Implements QPaintEngineEx.
Definition at line 1406 of file qwindowsdirect2dpaintengine.cpp.
References D2D_TAG, D2DDebugDrawImageTag, drawPixmap(), QPixmap::fromImage(), and pixmap.
Referenced by drawPixmap(), and end().
|
overridevirtual |
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
Implements QPaintEngineEx.
Definition at line 1416 of file qwindowsdirect2dpaintengine.cpp.
References QWindowsDirect2DBitmap::bitmap(), QPlatformPixmap::BitmapType, QPixmap::copy(), d, D2D_TAG, D2DDebugDrawPixmapTag, drawImage(), EmulateComposition, QTransform::fromTranslate(), QPixmap::handle(), QRectF::height(), i, QPixmap::isNull(), QRectF::isValid(), QPlatformPixmap::pixelType(), qRgba(), qWarning, QVectorPath::RectangleHint, QWindowsDirect2DBitmap::resize(), QPaintEngineEx::state(), to_d2d_rect_f(), to_d2d_rect_u(), QPixmap::toImage(), QRectF::toRect(), and QRectF::width().
Referenced by drawImage().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function.
Reimplemented from QPaintEngineEx.
Definition at line 1271 of file qwindowsdirect2dpaintengine.cpp.
References d, D2D_TAG, D2DDebugDrawRectsTag, QPaintEngineEx::drawRects(), i, QRect::normalized(), rect, and to_d2d_rect_f().
Draws the first rectCount rectangles in the buffer rects.
The default implementation of this function calls drawPath() or drawPolygon() depending on the feature set of the paint engine.
Reimplemented from QPaintEngineEx.
Definition at line 1299 of file qwindowsdirect2dpaintengine.cpp.
References d, D2D_TAG, D2DDebugDrawRectFsTag, QPaintEngineEx::drawRects(), i, QRectF::normalized(), rect, and to_d2d_rect_f().
|
overridevirtual |
Reimplemented from QPaintEngineEx.
Definition at line 1508 of file qwindowsdirect2dpaintengine.cpp.
References QVarLengthArray< T, Prealloc >::constData(), d, D2D_TAG, D2DDebugDrawStaticTextItemTag, QPaintEngineEx::drawStaticTextItem(), QFontEngine::fontDef, QStaticTextItem::fontEngine(), QStaticTextItem::glyphPositions, QStaticTextItem::glyphs, i, QStaticTextItem::numGlyphs, qWarning, QFixed::toReal(), QFixedPoint::x, and QFixedPoint::y.
|
overridevirtual |
This function draws the text item textItem at position p.
The default implementation of this function converts the text to a QPainterPath and paints the resulting path.
Reimplemented from QPaintEngine.
Definition at line 1555 of file qwindowsdirect2dpaintengine.cpp.
References QVarLengthArray< T, Prealloc >::constData(), d, D2D_TAG, D2DDebugDrawTextItemTag, QPaintEngine::drawTextItem(), i, qWarning, QTextItem::RightToLeft, and to_d2d_point_2f().
|
overridevirtual |
Reimplement this function to finish painting on the current paint device.
Return true if painting was finished successfully; otherwise return false.
Implements QPaintEngine.
Definition at line 1086 of file qwindowsdirect2dpaintengine.cpp.
References d, drawImage(), EmulateComposition, and SimpleSystemClip.
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1153 of file qwindowsdirect2dpaintengine.cpp.
References d, D2D_TAG, D2DDebugFillTag, and qWarning.
Referenced by draw().
|
overridevirtual |
Reimplemented from QPaintEngineEx.
Definition at line 1253 of file qwindowsdirect2dpaintengine.cpp.
References d, D2D_TAG, D2DDebugFillRectTag, QPaintEngineEx::fillRect(), rect, and to_d2d_rect_f().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1229 of file qwindowsdirect2dpaintengine.cpp.
References d, and QPaintEngineEx::state().
Referenced by setState().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1211 of file qwindowsdirect2dpaintengine.cpp.
References d, and QPaintEngineEx::state().
Referenced by setState().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1241 of file qwindowsdirect2dpaintengine.cpp.
References d.
Referenced by setState().
|
overridevirtual |
Reimplemented from QPaintEngineEx.
Definition at line 1117 of file qwindowsdirect2dpaintengine.cpp.
References brushChanged(), brushOriginChanged(), clipEnabledChanged(), compositionModeChanged(), d, opacityChanged(), penChanged(), renderHintsChanged(), QPaintEngineEx::setState(), and transformChanged().
|
overridevirtual |
Reimplemented from QPaintEngineEx.
Definition at line 1179 of file qwindowsdirect2dpaintengine.cpp.
References d, D2D_TAG, D2DDebugFillTag, and QPaintEngineEx::stroke().
Referenced by draw().
|
overridevirtual |
Implements QPaintEngineEx.
Definition at line 1247 of file qwindowsdirect2dpaintengine.cpp.
References d, and QPaintEngineEx::state().
Referenced by setState().
|
overridevirtual |
Reimplement this function to return the paint engine \l{Type}.
Implements QPaintEngine.
Definition at line 1112 of file qwindowsdirect2dpaintengine.cpp.
References QPaintEngine::Direct2D.
|
friend |
Definition at line 20 of file qwindowsdirect2dpaintengine.h.
|
friend |
Definition at line 21 of file qwindowsdirect2dpaintengine.h.