Qt 4.8
Public Functions | Private Functions | List of all members
QBlitterPaintEngine Class Reference

#include <qpaintengine_blitter_p.h>

Inheritance diagram for QBlitterPaintEngine:
QRasterPaintEngine QPaintEngineEx QPaintEngine

Public Functions

virtual bool begin (QPaintDevice *pdev)
 Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. More...
 
virtual void brushChanged ()
 
virtual void clipEnabledChanged ()
 
virtual void compositionModeChanged ()
 
void drawEllipse (const QRectF &rect)
 Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. More...
 
void drawImage (const QPointF &p, const QImage &img)
 
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. More...
 
void drawPixmap (const QPointF &p, const QPixmap &pm)
 
void drawPixmap (const QRectF &r, const QPixmap &pm, const QRectF &sr)
 Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r. More...
 
void drawPoints (const QPointF *points, int pointCount)
 Draws the first pointCount points in the buffer points. More...
 
void drawPoints (const QPoint *points, int pointCount)
 Draws the first pointCount points in the buffer points. More...
 
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. More...
 
void drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode)
 Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode. More...
 
virtual void drawRects (const QRect *rects, int rectCount)
 The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function. More...
 
virtual void drawRects (const QRectF *rects, int rectCount)
 Draws the first rectCount rectangles in the buffer rects. More...
 
void drawStaticTextItem (QStaticTextItem *)
 
void drawTextItem (const QPointF &p, const QTextItem &textItem)
 This function draws the text item textItem at position p. More...
 
void drawTiledPixmap (const QRectF &r, const QPixmap &pm, const QPointF &sr)
 Reimplement this function to draw the pixmap in the given rect, starting at the given p. More...
 
virtual bool end ()
 Reimplement this function to finish painting on the current paint device. More...
 
virtual void fill (const QVectorPath &path, const QBrush &brush)
 
void fillPath (const QPainterPath &path, QSpanData *fillData)
 
void fillPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode)
 
virtual void fillRect (const QRectF &rect, const QBrush &brush)
 
virtual void fillRect (const QRectF &rect, const QColor &color)
 
virtual void opacityChanged ()
 
virtual void penChanged ()
 
 QBlitterPaintEngine (QBlittablePixmapData *p)
 
virtual void renderHintsChanged ()
 
void setState (QPainterState *s)
 
void stroke (const QVectorPath &path, const QPen &pen)
 
virtual void transformChanged ()
 
virtual QPaintEngine::Type type () const
 Reimplement this function to return the paint engine Type. More...
 
- 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...
 

Private Functions

 Q_DECLARE_PRIVATE (QBlitterPaintEngine)
 

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 54 of file qpaintengine_blitter_p.h.

Constructors and Destructors

◆ QBlitterPaintEngine()

QBlitterPaintEngine::QBlitterPaintEngine ( QBlittablePixmapData p)

Definition at line 431 of file qpaintengine_blitter.cpp.

433 {}
friend class QBlitterPaintEnginePrivate
QRasterPaintEngine(QPaintDevice *device)
Creates a raster based paint engine for operating on the given device, with the complete set of QPain...

Functions

◆ begin()

bool QBlitterPaintEngine::begin ( QPaintDevice pdev)
virtual

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 491 of file qpaintengine_blitter.cpp.

492 {
493  bool ok = QRasterPaintEngine::begin(pdev);
494 #ifdef QT_BLITTER_RASTEROVERLAY
496  d->pmData->unmergeOverlay();
497 #endif
498  return ok;
499 }
double d
Definition: qnumeric_p.h:62
bool begin(QPaintDevice *device)
Reimplemented Function
#define Q_D(Class)
Definition: qglobal.h:2482

◆ brushChanged()

void QBlitterPaintEngine::brushChanged ( )
virtual

Implements QPaintEngineEx.

Definition at line 444 of file qpaintengine_blitter.cpp.

445 {
447 
449  d->updateBrushState(state());
450 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ clipEnabledChanged()

void QBlitterPaintEngine::clipEnabledChanged ( )
virtual

Implements QPaintEngineEx.

Definition at line 484 of file qpaintengine_blitter.cpp.

485 {
488  d->updateClipState(state());
489 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ compositionModeChanged()

void QBlitterPaintEngine::compositionModeChanged ( )
virtual

Implements QPaintEngineEx.

Definition at line 460 of file qpaintengine_blitter.cpp.

461 {
463 
465  d->updateCompositionModeState(state());
466 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ drawEllipse()

void QBlitterPaintEngine::drawEllipse ( const QRectF rect)
virtual

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 722 of file qpaintengine_blitter.cpp.

723 {
725  d->lock();
726  d->pmData->markRasterOverlay(r);
728 }
double d
Definition: qnumeric_p.h:62
void drawEllipse(const QRectF &rect)
Reimplemented Function
#define Q_D(Class)
Definition: qglobal.h:2482

◆ drawImage() [1/2]

void QBlitterPaintEngine::drawImage ( const QPointF p,
const QImage img 
)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 730 of file qpaintengine_blitter.cpp.

731 {
732  drawImage(QRectF(pos, image.size()), image, image.rect());
733 }
void drawImage(const QPointF &p, const QImage &img)
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511

◆ drawImage() [2/2]

void QBlitterPaintEngine::drawImage ( const QRectF r,
const QImage pm,
const QRectF sr,
Qt::ImageConversionFlags  flags = Qt::AutoColor 
)
virtual

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 735 of file qpaintengine_blitter.cpp.

737 {
739  d->lock();
740  d->pmData->markRasterOverlay(r);
742 }
double d
Definition: qnumeric_p.h:62
virtual uint flags() const
#define Q_D(Class)
Definition: qglobal.h:2482
void drawImage(const QPointF &p, const QImage &img)

◆ drawPixmap() [1/2]

void QBlitterPaintEngine::drawPixmap ( const QPointF p,
const QPixmap pm 
)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 652 of file qpaintengine_blitter.cpp.

653 {
654  drawPixmap(QRectF(pos, pm.size()), pm, pm.rect());
655 }
QSize size() const
Returns the size of the pixmap.
Definition: qpixmap.cpp:661
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
void drawPixmap(const QPointF &p, const QPixmap &pm)
QRect rect() const
Returns the pixmap&#39;s enclosing rectangle.
Definition: qpixmap.cpp:676

◆ drawPixmap() [2/2]

void QBlitterPaintEngine::drawPixmap ( const QRectF r,
const QPixmap pm,
const QRectF sr 
)
virtual

Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.

Implements QPaintEngineEx.

Definition at line 657 of file qpaintengine_blitter.cpp.

658 {
660  bool canDrawOpacity;
661 
662  canDrawOpacity = d->caps.canBlitterDrawPixmapOpacity(pm);
663  if (canDrawOpacity || (d->caps.canBlitterDrawPixmap(r, pm, sr))) {
664 
665  d->unlock();
666  QRectF targetRect = r;
667  if (d->hasXForm)
668  targetRect = state()->matrix.mapRect(r);
669  const QClipData *clipData = d->clip();
670  if (clipData) {
671  if (clipData->hasRectClip) {
672  d->clipAndDrawPixmap(clipData->clipRect, targetRect, pm, sr, canDrawOpacity);
673  } else if (clipData->hasRegionClip) {
674  QVector<QRect>rects = clipData->clipRegion.rects();
675  for (int i = 0; i<rects.size(); ++i)
676  d->clipAndDrawPixmap(rects.at(i), targetRect, pm, sr, canDrawOpacity);
677  }
678  } else {
679  QRectF deviceRect(0, 0, paintDevice()->width(), paintDevice()->height());
680  d->clipAndDrawPixmap(deviceRect, targetRect, pm, sr, canDrawOpacity);
681  }
682  }else {
683  d->lock();
684  d->pmData->markRasterOverlay(r);
686  }
687 }
double d
Definition: qnumeric_p.h:62
QPaintDevice * paintDevice() const
Returns the device that this engine is painting on, if painting is active; otherwise returns 0...
QRasterPaintEngineState * state()
QTransform matrix
Definition: qpainter_p.h:161
#define Q_D(Class)
Definition: qglobal.h:2482
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
void drawPixmap(const QPointF &p, const QPixmap &pm)
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

◆ drawPoints() [1/2]

void QBlitterPaintEngine::drawPoints ( const QPointF points,
int  pointCount 
)
virtual

Draws the first pointCount points in the buffer points.

Reimplemented from QPaintEngineEx.

Definition at line 760 of file qpaintengine_blitter.cpp.

761 {
763  d->lock();
764  d->pmData->markRasterOverlay(points, pointCount);
765  QRasterPaintEngine::drawPoints(points, pointCount);
766 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void drawPoints(const QPointF *points, int pointCount)
Reimplemented Function

◆ drawPoints() [2/2]

void QBlitterPaintEngine::drawPoints ( const QPoint points,
int  pointCount 
)
virtual

Draws the first pointCount points in the buffer points.

The default implementation converts the first pointCount QPoints in points to QPointFs and calls the floating point version of drawPoints.

Reimplemented from QPaintEngineEx.

Definition at line 768 of file qpaintengine_blitter.cpp.

769 {
771  d->lock();
772  d->pmData->markRasterOverlay(points, pointCount);
773  QRasterPaintEngine::drawPoints(points, pointCount);
774 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void drawPoints(const QPointF *points, int pointCount)
Reimplemented Function

◆ drawPolygon() [1/2]

void QBlitterPaintEngine::drawPolygon ( const QPointF points,
int  pointCount,
PolygonDrawMode  mode 
)
virtual

Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

Note
At least one of the drawPolygon() functions must be reimplemented.

Reimplemented from QPaintEngineEx.

Definition at line 690 of file qpaintengine_blitter.cpp.

691 {
693  d->lock();
694  d->pmData->markRasterOverlay(points, pointCount);
695  QRasterPaintEngine::drawPolygon(points, pointCount, mode);
696 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
Reimplemented Function

◆ drawPolygon() [2/2]

void QBlitterPaintEngine::drawPolygon ( const QPoint points,
int  pointCount,
PolygonDrawMode  mode 
)
virtual

Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
At least one of the drawPolygon() functions must be reimplemented.

Reimplemented from QPaintEngineEx.

Definition at line 698 of file qpaintengine_blitter.cpp.

699 {
701  d->lock();
702  d->pmData->markRasterOverlay(points, pointCount);
703  QRasterPaintEngine::drawPolygon(points, pointCount, mode);
704 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
Reimplemented Function

◆ drawRects() [1/2]

void QBlitterPaintEngine::drawRects ( const QRect rects,
int  rectCount 
)
virtual

The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF and calls the floating point version of this function.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from QPaintEngineEx.

Definition at line 628 of file qpaintengine_blitter.cpp.

629 {
631  if (d->caps.canBlitterDrawRectMask()) {
632  for (int i=0; i<rectCount; ++i)
633  d->fillRect(rects[i], qbrush_color(state()->brush), false);
634  } else {
635  d->pmData->markRasterOverlay(rects, rectCount);
636  QRasterPaintEngine::drawRects(rects, rectCount);
637  }
638 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482
void drawRects(const QRect *rects, int rectCount)
Reimplemented Function
const QColor & qbrush_color(const QBrush &b)
Definition: qpainter_p.h:97

◆ drawRects() [2/2]

void QBlitterPaintEngine::drawRects ( const QRectF rects,
int  rectCount 
)
virtual

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 640 of file qpaintengine_blitter.cpp.

641 {
643  if (d->caps.canBlitterDrawRectMask()) {
644  for (int i = 0; i < rectCount; ++i)
645  d->fillRect(rects[i], qbrush_color(state()->brush), false);
646  } else {
647  d->pmData->markRasterOverlay(rects, rectCount);
648  QRasterPaintEngine::drawRects(rects, rectCount);
649  }
650 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482
void drawRects(const QRect *rects, int rectCount)
Reimplemented Function
const QColor & qbrush_color(const QBrush &b)
Definition: qpainter_p.h:97

◆ drawStaticTextItem()

void QBlitterPaintEngine::drawStaticTextItem ( QStaticTextItem sti)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 784 of file qpaintengine_blitter.cpp.

785 {
787  d->lock();
789 
790 #ifdef QT_BLITTER_RASTEROVERLAY
791 //#### d->pmData->markRasterOverlay(sti);
792  qWarning("not implemented: markRasterOverlay for QStaticTextItem");
793 #endif
794 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void drawStaticTextItem(QStaticTextItem *textItem)
Reimplemented Function
Q_CORE_EXPORT void qWarning(const char *,...)

◆ drawTextItem()

void QBlitterPaintEngine::drawTextItem ( const QPointF p,
const QTextItem textItem 
)
virtual

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 752 of file qpaintengine_blitter.cpp.

753 {
755  d->lock();
756  d->pmData->markRasterOverlay(pos, ti);
758 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void drawTextItem(const QPointF &p, const QTextItem &textItem)
Reimplemented Function

◆ drawTiledPixmap()

void QBlitterPaintEngine::drawTiledPixmap ( const QRectF rect,
const QPixmap pixmap,
const QPointF p 
)
virtual

Reimplement this function to draw the pixmap in the given rect, starting at the given p.

The pixmap will be drawn repeatedly until the rect is filled.

Reimplemented from QPaintEngineEx.

Definition at line 744 of file qpaintengine_blitter.cpp.

745 {
747  d->lock();
748  d->pmData->markRasterOverlay(r);
750 }
double d
Definition: qnumeric_p.h:62
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
Reimplemented Function
#define Q_D(Class)
Definition: qglobal.h:2482

◆ end()

bool QBlitterPaintEngine::end ( )
virtual

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 501 of file qpaintengine_blitter.cpp.

502 {
503 #ifdef QT_BLITTER_RASTEROVERLAY
505  d->pmData->mergeOverlay();
506 #endif
507 
508  return QRasterPaintEngine::end();
509 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
bool end()
Reimplemented Function

◆ fill()

void QBlitterPaintEngine::fill ( const QVectorPath path,
const QBrush brush 
)
virtual

Implements QPaintEngineEx.

Definition at line 520 of file qpaintengine_blitter.cpp.

521 {
523  if (path.shape() == QVectorPath::RectangleHint) {
524  QRectF rect(((QPointF *) path.points())[0], ((QPointF *) path.points())[2]);
525  fillRect(rect, brush);
526  } else {
527  d->lock();
528  d->pmData->markRasterOverlay(path);
529  QRasterPaintEngine::fill(path, brush);
530  }
531 }
double d
Definition: qnumeric_p.h:62
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void fillRect(const QRectF &rect, const QBrush &brush)
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
void fill(const QVectorPath &path, const QBrush &brush)
const qreal * points() const
Hint shape() const

◆ fillPath()

void QBlitterPaintEngine::fillPath ( const QPainterPath path,
QSpanData fillData 
)

Definition at line 706 of file qpaintengine_blitter.cpp.

707 {
709  d->lock();
710  d->pmData->markRasterOverlay(path);
711  QRasterPaintEngine::fillPath(path, fillData);
712 }
double d
Definition: qnumeric_p.h:62
void fillPath(const QPainterPath &path, QSpanData *fillData)
#define Q_D(Class)
Definition: qglobal.h:2482

◆ fillPolygon()

void QBlitterPaintEngine::fillPolygon ( const QPointF points,
int  pointCount,
PolygonDrawMode  mode 
)

Definition at line 714 of file qpaintengine_blitter.cpp.

715 {
717  d->lock();
718  d->pmData->markRasterOverlay(points, pointCount);
719  QRasterPaintEngine::fillPolygon(points, pointCount, mode);
720 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)

◆ fillRect() [1/2]

void QBlitterPaintEngine::fillRect ( const QRectF rect,
const QBrush brush 
)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 547 of file qpaintengine_blitter.cpp.

Referenced by fill().

548 {
549  if (rect.size().isEmpty())
550  return;
551 
553 
554  if (qbrush_style(brush) == Qt::SolidPattern
555  && d->caps.canBlitterAlphaFillRect()) {
556  d->fillRect(rect, qbrush_color(brush), true);
557  } else if (qbrush_style(brush) == Qt::SolidPattern
558  && qbrush_color(brush).alpha() == 0xff
559  && d->caps.canBlitterFillRect()) {
560  d->fillRect(rect, qbrush_color(brush), false);
561  } else if ((brush.style() == Qt::TexturePattern) &&
562  (brush.transform().type() <= QTransform::TxTranslate) &&
563  ((d->caps.canBlitterDrawPixmapOpacity(brush.texture())) ||
564  (d->caps.canBlitterDrawPixmap(rect, brush.texture(), rect)))) {
565  bool rectIsFilled = false;
566  QRectF transformedRect = state()->matrix.mapRect(rect);
567  qreal x = transformedRect.x();
568  qreal y = transformedRect.y();
569  QPixmap pm = brush.texture();
570  d->unlock();
571  int srcX = int(rect.x() - state()->brushOrigin.x() - brush.transform().dx()) % pm.width();
572  if (srcX < 0)
573  srcX = pm.width() + srcX;
574  const int startX = srcX;
575  int srcY = int(rect.y() - state()->brushOrigin.y() - brush.transform().dy()) % pm.height();
576  if (srcY < 0)
577  srcY = pm.height() + srcY;
578  while (!rectIsFilled) {
579  qreal blitWidth = (pm.width() ) - srcX;
580  qreal blitHeight = (pm.height() ) - srcY;
581  if (x + blitWidth > transformedRect.right())
582  blitWidth = transformedRect.right() -x;
583  if (y + blitHeight > transformedRect.bottom())
584  blitHeight = transformedRect.bottom() - y;
585  const QClipData *clipData = d->clip();
586  if (clipData->hasRectClip) {
587  QRect targetRect = QRect(x, y, blitWidth, blitHeight).intersected(clipData->clipRect);
588  if (targetRect.isValid()) {
589  int tmpSrcX = srcX + (targetRect.x() - x);
590  int tmpSrcY = srcY + (targetRect.y() - y);
591  QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height());
592  d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect);
593  }
594  } else if (clipData->hasRegionClip) {
595  QVector<QRect> clipRects = clipData->clipRegion.rects();
596  QRect unclippedTargetRect(x, y, blitWidth, blitHeight);
597  QRegion intersectedRects = clipData->clipRegion.intersected(unclippedTargetRect);
598 
599  for (int i = 0; i < intersectedRects.rects().size(); ++i) {
600  QRect targetRect = intersectedRects.rects().at(i);
601  if (!targetRect.isValid() || targetRect.isEmpty())
602  continue;
603  int tmpSrcX = srcX + (targetRect.x() - x);
604  int tmpSrcY = srcY + (targetRect.y() - y);
605  QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height());
606  d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect);
607  }
608  }
609  x+=blitWidth;
610  if (qFuzzyCompare(x, transformedRect.right())) {
611  x = transformedRect.x();
612  srcX = startX;
613  srcY = 0;
614  y += blitHeight;
615  if (qFuzzyCompare(y, transformedRect.bottom()))
616  rectIsFilled = true;
617  } else
618  srcX = 0;
619  }
620  } else {
621  d->lock();
622  d->pmData->markRasterOverlay(rect);
623  QRasterPaintEngine::fillRect(rect, brush);
624  }
625 
626 }
double d
Definition: qnumeric_p.h:62
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
Definition: qsize.h:278
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
qreal dy() const
Returns the vertical translation factor.
Definition: qtransform.h:277
qreal right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:527
QRegion intersected(const QRegion &r) const
Returns a region which is the intersection of this region and r.
Definition: qregion.h:112
double qreal
Definition: qglobal.h:1193
int width() const
Returns the width of the pixmap.
Definition: qpixmap.cpp:630
QRasterPaintEngineState * state()
Qt::BrushStyle qbrush_style(const QBrush &b)
Definition: qpainter_p.h:96
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
Definition: qglobal.h:2030
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
Definition: qrect.h:481
QTransform matrix
Definition: qpainter_p.h:161
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
TransformationType type() const
Returns the transformation type of this matrix.
#define Q_D(Class)
Definition: qglobal.h:2482
QTransform transform() const
Returns the current transformation matrix for the brush.
Definition: qbrush.h:185
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set...
Definition: qbrush.cpp:785
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
Definition: qrect.h:234
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
void fillRect(const QRectF &rect, const QBrush &brush)
Reimplemented Function
QPointF brushOrigin
Definition: qpainter_p.h:149
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
const QColor & qbrush_color(const QBrush &b)
Definition: qpainter_p.h:97
QSizeF size() const
Returns the size of the rectangle.
Definition: qrect.h:713
qreal dx() const
Returns the horizontal translation factor.
Definition: qtransform.h:273
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
int height() const
Returns the height of the pixmap.
Definition: qpixmap.cpp:645
qreal bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:528
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
Definition: qrect.h:237
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

◆ fillRect() [2/2]

void QBlitterPaintEngine::fillRect ( const QRectF rect,
const QColor color 
)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 533 of file qpaintengine_blitter.cpp.

534 {
536  if (d->caps.canBlitterAlphaFillRect()) {
537  d->fillRect(rect, color, true);
538  } else if (d->caps.canBlitterFillRect() && color.alpha() == 0xff) {
539  d->fillRect(rect, color, false);
540  } else {
541  d->lock();
542  d->pmData->markRasterOverlay(rect);
543  QRasterPaintEngine::fillRect(rect, color);
544  }
545 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
ushort alpha
Returns the alpha color component of this color.
Definition: qcolor.h:242
void fillRect(const QRectF &rect, const QBrush &brush)
Reimplemented Function

◆ opacityChanged()

void QBlitterPaintEngine::opacityChanged ( )
virtual

Implements QPaintEngineEx.

Definition at line 452 of file qpaintengine_blitter.cpp.

453 {
455 
457  d->updateOpacityState(state());
458 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ penChanged()

void QBlitterPaintEngine::penChanged ( )
virtual

Implements QPaintEngineEx.

Definition at line 436 of file qpaintengine_blitter.cpp.

437 {
439 
441  d->updatePenState(state());
442 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ Q_DECLARE_PRIVATE()

QBlitterPaintEngine::Q_DECLARE_PRIVATE ( QBlitterPaintEngine  )
private

◆ renderHintsChanged()

void QBlitterPaintEngine::renderHintsChanged ( )
virtual

Implements QPaintEngineEx.

Definition at line 468 of file qpaintengine_blitter.cpp.

469 {
471 
473  d->updateRenderHintsState(state());
474 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setState()

void QBlitterPaintEngine::setState ( QPainterState s)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 511 of file qpaintengine_blitter.cpp.

512 {
514 
516  d->updateCompleteState(s);
517 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void setState(QPainterState *s)

◆ stroke()

void QBlitterPaintEngine::stroke ( const QVectorPath path,
const QPen pen 
)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 776 of file qpaintengine_blitter.cpp.

777 {
779  d->lock();
780  d->pmData->markRasterOverlay(path);
781  QRasterPaintEngine::stroke(path, pen);
782 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void stroke(const QVectorPath &path, const QPen &pen)

◆ transformChanged()

void QBlitterPaintEngine::transformChanged ( )
virtual

Implements QPaintEngineEx.

Definition at line 476 of file qpaintengine_blitter.cpp.

477 {
479 
481  d->updateTransformState(state());
482 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ type()

virtual QPaintEngine::Type QBlitterPaintEngine::type ( ) const
inlinevirtual

Reimplement this function to return the paint engine Type.

Implements QPaintEngine.

Definition at line 60 of file qpaintengine_blitter_p.h.


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