Qt 4.8
Public Functions | Public Variables | List of all members
QOnScreenRasterPaintEngine Class Reference
Inheritance diagram for QOnScreenRasterPaintEngine:
QRasterPaintEngine QPaintEngineEx QPaintEngine

Public Functions

bool begin (QPaintDevice *)
 Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. More...
 
QPoint coordinateOffset () const
 Returns the offset from the painters origo to the engines origo. More...
 
bool end ()
 Reimplement this function to finish painting on the current paint device. More...
 
 QOnScreenRasterPaintEngine ()
 
- Public Functions inherited from QRasterPaintEngine
void alphaPenBlt (const void *src, int bpl, int depth, int rx, int ry, int w, int h)
 
bool begin (QPaintDevice *device)
 Reimplemented Function More...
 
void brushChanged ()
 
void brushOriginChanged ()
 
void clip (const QVectorPath &path, Qt::ClipOperation op)
 
void clip (const QRect &rect, Qt::ClipOperation op)
 
void clip (const QRegion &region, Qt::ClipOperation op)
 
QRect clipBoundingRect () const
 Returns the bounding rect of the currently set clip. More...
 
void clipEnabledChanged ()
 
ClipType clipType () const
 Returns the type of the clip currently set. More...
 
void compositionModeChanged ()
 
QPoint coordinateOffset () const
 
QPainterStatecreateState (QPainterState *orig) const
 
virtual void drawBufferSpan (const uint *buffer, int bufsize, int x, int y, int length, uint const_alpha)
 Draws the given buffer. More...
 
virtual void drawColorSpans (const QSpan *spans, int count, uint color)
 Draws the given color spans with the specified color. More...
 
void drawEllipse (const QRectF &rect)
 Reimplemented Function More...
 
void drawImage (const QPointF &p, const QImage &img)
 
void drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags falgs=Qt::AutoColor)
 Reimplemented Function More...
 
void drawLines (const QLine *line, int lineCount)
 Reimplemented Function More...
 
void drawLines (const QLineF *line, int lineCount)
 Reimplemented Function More...
 
void drawPixmap (const QPointF &p, const QPixmap &pm)
 
void drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr)
 Reimplemented Function More...
 
void drawPoints (const QPointF *points, int pointCount)
 Reimplemented Function More...
 
void drawPoints (const QPoint *points, int pointCount)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Draws the first pointCount points in the buffer points. More...
 
void drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode)
 Reimplemented Function More...
 
void drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode)
 Reimplemented Function More...
 
void drawRects (const QRect *rects, int rectCount)
 Reimplemented Function More...
 
void drawRects (const QRectF *rects, int rectCount)
 Reimplemented Function More...
 
void drawStaticTextItem (QStaticTextItem *textItem)
 Reimplemented Function More...
 
void drawTextItem (const QPointF &p, const QTextItem &textItem)
 Reimplemented Function More...
 
void drawTiledPixmap (const QRectF &r, const QPixmap &pm, const QPointF &sr)
 Reimplemented Function More...
 
bool end ()
 Reimplemented Function More...
 
void fill (const QVectorPath &path, const QBrush &brush)
 
void fillPath (const QPainterPath &path, QSpanData *fillData)
 
void fillPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode)
 
void fillRect (const QRectF &rect, const QBrush &brush)
 Reimplemented Function More...
 
void fillRect (const QRectF &rect, const QColor &color)
 Reimplemented Function More...
 
CGContextRef getCGContext () const
 
HDC getDC () const
 
void opacityChanged ()
 
void penChanged ()
 
 QRasterPaintEngine (QPaintDevice *device)
 Creates a raster based paint engine for operating on the given device, with the complete set of QPaintEngine::PaintEngineFeature {paint engine features and capabilities}. More...
 
void releaseBuffer ()
 
void releaseDC (HDC hdc) const
 
void renderHintsChanged ()
 
void saveBuffer (const QString &s) const
 
void setCGContext (CGContextRef ref)
 
void setDC (HDC hdc)
 
void setState (QPainterState *s)
 
QSize size () const
 
QRasterPaintEngineStatestate ()
 
const QRasterPaintEngineStatestate () const
 
void stroke (const QVectorPath &path, const QPen &pen)
 
bool supportsTransformations (const QFontEngine *fontEngine) const
 
bool supportsTransformations (qreal pixelSize, const QTransform &m) const
 
void transformChanged ()
 
Type type () const
 Reimplemented Function More...
 
void updateBrush (const QBrush &brush)
 
void updateMatrix (const QTransform &matrix)
 
void updatePen (const QPen &pen)
 
 ~QRasterPaintEngine ()
 Destroys this paint engine. More...
 
- Public Functions inherited from QPaintEngineEx
virtual void beginNativePainting ()
 
virtual void clip (const QPainterPath &path, Qt::ClipOperation op)
 
virtual void draw (const QVectorPath &path)
 
virtual void drawEllipse (const QRect &r)
 The default implementation of this function calls the floating point version of this function. More...
 
virtual void drawPath (const QPainterPath &path)
 The default implementation ignores the path and does nothing. More...
 
virtual void drawPixmapFragments (const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::PixmapFragmentHints hints)
 
virtual void drawPixmapFragments (const QRectF *targetRects, const QRectF *sourceRects, int fragmentCount, const QPixmap &pixmap, QPainter::PixmapFragmentHints hints)
 
virtual void drawRoundedRect (const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode)
 
virtual void endNativePainting ()
 
virtual uint flags () const
 
virtual QPixmapFilterpixmapFilter (int, const QPixmapFilter *)
 
 QPaintEngineEx ()
 
QPainterStatestate ()
 
const QPainterStatestate () const
 
virtual void sync ()
 
virtual void updateState (const QPaintEngineState &state)
 Reimplement this function to update the state of a paint engine. More...
 
- Public Functions inherited from QPaintEngine
void clearDirty (DirtyFlags df)
 
void fix_neg_rect (int *x, int *y, int *w, int *h)
 
bool hasFeature (PaintEngineFeatures feature) const
 Returns true if the paint engine supports the specified feature; otherwise returns false. More...
 
bool isActive () const
 Returns true if the paint engine is actively drawing; otherwise returns false. More...
 
bool isExtended () const
 Returns true if the paint engine is a QPaintEngineEx derivative. More...
 
QPaintDevicepaintDevice () const
 Returns the device that this engine is painting on, if painting is active; otherwise returns 0. More...
 
QPainterpainter () const
 Returns the paint engine's painter. More...
 
 QPaintEngine (PaintEngineFeatures features=0)
 Creates a paint engine with the featureset specified by caps. More...
 
void setActive (bool newState)
 Sets the active state of the paint engine to state. More...
 
void setDirty (DirtyFlags df)
 
void setPaintDevice (QPaintDevice *device)
 
void setSystemClip (const QRegion &baseClip)
 Sets the system clip for this engine. More...
 
void setSystemRect (const QRect &rect)
 Sets the target rect for drawing within the backing store. More...
 
void syncState ()
 Updates all dirty states in this engine. More...
 
QRegion systemClip () const
 Returns the system clip. More...
 
QRect systemRect () const
 Retrieves the rect for drawing within the backing store. More...
 
bool testDirty (DirtyFlags df)
 
virtual ~QPaintEngine ()
 Destroys the paint engine. More...
 

Public Variables

QImagedevice
 
QRegion originalSystemClip
 
const QWidgetwidget
 

Additional Inherited Members

- Public Types inherited from QRasterPaintEngine
enum  ClipType { RectClip, ComplexClip }
 
- Public Types inherited from QPaintEngineEx
enum  Flags { DoNotEmulate = 0x01, IsEmulationEngine = 0x02 }
 
- Public Types inherited from QPaintEngine
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
}
 QPaintEngine::updateState(). More...
 
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  PolygonDrawMode { OddEvenMode, WindingMode, ConvexMode, PolylineMode }
 
enum  Type {
  X11, Windows, QuickDraw, CoreGraphics,
  MacPrinter, QWindowSystem, PostScript, OpenGL,
  Picture, SVG, Raster, Direct3D,
  Pdf, OpenVG, OpenGL2, PaintBuffer,
  Blitter, User = 50, MaxUser = 100
}
 
- Protected Functions inherited from QRasterPaintEngine
 QRasterPaintEngine (QRasterPaintEnginePrivate &d, QPaintDevice *)
 
- Protected Functions inherited from QPaintEngineEx
 QPaintEngineEx (QPaintEngineExPrivate &data)
 
- Protected Functions inherited from QPaintEngine
 QPaintEngine (QPaintEnginePrivate &data, PaintEngineFeatures devcaps=0)
 
- Protected Variables inherited from QPaintEngine
uint active: 1
 
QScopedPointer< QPaintEnginePrivated_ptr
 
uint extended: 1
 
PaintEngineFeatures gccaps
 
uint selfDestruct: 1
 
QPaintEngineStatestate
 

Detailed Description

Definition at line 2011 of file qwidget_win.cpp.

Constructors and Destructors

◆ QOnScreenRasterPaintEngine()

QOnScreenRasterPaintEngine::QOnScreenRasterPaintEngine ( )
inline

Definition at line 2016 of file qwidget_win.cpp.

2018  QApplication::desktop()->width(),
2019  QApplication::desktop()->height(),
2022  {
2023  device = static_cast<QImage *>(d_func()->device);
2024  }
static uchar * qt_primary_surface_bits
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static int qt_primary_surface_stride
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
QRasterPaintEngine(QPaintDevice *device)
Creates a raster based paint engine for operating on the given device, with the complete set of QPain...
static QImage::Format qt_primary_surface_format

Functions

◆ begin()

bool QOnScreenRasterPaintEngine::begin ( QPaintDevice pdev)
inlinevirtual

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 2026 of file qwidget_win.cpp.

2027  {
2028  QRegion clip = systemClip();
2030  clip.translate(widget->mapToGlobal(QPoint(0, 0)));
2031  setSystemClip(clip);
2032 
2033  QRect bounds = clip.boundingRect();
2034  DDSURFACEDESC surface;
2035  surface.dwSize = sizeof(DDSURFACEDESC);
2036  HRESULT res = qt_ddraw_primary->Lock((RECT *) &bounds, &surface, DDLOCK_WAIT, 0);
2037  if (res != DD_OK) {
2038  qWarning("QWidget painting: locking onscreen bits failed: %d\n", res);
2039  return false;
2040  }
2041 
2042  if (surface.lpSurface == qt_primary_surface_bits) {
2043  qt_primary_surface_bits = (uchar *) surface.lpSurface;
2045  }
2046 
2048  }
static uchar * qt_primary_surface_bits
bool begin(QPaintDevice *device)
Reimplemented Function
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
static IDirectDrawSurface * qt_ddraw_primary
Definition: qwidget_win.cpp:87
unsigned char uchar
Definition: qglobal.h:994
Q_CORE_EXPORT void qWarning(const char *,...)
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
void clip(const QVectorPath &path, Qt::ClipOperation op)
void setSystemClip(const QRegion &baseClip)
Sets the system clip for this engine.
DataPtr & data_ptr()
Definition: qimage.h:346
long HRESULT
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
uchar * data
Definition: qimage_p.h:81
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
Definition: qregion.cpp:4116
QRegion systemClip() const
Returns the system clip.
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.

◆ coordinateOffset()

QPoint QOnScreenRasterPaintEngine::coordinateOffset ( ) const
inlinevirtual

Returns the offset from the painters origo to the engines origo.

Warning
This function is not part of the public interface.

This value is used by QPainter for engines who have internal double buffering.

This function only makes sense when the engine is active.

Reimplemented from QPaintEngine.

Definition at line 2060 of file qwidget_win.cpp.

2060  {
2061  return -widget->mapToGlobal(QPoint(0, 0));
2062  }
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.

◆ end()

bool QOnScreenRasterPaintEngine::end ( )
inlinevirtual

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 2050 of file qwidget_win.cpp.

2051  {
2052  HRESULT res = qt_ddraw_primary->Unlock(0);
2053  if (res != DD_OK)
2054  qWarning("QWidget::paint, failed to unlock DirectDraw surface: %d", res);
2055  bool ok = QRasterPaintEngine::end();
2057  return ok;
2058  }
static IDirectDrawSurface * qt_ddraw_primary
Definition: qwidget_win.cpp:87
bool end()
Reimplemented Function
Q_CORE_EXPORT void qWarning(const char *,...)
void setSystemClip(const QRegion &baseClip)
Sets the system clip for this engine.
long HRESULT

Properties

◆ device

QImage* QOnScreenRasterPaintEngine::device

Definition at line 2065 of file qwidget_win.cpp.

◆ originalSystemClip

QRegion QOnScreenRasterPaintEngine::originalSystemClip

Definition at line 2066 of file qwidget_win.cpp.

◆ widget

const QWidget* QOnScreenRasterPaintEngine::widget

Definition at line 2064 of file qwidget_win.cpp.


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