Qt 4.8
Public Functions | Static Public Functions | List of all members
QDirectFBPaintEngine Class Reference

#include <qdirectfbpaintengine.h>

Inheritance diagram for QDirectFBPaintEngine:
QRasterPaintEngine QPaintEngineEx QPaintEngine

Public Functions

virtual bool begin (QPaintDevice *device)
 Reimplemented Function More...
 
virtual void brushChanged ()
 
virtual void clip (const QVectorPath &path, Qt::ClipOperation op)
 
virtual void clip (const QRegion &region, Qt::ClipOperation op)
 
virtual void clip (const QRect &rect, Qt::ClipOperation op)
 
virtual void clipEnabledChanged ()
 
virtual void compositionModeChanged ()
 
virtual void drawBufferSpan (const uint *buffer, int bufsize, int x, int y, int length, uint const_alpha)
 Draws the given buffer. More...
 
virtual void drawEllipse (const QRectF &rect)
 Reimplemented Function More...
 
virtual void drawImage (const QPointF &p, const QImage &img)
 
virtual void drawImage (const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags falgs=Qt::AutoColor)
 Reimplemented Function More...
 
virtual void drawLines (const QLine *line, int lineCount)
 Reimplemented Function More...
 
virtual void drawLines (const QLineF *line, int lineCount)
 Reimplemented Function More...
 
virtual void drawPath (const QPainterPath &path)
 The default implementation ignores the path and does nothing. More...
 
virtual void drawPixmap (const QPointF &p, const QPixmap &pm)
 
virtual void drawPixmap (const QRectF &r, const QPixmap &pixmap, const QRectF &sr)
 Reimplemented Function More...
 
virtual void drawPoints (const QPointF *points, int pointCount)
 Reimplemented Function More...
 
virtual 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...
 
virtual void drawPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode)
 Reimplemented Function More...
 
virtual void drawPolygon (const QPoint *points, int pointCount, PolygonDrawMode mode)
 Reimplemented Function More...
 
virtual void drawRects (const QRect *rects, int rectCount)
 Reimplemented Function More...
 
virtual void drawRects (const QRectF *rects, int rectCount)
 Reimplemented Function More...
 
virtual void drawRoundedRect (const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode)
 
virtual void drawStaticTextItem (QStaticTextItem *item)
 Reimplemented Function More...
 
virtual void drawTextItem (const QPointF &p, const QTextItem &textItem)
 Reimplemented Function More...
 
virtual void drawTiledPixmap (const QRectF &r, const QPixmap &pm, const QPointF &sr)
 Reimplemented Function More...
 
virtual bool end ()
 Reimplemented Function More...
 
virtual void fill (const QVectorPath &path, const QBrush &brush)
 
virtual void fillRect (const QRectF &r, const QBrush &brush)
 Reimplemented Function More...
 
virtual void fillRect (const QRectF &r, const QColor &color)
 Reimplemented Function More...
 
virtual void opacityChanged ()
 
virtual void penChanged ()
 
 QDirectFBPaintEngine (QPaintDevice *device)
 
virtual void renderHintsChanged ()
 
virtual void setState (QPainterState *state)
 
virtual void stroke (const QVectorPath &path, const QPen &pen)
 
virtual void transformChanged ()
 
virtual ~QDirectFBPaintEngine ()
 
- Public Functions inherited from QRasterPaintEngine
void alphaPenBlt (const void *src, int bpl, int depth, int rx, int ry, int w, int h)
 
void brushOriginChanged ()
 
QRect clipBoundingRect () const
 Returns the bounding rect of the currently set clip. More...
 
ClipType clipType () const
 Returns the type of the clip currently set. More...
 
QPoint coordinateOffset () const
 
QPainterStatecreateState (QPainterState *orig) const
 
virtual void drawColorSpans (const QSpan *spans, int count, uint color)
 Draws the given color spans with the specified color. More...
 
void fillPath (const QPainterPath &path, QSpanData *fillData)
 
void fillPolygon (const QPointF *points, int pointCount, PolygonDrawMode mode)
 
CGContextRef getCGContext () const
 
HDC getDC () const
 
 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 saveBuffer (const QString &s) const
 
void setCGContext (CGContextRef ref)
 
void setDC (HDC hdc)
 
QSize size () const
 
QRasterPaintEngineStatestate ()
 
const QRasterPaintEngineStatestate () const
 
bool supportsTransformations (const QFontEngine *fontEngine) const
 
bool supportsTransformations (qreal pixelSize, const QTransform &m) const
 
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 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 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...
 

Static Public Functions

static void initImageCache (int size)
 

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 58 of file qdirectfbpaintengine.h.

Constructors and Destructors

◆ QDirectFBPaintEngine()

QDirectFBPaintEngine::QDirectFBPaintEngine ( QPaintDevice device)

Definition at line 351 of file qdirectfbpaintengine.cpp.

352  : QRasterPaintEngine(*(new QDirectFBPaintEnginePrivate(this)), device)
353 {
354 }
QRasterPaintEngine(QPaintDevice *device)
Creates a raster based paint engine for operating on the given device, with the complete set of QPain...

◆ ~QDirectFBPaintEngine()

QDirectFBPaintEngine::~QDirectFBPaintEngine ( )
virtual

Definition at line 356 of file qdirectfbpaintengine.cpp.

357 {
358 }

Functions

◆ begin()

bool QDirectFBPaintEngine::begin ( QPaintDevice device)
virtual

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 360 of file qdirectfbpaintengine.cpp.

361 {
363  if (device->devType() == QInternal::CustomRaster) {
364  d->dfbDevice = static_cast<QDirectFBPaintDevice*>(device);
365  } else if (device->devType() == QInternal::Pixmap) {
366  QPixmapData *data = static_cast<QPixmap*>(device)->pixmapData();
368  QDirectFBPixmapData *dfbPixmapData = static_cast<QDirectFBPixmapData*>(data);
370  d->dfbDevice = static_cast<QDirectFBPaintDevice*>(dfbPixmapData);
371  }
372 
373  if (d->dfbDevice)
374  d->surface = d->dfbDevice->directFBSurface();
375 
376  if (!d->surface) {
377  qFatal("QDirectFBPaintEngine used on an invalid device: 0x%x",
378  device->devType());
379  }
380  d->isPremultiplied = QDirectFBScreen::isPremultiplied(d->dfbDevice->format());
381 
382  d->prepare(d->dfbDevice);
384  d->setCompositionMode(state()->composition_mode);
385 
386  return QRasterPaintEngine::begin(device);
387 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
PaintEngineFeatures gccaps
Definition: qpaintengine.h:240
static bool isPremultiplied(QImage::Format format)
bool begin(QPaintDevice *device)
Reimplemented Function
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_D(Class)
Definition: qglobal.h:2482
virtual int devType() const
Definition: qpaintdevice.h:167
static const char * data(const QByteArray &arr)
ClassId classId() const
Q_CORE_EXPORT void qFatal(const char *,...)
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71

◆ brushChanged()

void QDirectFBPaintEngine::brushChanged ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 410 of file qdirectfbpaintengine.cpp.

411 {
413  d->setBrush(state()->brush);
414 
416 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ clip() [1/3]

void QDirectFBPaintEngine::clip ( const QVectorPath path,
Qt::ClipOperation  op 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 467 of file qdirectfbpaintengine.cpp.

468 {
470  const bool wasInClip = d->inClip;
471  d->inClip = true;
472  QRasterPaintEngine::clip(path, op);
473  if (!wasInClip) {
474  d->inClip = false;
475  d->updateClip();
476  }
477 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void clip(const QVectorPath &path, Qt::ClipOperation op)

◆ clip() [2/3]

void QDirectFBPaintEngine::clip ( const QRegion region,
Qt::ClipOperation  op 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 479 of file qdirectfbpaintengine.cpp.

480 {
482  const bool wasInClip = d->inClip;
483  d->inClip = true;
484  QRasterPaintEngine::clip(region, op);
485  if (!wasInClip) {
486  d->inClip = false;
487  d->updateClip();
488  }
489 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void clip(const QVectorPath &path, Qt::ClipOperation op)

◆ clip() [3/3]

void QDirectFBPaintEngine::clip ( const QRect rect,
Qt::ClipOperation  op 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 491 of file qdirectfbpaintengine.cpp.

492 {
494  const bool wasInClip = d->inClip;
495  d->inClip = true;
496  QRasterPaintEngine::clip(rect, op);
497  if (!wasInClip) {
498  d->inClip = false;
499  d->updateClip();
500  }
501 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void clip(const QVectorPath &path, Qt::ClipOperation op)

◆ clipEnabledChanged()

void QDirectFBPaintEngine::clipEnabledChanged ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 403 of file qdirectfbpaintengine.cpp.

404 {
407  d->updateClip();
408 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ compositionModeChanged()

void QDirectFBPaintEngine::compositionModeChanged ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 433 of file qdirectfbpaintengine.cpp.

434 {
436  d->setCompositionMode(state()->compositionMode());
438 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ drawBufferSpan()

void QDirectFBPaintEngine::drawBufferSpan ( const uint buffer,
int  size,
int  x,
int  y,
int  length,
uint  alpha 
)
virtual

Draws the given buffer.

The default implementation does nothing; reimplement this function to draw a buffer that contains more than one color. Note that this function must be reimplemented if the framebuffer is not memory-mapped.

The size parameter specifies the total size of the given buffer, while the length parameter specifies the number of pixels to draw. The buffer's position is given by (x, y). The provided alpha value is added to each pixel in the buffer when drawing.

See also
drawColorSpans()

Reimplemented from QRasterPaintEngine.

Definition at line 937 of file qdirectfbpaintengine.cpp.

940 {
942  IDirectFBSurface *src = d->surfaceCache->getSurface(buffer, bufsize);
943  // ### how does this play with setDFBColor
944  src->SetColor(src, 0, 0, 0, const_alpha);
945  const DFBRectangle rect = { 0, 0, length, 1 };
946  d->surface->Blit(d->surface, src, &rect, x, y);
947 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ drawEllipse()

void QDirectFBPaintEngine::drawEllipse ( const QRectF rect)
virtual

Reimplemented Function

Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.

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

Reimplemented from QRasterPaintEngine.

Definition at line 788 of file qdirectfbpaintengine.cpp.

789 {
792  d->lock();
794 }
double d
Definition: qnumeric_p.h:62
void drawEllipse(const QRectF &rect)
Reimplemented Function
#define Q_D(Class)
Definition: qglobal.h:2482
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)

◆ drawImage() [1/2]

void QDirectFBPaintEngine::drawImage ( const QPointF p,
const QImage img 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 658 of file qdirectfbpaintengine.cpp.

659 {
660  drawImage(QRectF(p, img.size()), img, img.rect());
661 }
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
Definition: qimage.cpp:1603
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QSize size() const
Returns the size of the image, i.
Definition: qimage.cpp:1587
virtual void drawImage(const QPointF &p, const QImage &img)

◆ drawImage() [2/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 597 of file qdirectfbpaintengine.cpp.

600 {
602  Q_UNUSED(flags);
603 
604  /* This is hard to read. The way it works is like this:
605 
606  - If you do not have support for preallocated surfaces and do not use an
607  image cache we always fall back to raster engine.
608 
609  - If it's rotated/sheared/mirrored (negative scale) or we can't
610  clip it we fall back to raster engine.
611 
612  - If we don't cache the image, but we do have support for
613  preallocated surfaces we fall back to the raster engine if the
614  image is in a format DirectFB can't handle.
615 
616  - If we do cache the image but don't have support for preallocated
617  images and the cost of caching the image (bytes used) is higher
618  than the max image cache size we fall back to raster engine.
619  */
620 
621 #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE
622  if (!d->supportedComposition
625  || (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size())
626 #ifndef QT_DIRECTFB_IMAGECACHE
627  || (QDirectFBScreen::getSurfacePixelFormat(image.format()) == DSPF_UNKNOWN)
628 #elif defined QT_NO_DIRECTFB_PREALLOCATED
629  || (QDirectFBPaintEnginePrivate::cacheCost(image) > imageCache.maxCost())
630 #endif
631  )
632 #endif
633  {
634  RASTERFALLBACK(DRAW_IMAGE, r, image.size(), sr);
635  d->lock();
636  QRasterPaintEngine::drawImage(r, image, sr, flags);
637  return;
638  }
639 #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE
640  bool release;
641  IDirectFBSurface *imgSurface = d->getSurface(image, &release);
642  uint blitFlags = 0;
643  if (image.hasAlphaChannel())
645  if (QDirectFBScreen::isPremultiplied(image.format()))
647  d->prepareForBlit(blitFlags);
648  CLIPPED_PAINT(d->blit(r, imgSurface, sr));
649  if (release) {
650 #if (Q_DIRECTFB_VERSION >= 0x010000)
651  d->surface->ReleaseSource(d->surface);
652 #endif
653  imgSurface->Release(imgSurface);
654  }
655 #endif
656 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
static bool isPremultiplied(QImage::Format format)
virtual uint flags() const
QTransform matrix
Definition: qpainter_p.h:161
#define Q_D(Class)
Definition: qglobal.h:2482
void drawImage(const QPointF &p, const QImage &img)
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
#define CLIPPED_PAINT(operation)
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
unsigned int uint
Definition: qglobal.h:996
static DFBSurfacePixelFormat getSurfacePixelFormat(QImage::Format format)
#define RASTERFALLBACK(op, one, two, three)
QSizeF size() const
Returns the size of the rectangle.
Definition: qrect.h:713
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ drawLines() [1/2]

void QDirectFBPaintEngine::drawLines ( const QLine line,
int  lineCount 
)
virtual

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 559 of file qdirectfbpaintengine.cpp.

560 {
562 
563  const QPen &pen = state()->pen;
564  if (!d->supportedPen
566  || !d->supportedComposition) {
567  RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
568  d->lock();
569  QRasterPaintEngine::drawLines(lines, lineCount);
570  return;
571  }
572 
573  if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
574  CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLine>)(lines, lineCount, state()->matrix, d->surface));
575  }
576 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
void drawLines(const QLine *line, int lineCount)
Reimplemented Function
QColor color() const
Returns the color of this pen&#39;s brush.
Definition: qpen.cpp:771
#define Q_D(Class)
Definition: qglobal.h:2482
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
#define CLIPPED_PAINT(operation)
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)

◆ drawLines() [2/2]

void QDirectFBPaintEngine::drawLines ( const QLineF line,
int  lineCount 
)
virtual

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 578 of file qdirectfbpaintengine.cpp.

579 {
581 
582  const QPen &pen = state()->pen;
583  if (!d->supportedPen
585  || !d->supportedComposition) {
586  RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
587  d->lock();
588  QRasterPaintEngine::drawLines(lines, lineCount);
589  return;
590  }
591 
592  if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
593  CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLineF>)(lines, lineCount, state()->matrix, d->surface));
594  }
595 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
void drawLines(const QLine *line, int lineCount)
Reimplemented Function
QColor color() const
Returns the color of this pen&#39;s brush.
Definition: qpen.cpp:771
#define Q_D(Class)
Definition: qglobal.h:2482
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
#define CLIPPED_PAINT(operation)
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)

◆ drawPath()

void QDirectFBPaintEngine::drawPath ( const QPainterPath path)
virtual

The default implementation ignores the path and does nothing.

Reimplemented from QPaintEngineEx.

Definition at line 742 of file qdirectfbpaintengine.cpp.

743 {
746  d->lock();
748 }
double d
Definition: qnumeric_p.h:62
virtual void drawPath(const QPainterPath &path)
The default implementation ignores the path and does nothing.
#define Q_D(Class)
Definition: qglobal.h:2482
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)

◆ drawPixmap() [1/2]

void QDirectFBPaintEngine::drawPixmap ( const QPointF pos,
const QPixmap pixmap 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 699 of file qdirectfbpaintengine.cpp.

700 {
701  drawPixmap(QRectF(p, pm.size()), pm, pm.rect());
702 }
virtual void drawPixmap(const QPointF &p, const QPixmap &pm)
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511

◆ drawPixmap() [2/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 663 of file qdirectfbpaintengine.cpp.

665 {
667 
668  if (pixmap.pixmapData()->classId() != QPixmapData::DirectFBClass) {
669  RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
670  d->lock();
671  QRasterPaintEngine::drawPixmap(r, pixmap, sr);
672  } else {
673  QPixmapData *data = pixmap.pixmapData();
675  QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
676  if (!d->supportedComposition
679  || (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size())) {
680  RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
681  const QImage *img = dfbData->buffer();
682  d->lock();
683  QRasterPaintEngine::drawImage(r, *img, sr);
684  } else {
686  IDirectFBSurface *s = dfbData->directFBSurface();
687  uint blitFlags = 0;
688  if (pixmap.hasAlphaChannel())
690  if (QDirectFBScreen::isPremultiplied(dfbData->pixelFormat()))
692 
693  d->prepareForBlit(blitFlags);
694  CLIPPED_PAINT(d->blit(r, s, sr));
695  }
696  }
697 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
static bool isPremultiplied(QImage::Format format)
QTransform matrix
Definition: qpainter_p.h:161
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_D(Class)
Definition: qglobal.h:2482
void drawImage(const QPointF &p, const QImage &img)
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
#define CLIPPED_PAINT(operation)
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
ClassId classId() const
void drawPixmap(const QPointF &p, const QPixmap &pm)
#define RASTERFALLBACK(op, one, two, three)
QSizeF size() const
Returns the size of the rectangle.
Definition: qrect.h:713

◆ drawPoints() [1/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 750 of file qdirectfbpaintengine.cpp.

751 {
753 
754  const QPen &pen = state()->pen;
755  if (!d->supportedPen
757  || !d->supportedComposition) {
758  RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG());
759  d->lock();
760  QRasterPaintEngine::drawPoints(points, pointCount);
761  return;
762  }
763 
764  if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
765  CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawPoints<QPointF>)(points, pointCount, state()->matrix, d->surface));
766  }
767 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
QColor color() const
Returns the color of this pen&#39;s brush.
Definition: qpen.cpp:771
#define Q_D(Class)
Definition: qglobal.h:2482
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
#define CLIPPED_PAINT(operation)
void drawPoints(const QPointF *points, int pointCount)
Reimplemented Function
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)

◆ drawPoints() [2/2]

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

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.

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

Reimplemented from QRasterPaintEngine.

Definition at line 769 of file qdirectfbpaintengine.cpp.

770 {
772 
773  const QPen &pen = state()->pen;
774  if (!d->supportedPen
776  || !d->supportedComposition) {
777  RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG());
778  d->lock();
779  QRasterPaintEngine::drawPoints(points, pointCount);
780  return;
781  }
782 
783  if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
784  CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawPoints<QPoint>)(points, pointCount, state()->matrix, d->surface));
785  }
786 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
QColor color() const
Returns the color of this pen&#39;s brush.
Definition: qpen.cpp:771
#define Q_D(Class)
Definition: qglobal.h:2482
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
#define CLIPPED_PAINT(operation)
void drawPoints(const QPointF *points, int pointCount)
Reimplemented Function
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)

◆ drawPolygon() [1/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 796 of file qdirectfbpaintengine.cpp.

798 {
799  RASTERFALLBACK(DRAW_POLYGON, pointCount, mode, VOID_ARG());
801  d->lock();
802  QRasterPaintEngine::drawPolygon(points, pointCount, mode);
803 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
Reimplemented Function

◆ drawPolygon() [2/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 805 of file qdirectfbpaintengine.cpp.

807 {
808  RASTERFALLBACK(DRAW_POLYGON, pointCount, mode, VOID_ARG());
810  d->lock();
811  QRasterPaintEngine::drawPolygon(points, pointCount, mode);
812 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
Reimplemented Function

◆ drawRects() [1/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 503 of file qdirectfbpaintengine.cpp.

504 {
506  const QPen &pen = state()->pen;
507  const QBrush &brush = state()->brush;
508  if (brush.style() == Qt::NoBrush && pen.style() == Qt::NoPen)
509  return;
510 
511  if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
512  || !d->supportedPen
514  || !d->supportedBrush
515  || !d->supportedComposition) {
516  RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
517  d->lock();
518  QRasterPaintEngine::drawRects(rects, rectCount);
519  return;
520  }
521 
522  if (brush.style() != Qt::NoBrush && d->prepareForDraw(brush.color())) {
523  CLIPPED_PAINT(QT_PREPEND_NAMESPACE(fillRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
524  }
525 
526  if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
527  CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
528  }
529 }
double d
Definition: qnumeric_p.h:62
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
QRasterPaintEngineState * state()
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
QColor color() const
Returns the color of this pen&#39;s brush.
Definition: qpen.cpp:771
#define Q_D(Class)
Definition: qglobal.h:2482
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
void drawRects(const QRect *rects, int rectCount)
Reimplemented Function
#define CLIPPED_PAINT(operation)
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
QBrush brush
Definition: qpainter_p.h:153

◆ drawRects() [2/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 531 of file qdirectfbpaintengine.cpp.

532 {
534  const QPen &pen = state()->pen;
535  const QBrush &brush = state()->brush;
536  if (brush.style() == Qt::NoBrush && pen.style() == Qt::NoPen)
537  return;
538 
539  if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
540  || !d->supportedPen
542  || !d->supportedBrush
543  || !d->supportedComposition) {
544  RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
545  d->lock();
546  QRasterPaintEngine::drawRects(rects, rectCount);
547  return;
548  }
549 
550  if (brush.style() != Qt::NoBrush && d->prepareForDraw(brush.color())) {
551  CLIPPED_PAINT(fillRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
552  }
553 
554  if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) {
555  CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRectF>)(rects, rectCount, state()->matrix, d->surface));
556  }
557 }
double d
Definition: qnumeric_p.h:62
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
QRasterPaintEngineState * state()
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
QColor color() const
Returns the color of this pen&#39;s brush.
Definition: qpen.cpp:771
#define Q_D(Class)
Definition: qglobal.h:2482
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
void drawRects(const QRect *rects, int rectCount)
Reimplemented Function
#define CLIPPED_PAINT(operation)
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
QBrush brush
Definition: qpainter_p.h:153

◆ drawRoundedRect()

void QDirectFBPaintEngine::drawRoundedRect ( const QRectF rect,
qreal  xrad,
qreal  yrad,
Qt::SizeMode  mode 
)
virtual

Reimplemented from QPaintEngineEx.

Definition at line 855 of file qdirectfbpaintengine.cpp.

856 {
857  RASTERFALLBACK(DRAW_ROUNDED_RECT, rect, xrad, yrad);
859  d->lock();
860  QRasterPaintEngine::drawRoundedRect(rect, xrad, yrad, mode);
861 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define RASTERFALLBACK(op, one, two, three)
virtual void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode)

◆ drawStaticTextItem()

void QDirectFBPaintEngine::drawStaticTextItem ( QStaticTextItem textItem)
virtual

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 863 of file qdirectfbpaintengine.cpp.

864 {
867  d->lock();
869 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void drawStaticTextItem(QStaticTextItem *textItem)
Reimplemented Function
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)

◆ drawTextItem()

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 814 of file qdirectfbpaintengine.cpp.

816 {
817  RASTERFALLBACK(DRAW_TEXT, p, textItem.text(), VOID_ARG());
819  d->lock();
821 }
double d
Definition: qnumeric_p.h:62
QString text() const
Returns the text that should be drawn.
#define Q_D(Class)
Definition: qglobal.h:2482
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
void drawTextItem(const QPointF &p, const QTextItem &textItem)
Reimplemented Function

◆ drawTiledPixmap()

void QDirectFBPaintEngine::drawTiledPixmap ( const QRectF r,
const QPixmap pm,
const QPointF sr 
)
virtual

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 704 of file qdirectfbpaintengine.cpp.

707 {
709  if (pixmap.pixmapData()->classId() != QPixmapData::DirectFBClass) {
710  RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset);
711  d->lock();
712  QRasterPaintEngine::drawTiledPixmap(r, pixmap, offset);
713  } else if (!d->supportedComposition
716  || (!d->supportsStretchBlit() && state()->matrix.isScaling())) {
717  RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset);
718  QPixmapData *pixmapData = pixmap.pixmapData();
719  Q_ASSERT(pixmapData->classId() == QPixmapData::DirectFBClass);
720  QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(pixmapData);
721  const QImage *img = dfbData->buffer();
722  d->lock();
724  data->fromImage(*img, Qt::AutoColor);
725  const QPixmap pix(data);
726  QRasterPaintEngine::drawTiledPixmap(r, pix, offset);
727  } else {
728  QTransform transform(state()->matrix);
729  CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset, transform));
730  }
731 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
Reimplemented Function
QTransform matrix
Definition: qpainter_p.h:161
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_D(Class)
Definition: qglobal.h:2482
#define CLIPPED_PAINT(operation)
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static const char * data(const QByteArray &arr)
#define RASTERFALLBACK(op, one, two, three)
bool isScaling() const
Returns true if the matrix represents a scaling transformation, otherwise returns false...
Definition: qtransform.h:214
QSizeF size() const
Returns the size of the rectangle.
Definition: qrect.h:713
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
void fromImage(const QImage &image, Qt::ImageConversionFlags flags)

◆ end()

bool QDirectFBPaintEngine::end ( )
virtual

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 389 of file qdirectfbpaintengine.cpp.

390 {
392  d->unlock();
393  d->dfbDevice = 0;
394 #if (Q_DIRECTFB_VERSION >= 0x010000)
395  d->surface->ReleaseSource(d->surface);
396 #endif
397  d->currentClip = QRect();
398  d->surface->SetClip(d->surface, NULL);
399  d->surface = 0;
400  return QRasterPaintEngine::end();
401 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
bool end()
Reimplemented Function
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ fill()

void QDirectFBPaintEngine::fill ( const QVectorPath path,
const QBrush brush 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 823 of file qdirectfbpaintengine.cpp.

824 {
825  if (brush.style() == Qt::NoBrush)
826  return;
827 
828  if (path.elementCount() == 5 && path.shape() == QVectorPath::RectangleHint) {
829  const QPainterPath rectPath = path.convertToPainterPath();
830  if (rectPath.elementAt(0).type == QPainterPath::MoveToElement
831  && rectPath.elementAt(1).type == QPainterPath::LineToElement
832  && rectPath.elementAt(2).type == QPainterPath::LineToElement
833  && rectPath.elementAt(3).type == QPainterPath::LineToElement
834  && rectPath.elementAt(4).type == QPainterPath::LineToElement) {
835 
836  const qreal *points = path.points();
837  if (points[1] == points[3]
838  && points[2] == points[4]
839  && points[5] == points[7]
840  && points[6] == points[0]) {
841  QRectF rect( points[0], points[1], points[4], points[5] );
842 
843  fillRect( rect, brush );
844  return;
845  }
846  }
847  }
848 
849  RASTERFALLBACK(FILL_PATH, path, brush, VOID_ARG());
851  d->lock();
852  QRasterPaintEngine::fill(path, brush);
853 }
ElementType type
the type of element
Definition: qpainterpath.h:81
double d
Definition: qnumeric_p.h:62
double qreal
Definition: qglobal.h:1193
int elementCount() const
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
virtual void fillRect(const QRectF &r, const QBrush &brush)
Reimplemented Function
#define Q_D(Class)
Definition: qglobal.h:2482
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
Definition: qpainterpath.h:402
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
void fill(const QVectorPath &path, const QBrush &brush)
const QPainterPath convertToPainterPath() const
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
const qreal * points() const
Hint shape() const

◆ fillRect() [1/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 871 of file qdirectfbpaintengine.cpp.

Referenced by fill().

872 {
874  if (brush.style() == Qt::NoBrush)
875  return;
876  if (d->clipType != QDirectFBPaintEnginePrivate::ComplexClip) {
877  switch (brush.style()) {
878  case Qt::SolidPattern: {
879  const QColor color = brush.color();
880  if (!color.isValid())
881  return;
882 
884  || !d->supportedComposition) {
885  break;
886  }
887  if (d->prepareForDraw(color)) {
888  const QRect r = state()->matrix.mapRect(rect).toRect();
889  CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
890  }
891  return; }
892 
893  case Qt::TexturePattern: {
894  const QPointF &brushOrigin = state()->brushOrigin;
895  const QTransform stateTransform = state()->matrix;
896  QTransform transform(stateTransform);
897  transform.translate(brushOrigin.x(), brushOrigin.y());
898  transform = brush.transform() * transform;
899  if (!d->supportedComposition
901  || (!d->supportsStretchBlit() && transform.isScaling())) {
902  break;
903  }
904 
905  const QPixmap texture = brush.texture();
906  if (texture.pixmapData()->classId() != QPixmapData::DirectFBClass)
907  break;
908 
909  CLIPPED_PAINT(d->drawTiledPixmap(stateTransform.mapRect(rect), texture, rect.topLeft() - brushOrigin, transform));
910  return; }
911  default:
912  break;
913  }
914  }
915  RASTERFALLBACK(FILL_RECT, rect, brush, VOID_ARG());
916  d->lock();
917  QRasterPaintEngine::fillRect(rect, brush);
918 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
double d
Definition: qnumeric_p.h:62
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
QRasterPaintEngineState * state()
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
QPointF topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:539
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
QTransform matrix
Definition: qpainter_p.h:161
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#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 ...
#define CLIPPED_PAINT(operation)
static uint getTransformationType(const QTransform &transform)
ClassId classId() const
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
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
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
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
bool isValid() const
Returns true if the color is valid; otherwise returns false.
Definition: qcolor.h:295
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
QPixmapData * pixmapData() const
Definition: qpixmap.cpp:2277

◆ fillRect() [2/2]

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

Reimplemented Function

Reimplemented from QRasterPaintEngine.

Definition at line 920 of file qdirectfbpaintengine.cpp.

921 {
922  if (!color.isValid())
923  return;
925  if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported)
927  || !d->supportedComposition) {
928  RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG());
929  d->lock();
930  QRasterPaintEngine::fillRect(rect, color);
931  } else if (d->prepareForDraw(color)) {
932  const QRect r = state()->matrix.mapRect(rect).toRect();
933  CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));
934  }
935 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
QTransform matrix
Definition: qpainter_p.h:161
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#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 ...
#define CLIPPED_PAINT(operation)
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
void fillRect(const QRectF &rect, const QBrush &brush)
Reimplemented Function
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
bool isValid() const
Returns true if the color is valid; otherwise returns false.
Definition: qcolor.h:295

◆ initImageCache()

static void QDirectFBPaintEngine::initImageCache ( int  size)
static

◆ opacityChanged()

void QDirectFBPaintEngine::opacityChanged ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 426 of file qdirectfbpaintengine.cpp.

427 {
429  d->opacity = quint8(state()->opacity * 255);
431 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
unsigned char quint8
Definition: qglobal.h:934
#define Q_D(Class)
Definition: qglobal.h:2482

◆ penChanged()

void QDirectFBPaintEngine::penChanged ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 418 of file qdirectfbpaintengine.cpp.

419 {
421  d->setPen(state()->pen);
422 
424 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ renderHintsChanged()

void QDirectFBPaintEngine::renderHintsChanged ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 440 of file qdirectfbpaintengine.cpp.

441 {
443  d->setRenderHints(state()->renderHints);
445 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setState()

void QDirectFBPaintEngine::setState ( QPainterState s)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 454 of file qdirectfbpaintengine.cpp.

455 {
458  d->setPen(state->pen);
459  d->opacity = quint8(state->opacity * 255);
460  d->setCompositionMode(state->compositionMode());
461  d->setTransform(state->transform());
462  d->setRenderHints(state->renderHints);
463  if (d->surface)
464  d->updateClip();
465 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
QPainter::RenderHints renderHints
Definition: qpainter_p.h:158
QTransform transform() const
Returns the matrix in the current paint engine state.
Definition: qpainter.cpp:9377
unsigned char quint8
Definition: qglobal.h:934
#define Q_D(Class)
Definition: qglobal.h:2482
QPainter::CompositionMode compositionMode() const
Returns the composition mode in the current paint engine state.
Definition: qpainter.cpp:9503
void setState(QPainterState *s)

◆ stroke()

void QDirectFBPaintEngine::stroke ( const QVectorPath path,
const QPen pen 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 734 of file qdirectfbpaintengine.cpp.

735 {
738  d->lock();
739  QRasterPaintEngine::stroke(path, pen);
740 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define VOID_ARG()
#define RASTERFALLBACK(op, one, two, three)
void stroke(const QVectorPath &path, const QPen &pen)

◆ transformChanged()

void QDirectFBPaintEngine::transformChanged ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QRasterPaintEngine.

Definition at line 447 of file qdirectfbpaintengine.cpp.

448 {
450  d->setTransform(state()->matrix);
452 }
double d
Definition: qnumeric_p.h:62
QRasterPaintEngineState * state()
#define Q_D(Class)
Definition: qglobal.h:2482

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