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
QOpenGL2PaintEngineEx Class Reference

#include <qopenglpaintengine_p.h>

Inheritance diagram for QOpenGL2PaintEngineEx:
Collaboration diagram for QOpenGL2PaintEngineEx:

Public Member Functions

 QOpenGL2PaintEngineEx ()
 ~QOpenGL2PaintEngineEx ()
bool begin (QPaintDevice *device) override
 Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev.
void ensureActive ()
bool end () override
 Reimplement this function to finish painting on the current paint device.
virtual void clipEnabledChanged () override
virtual void penChanged () override
virtual void brushChanged () override
virtual void brushOriginChanged () override
virtual void opacityChanged () override
virtual void compositionModeChanged () override
virtual void renderHintsChanged () override
virtual void transformChanged () override
virtual 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.
virtual void drawPixmapFragments (const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::PixmapFragmentHints hints) override
virtual void drawImage (const QRectF &r, const QImage &pm, 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.
virtual void drawTextItem (const QPointF &p, const QTextItem &textItem) override
 This function draws the text item textItem at position p.
virtual void fill (const QVectorPath &path, const QBrush &brush) override
virtual void stroke (const QVectorPath &path, const QPen &pen) override
virtual void clip (const QVectorPath &path, Qt::ClipOperation op) override
virtual void drawStaticTextItem (QStaticTextItem *textItem) override
bool drawTexture (const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr)
Type type () const override
 Reimplement this function to return the paint engine \l{Type}.
virtual void setState (QPainterState *s) override
virtual QPainterStatecreateState (QPainterState *orig) const override
QOpenGL2PaintEngineStatestate ()
const QOpenGL2PaintEngineStatestate () const
void beginNativePainting () override
void endNativePainting () override
void invalidateState ()
void setRenderTextActive (bool)
bool isNativePaintingActive () const
bool requiresPretransformedGlyphPositions (QFontEngine *, const QTransform &) const override
bool shouldDrawCachedGlyphs (QFontEngine *, const QTransform &) const override
Public Member Functions inherited from QPaintEngineEx
 QPaintEngineEx ()
virtual void draw (const QVectorPath &path)
virtual void clip (const QRect &rect, Qt::ClipOperation op)
virtual void clip (const QRegion &region, Qt::ClipOperation op)
virtual void clip (const QPainterPath &path, Qt::ClipOperation op)
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
 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 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 QPointF &pos, const QPixmap &pm)
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.
QPainterStatestate ()
const QPainterStatestate () const
virtual void sync ()
virtual uint flags () const
Public Member Functions inherited from QPaintEngine
 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.
void setPaintDevice (QPaintDevice *device)
QPaintDevicepaintDevice () 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
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.
QPainterpainter () 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 QOpenGLEngineShaderManager

Additional Inherited Members

Public Types inherited from QPaintEngineEx
enum  Flags { DoNotEmulate = 0x01 , IsEmulationEngine = 0x02 }
Public Types inherited from QPaintEngine
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...
Protected Member Functions inherited from QPaintEngineEx
 QPaintEngineEx (QPaintEngineExPrivate &data)
Protected Member Functions inherited from QPaintEngine
 QPaintEngine (QPaintEnginePrivate &data, PaintEngineFeatures devcaps=PaintEngineFeatures())
Protected Attributes inherited from QPaintEngine
QPaintEngineStatestate
PaintEngineFeatures gccaps
uint active: 1
uint selfDestruct: 1
uint extended: 1
QScopedPointer< QPaintEnginePrivated_ptr

Detailed Description

Definition at line 73 of file qopenglpaintengine_p.h.

Constructor & Destructor Documentation

◆ QOpenGL2PaintEngineEx()

QOpenGL2PaintEngineEx::QOpenGL2PaintEngineEx ( )

Definition at line 1331 of file qopenglpaintengine.cpp.

◆ ~QOpenGL2PaintEngineEx()

QOpenGL2PaintEngineEx::~QOpenGL2PaintEngineEx ( )

Definition at line 1337 of file qopenglpaintengine.cpp.

Member Function Documentation

◆ begin()

bool QOpenGL2PaintEngineEx::begin ( QPaintDevice * pdev)
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.

See also
end(), isActive()

Implements QPaintEngine.

Definition at line 2179 of file qopenglpaintengine.cpp.

◆ beginNativePainting()

void QOpenGL2PaintEngineEx::beginNativePainting ( )
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 665 of file qopenglpaintengine.cpp.

◆ brushChanged()

void QOpenGL2PaintEngineEx::brushChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1450 of file qopenglpaintengine.cpp.

◆ brushOriginChanged()

void QOpenGL2PaintEngineEx::brushOriginChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1452 of file qopenglpaintengine.cpp.

◆ clip()

void QOpenGL2PaintEngineEx::clip ( const QVectorPath & path,
Qt::ClipOperation op )
overridevirtual

Implements QPaintEngineEx.

Definition at line 2503 of file qopenglpaintengine.cpp.

◆ clipEnabledChanged()

void QOpenGL2PaintEngineEx::clipEnabledChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 2405 of file qopenglpaintengine.cpp.

◆ compositionModeChanged()

void QOpenGL2PaintEngineEx::compositionModeChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1469 of file qopenglpaintengine.cpp.

◆ createState()

QPainterState * QOpenGL2PaintEngineEx::createState ( QPainterState * orig) const
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 2663 of file qopenglpaintengine.cpp.

◆ drawImage()

void QOpenGL2PaintEngineEx::drawImage ( const QRectF & r,
const QImage & pm,
const QRectF & sr,
Qt::ImageConversionFlags flags = Qt::AutoColor )
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 1551 of file qopenglpaintengine.cpp.

◆ drawPixmap()

void QOpenGL2PaintEngineEx::drawPixmap ( const QRectF & r,
const QPixmap & pm,
const QRectF & sr )
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 1515 of file qopenglpaintengine.cpp.

◆ drawPixmapFragments()

QT_WARNING_POP void QOpenGL2PaintEngineEx::drawPixmapFragments ( const QPainter::PixmapFragment * fragments,
int fragmentCount,
const QPixmap & pixmap,
QPainter::PixmapFragmentHints hints )
overridevirtual

Definition at line 2077 of file qopenglpaintengine.cpp.

◆ drawStaticTextItem()

void QOpenGL2PaintEngineEx::drawStaticTextItem ( QStaticTextItem * textItem)
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 1609 of file qopenglpaintengine.cpp.

◆ drawTextItem()

void QOpenGL2PaintEngineEx::drawTextItem ( const QPointF & p,
const QTextItem & textItem )
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 1656 of file qopenglpaintengine.cpp.

◆ drawTexture()

bool QOpenGL2PaintEngineEx::drawTexture ( const QRectF & r,
GLuint textureId,
const QSize & size,
const QRectF & sr )

Definition at line 1636 of file qopenglpaintengine.cpp.

◆ end()

bool QOpenGL2PaintEngineEx::end ( )
overridevirtual

Reimplement this function to finish painting on the current paint device.

Return true if painting was finished successfully; otherwise return false.

See also
begin(), isActive()

Implements QPaintEngine.

Definition at line 2291 of file qopenglpaintengine.cpp.

◆ endNativePainting()

void QOpenGL2PaintEngineEx::endNativePainting ( )
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 755 of file qopenglpaintengine.cpp.

◆ ensureActive()

void QOpenGL2PaintEngineEx::ensureActive ( )

Definition at line 2323 of file qopenglpaintengine.cpp.

◆ fill()

void QOpenGL2PaintEngineEx::fill ( const QVectorPath & path,
const QBrush & brush )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1341 of file qopenglpaintengine.cpp.

◆ invalidateState()

void QOpenGL2PaintEngineEx::invalidateState ( )

Definition at line 762 of file qopenglpaintengine.cpp.

◆ isNativePaintingActive()

bool QOpenGL2PaintEngineEx::isNativePaintingActive ( ) const

Definition at line 768 of file qopenglpaintengine.cpp.

◆ opacityChanged()

void QOpenGL2PaintEngineEx::opacityChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1458 of file qopenglpaintengine.cpp.

◆ penChanged()

void QOpenGL2PaintEngineEx::penChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1449 of file qopenglpaintengine.cpp.

◆ renderHintsChanged()

void QOpenGL2PaintEngineEx::renderHintsChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1477 of file qopenglpaintengine.cpp.

◆ requiresPretransformedGlyphPositions()

bool QOpenGL2PaintEngineEx::requiresPretransformedGlyphPositions ( QFontEngine * ,
const QTransform &  ) const
inlineoverridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 126 of file qopenglpaintengine_p.h.

◆ setRenderTextActive()

void QOpenGL2PaintEngineEx::setRenderTextActive ( bool )

◆ setState()

void QOpenGL2PaintEngineEx::setState ( QPainterState * s)
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 2620 of file qopenglpaintengine.cpp.

◆ shouldDrawCachedGlyphs()

bool QOpenGL2PaintEngineEx::shouldDrawCachedGlyphs ( QFontEngine * fontEngine,
const QTransform & t ) const
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 1726 of file qopenglpaintengine.cpp.

◆ state() [1/2]

QOpenGL2PaintEngineState * QOpenGL2PaintEngineEx::state ( )
inline

Definition at line 111 of file qopenglpaintengine_p.h.

◆ state() [2/2]

const QOpenGL2PaintEngineState * QOpenGL2PaintEngineEx::state ( ) const
inline

Definition at line 114 of file qopenglpaintengine_p.h.

◆ stroke()

void QOpenGL2PaintEngineEx::stroke ( const QVectorPath & path,
const QPen & pen )
overridevirtual

Reimplemented from QPaintEngineEx.

Definition at line 1355 of file qopenglpaintengine.cpp.

◆ transformChanged()

void QOpenGL2PaintEngineEx::transformChanged ( )
overridevirtual

Implements QPaintEngineEx.

Definition at line 1502 of file qopenglpaintengine.cpp.

◆ type()

Type QOpenGL2PaintEngineEx::type ( ) const
inlineoverridevirtual

Reimplement this function to return the paint engine \l{Type}.

Implements QPaintEngine.

Definition at line 107 of file qopenglpaintengine_p.h.

◆ QOpenGLEngineShaderManager

friend class QOpenGLEngineShaderManager
friend

Definition at line 132 of file qopenglpaintengine_p.h.


The documentation for this class was generated from the following files: