Qt 4.8
Public Functions | List of all members
QPaintEngineExReplayer Class Reference

#include <qpaintbuffer_p.h>

Inheritance diagram for QPaintEngineExReplayer:
QPainterReplayer

Public Functions

virtual void process (const QPaintBufferCommand &cmd)
 
 QPaintEngineExReplayer ()
 
- Public Functions inherited from QPainterReplayer
void processCommands (const QPaintBuffer &buffer, QPainter *painter, int begin, int end)
 
 QPainterReplayer ()
 
void setupTransform (QPainter *painter)
 
virtual ~QPainterReplayer ()
 

Additional Inherited Members

- Protected Variables inherited from QPainterReplayer
QPaintBufferPrivated
 
QTransform m_world_matrix
 
QPainterpainter
 

Detailed Description

Definition at line 337 of file qpaintbuffer_p.h.

Constructors and Destructors

◆ QPaintEngineExReplayer()

QPaintEngineExReplayer::QPaintEngineExReplayer ( )
inline

Definition at line 340 of file qpaintbuffer_p.h.

340 { }

Functions

◆ process()

void QPaintEngineExReplayer::process ( const QPaintBufferCommand cmd)
virtual

Reimplemented from QPainterReplayer.

Definition at line 1847 of file qpaintbuffer.cpp.

1848 {
1850  QPaintEngineEx *xengine = static_cast<QPaintEngineEx *>(painter->paintEngine());
1851 
1852  switch (cmd.id) {
1854 #ifdef QPAINTBUFFER_DEBUG_DRAW
1855  qDebug() << " -> ExCmd_SetBrushOrigin: " << d->variants.at(cmd.offset).toPointF();
1856 #endif
1857  xengine->state()->brushOrigin = d->variants.at(cmd.offset).toPointF();
1858  xengine->brushOriginChanged();
1859  break; }
1860 
1863 #ifdef QPAINTBUFFER_DEBUG_DRAW
1864  qDebug() << " -> ExCmd_SetCompositionMode, mode: " << mode;
1865 #endif
1866  xengine->state()->composition_mode = mode;
1867  xengine->compositionModeChanged();
1868  break; }
1869 
1871 #ifdef QPAINTBUFFER_DEBUG_DRAW
1872  qDebug() << " -> ExCmd_SetOpacity: " << d->variants.at(cmd.offset).toDouble();
1873 #endif
1874  xengine->state()->opacity = d->variants.at(cmd.offset).toDouble();
1875  xengine->opacityChanged();
1876  break; }
1877 
1879 #ifdef QPAINTBUFFER_DEBUG_DRAW
1880  qDebug() << " -> ExCmd_DrawVectorPath: size: " << cmd.size
1881 // << ", hints:" << d->ints[cmd.offset2+cmd.size]
1882  << "pts/elms:" << cmd.offset << cmd.offset2;
1883 #endif
1884  QVectorPathCmd path(d, cmd);
1885  xengine->draw(path());
1886  break; }
1887 
1889  QPen pen = qvariant_cast<QPen>(d->variants.at(cmd.extra));
1890 #ifdef QPAINTBUFFER_DEBUG_DRAW
1891  qDebug() << " -> ExCmd_StrokeVectorPath: size: " << cmd.size
1892 // << ", hints:" << d->ints[cmd.offset2+cmd.size]
1893  << "pts/elms:" << cmd.offset << cmd.offset2;
1894 #endif
1895  QVectorPathCmd path(d, cmd);
1896  xengine->stroke(path(), pen);
1897  break; }
1898 
1900  QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
1901 #ifdef QPAINTBUFFER_DEBUG_DRAW
1902  qDebug() << " -> ExCmd_FillVectorPath: size: " << cmd.size
1903 // << ", hints:" << d->ints[cmd.offset2+cmd.size]
1904  << "pts/elms:" << cmd.offset << cmd.offset2 << brush;
1905 #endif
1906  QVectorPathCmd path(d, cmd);
1907  xengine->fill(path(), brush);
1908  break; }
1909 
1911  QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
1912  QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
1913 #ifdef QPAINTBUFFER_DEBUG_DRAW
1914  qDebug() << " -> ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " brush: " << brush;
1915 #endif
1916  xengine->fillRect(*rect, brush);
1917  break; }
1918 
1920  QColor color = qvariant_cast<QColor>(d->variants.at(cmd.extra));
1921  QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
1922 #ifdef QPAINTBUFFER_DEBUG_DRAW
1923  qDebug() << " -> ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " color: " << color;
1924 #endif
1925  xengine->fillRect(*rect, color);
1926  break; }
1927 
1929 #ifdef QPAINTBUFFER_DEBUG_DRAW
1930  qDebug() << " -> ExCmd_DrawPolygonF, offset: " << cmd.offset << " size: " << cmd.size
1931  << " mode: " << cmd.extra
1932  << d->floats.at(cmd.offset)
1933  << d->floats.at(cmd.offset+1);
1934 #endif
1935  xengine->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size,
1937  break; }
1938 
1940 #ifdef QPAINTBUFFER_DEBUG_DRAW
1941  qDebug() << " -> ExCmd_DrawPolygonI, offset: " << cmd.offset << " size: " << cmd.size
1942  << " mode: " << cmd.extra
1943  << d->ints.at(cmd.offset)
1944  << d->ints.at(cmd.offset+1);
1945 #endif
1946  xengine->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size,
1948  break; }
1949 
1951 #ifdef QPAINTBUFFER_DEBUG_DRAW
1952  qDebug() << " -> ExCmd_DrawEllipseF, offset: " << cmd.offset;
1953 #endif
1954  xengine->drawEllipse(*(QRectF *)(d->floats.constData() + cmd.offset));
1955  break; }
1956 
1958 #ifdef QPAINTBUFFER_DEBUG_DRAW
1959  qDebug() << " -> ExCmd_DrawEllipseI, offset: " << cmd.offset;
1960 #endif
1961  xengine->drawEllipse(*(QRect *)(d->ints.constData() + cmd.offset));
1962  break; }
1963 
1965 #ifdef QPAINTBUFFER_DEBUG_DRAW
1966  qDebug() << " -> ExCmd_DrawLineF, offset: " << cmd.offset << " size: " << cmd.size;
1967 #endif
1968  xengine->drawLines((QLineF *)(d->floats.constData() + cmd.offset), cmd.size);
1969  break; }
1970 
1972 #ifdef QPAINTBUFFER_DEBUG_DRAW
1973  qDebug() << " -> ExCmd_DrawLineI, offset: " << cmd.offset << " size: " << cmd.size;
1974 #endif
1975  xengine->drawLines((QLine *)(d->ints.constData() + cmd.offset), cmd.size);
1976  break; }
1977 
1979 #ifdef QPAINTBUFFER_DEBUG_DRAW
1980  qDebug() << " -> ExCmd_DrawPointsF, offset: " << cmd.offset << " size: " << cmd.size;
1981 #endif
1982  xengine->drawPoints((QPointF *)(d->floats.constData() + cmd.offset), cmd.size);
1983  break; }
1984 
1986 #ifdef QPAINTBUFFER_DEBUG_DRAW
1987  qDebug() << " -> ExCmd_DrawPointsI, offset: " << cmd.offset << " size: " << cmd.size;
1988 #endif
1989  xengine->drawPoints((QPoint *)(d->ints.constData() + cmd.offset), cmd.size);
1990  break; }
1991 
1993 #ifdef QPAINTBUFFER_DEBUG_DRAW
1994  qDebug() << " -> ExCmd_DrawPolylineF, offset: " << cmd.offset << " size: " << cmd.size;
1995 #endif
1996  xengine->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size, QPaintEngine::PolylineMode);
1997  break; }
1998 
2000 #ifdef QPAINTBUFFER_DEBUG_DRAW
2001  qDebug() << " -> ExCmd_DrawPolylineI, offset: " << cmd.offset << " size: " << cmd.size;
2002 #endif
2003  xengine->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size, QPaintEngine::PolylineMode);
2004  break; }
2005 
2007 #ifdef QPAINTBUFFER_DEBUG_DRAW
2008  qDebug() << " -> ExCmd_DrawRectF, offset: " << cmd.offset << " size: " << cmd.size;
2009 #endif
2010  xengine->drawRects((QRectF *) (d->floats.constData() + cmd.offset), cmd.size);
2011  break; }
2012 
2014 #ifdef QPAINTBUFFER_DEBUG_DRAW
2015  qDebug() << " -> ExCmd_DrawRectI, offset: " << cmd.offset << " size: " << cmd.size;
2016 #endif
2017  xengine->drawRects((QRect *) (d->ints.constData() + cmd.offset), cmd.size);
2018  break; }
2019 
2021  bool clipEnabled = d->variants.at(cmd.offset).toBool();
2022 #ifdef QPAINTBUFFER_DEBUG_DRAW
2023  qDebug() << " -> ExCmd_SetClipEnabled:" << clipEnabled;
2024 #endif
2025  xengine->state()->clipEnabled = clipEnabled;
2026  xengine->clipEnabledChanged();
2027  break; }
2028 
2030  QVectorPathCmd path(d, cmd);
2031 #ifdef QPAINTBUFFER_DEBUG_DRAW
2032  qDebug() << " -> ExCmd_ClipVectorPath:" << path().elementCount();
2033 #endif
2034  xengine->clip(path(), Qt::ClipOperation(cmd.extra));
2035  break; }
2036 
2037 
2039  QRect rect(QPoint(d->ints.at(cmd.offset), d->ints.at(cmd.offset + 1)),
2040  QPoint(d->ints.at(cmd.offset + 2), d->ints.at(cmd.offset + 3)));
2041 #ifdef QPAINTBUFFER_DEBUG_DRAW
2042  qDebug() << " -> ExCmd_ClipRect:" << rect << cmd.extra;
2043 #endif
2044  xengine->clip(rect, Qt::ClipOperation(cmd.extra));
2045  break; }
2046 
2048  QRegion region(d->variants.at(cmd.offset).value<QRegion>());
2049 #ifdef QPAINTBUFFER_DEBUG_DRAW
2050  qDebug() << " -> ExCmd_ClipRegion:" << region.boundingRect() << cmd.extra;
2051 #endif
2052  xengine->clip(region, Qt::ClipOperation(cmd.extra));
2053  break; }
2054 
2055  default:
2057  break;
2058  }
2059 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
QPointF toPointF() const
Returns the variant as a QPointF if the variant has type() Point or PointF ; otherwise returns a null...
Definition: qvariant.cpp:2509
CompositionMode
Defines the modes supported for digital image compositing.
Definition: qpainter.h:138
The QLine class provides a two-dimensional vector using integer precision.
Definition: qline.h:57
virtual void process(const QPaintBufferCommand &cmd)
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
Definition: qvariant.cpp:2691
bool isExtended() const
Returns true if the paint engine is a QPaintEngineEx derivative.
Definition: qpaintengine.h:234
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
Q_CORE_EXPORT void qDebug(const char *,...)
QVector< int > ints
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
Definition: qpainter.cpp:1991
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
QPaintBufferPrivate * d
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
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
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
double toDouble(bool *ok=0) const
Returns the variant as a double if the variant has type() Double , QMetaType::Float ...
Definition: qvariant.cpp:2710
QPainter * painter
const T * constData() const
Returns a const pointer to the data stored in the vector.
Definition: qvector.h:154
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
QVector< QVariant > variants
QVector< qreal > floats
ClipOperation
Definition: qnamespace.h:1495

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