Qt 4.8
Public Types | Public Functions | Static Public Functions | Public Variables | List of all members
QDirectFBPaintEnginePrivate Class Reference
Inheritance diagram for QDirectFBPaintEnginePrivate:
QRasterPaintEnginePrivate QPaintEngineExPrivate QPaintEnginePrivate

Public Types

enum  BlitFlag { HasAlpha = 0x1, Premultiplied = 0x2 }
 
enum  ClipType {
  ClipUnset, NoClip, RectClip, RegionClip,
  ComplexClip
}
 
enum  TransformationTypeFlags { Matrix_NegativeScaleX = 0x100, Matrix_NegativeScaleY = 0x200, Matrix_RectsUnsupported = (QTransform::TxRotate|QTransform::TxShear|QTransform::TxProject), Matrix_BlitsUnsupported = (Matrix_RectsUnsupported|Matrix_NegativeScaleX|Matrix_NegativeScaleY) }
 

Public Functions

void blit (const QRectF &dest, IDirectFBSurface *surface, const QRectF &src)
 
void drawTiledPixmap (const QRectF &dest, const QPixmap &pixmap, const QPointF &pos, const QTransform &pixmapTransform)
 
void lock ()
 
void prepareForBlit (uint blitFlags)
 
bool prepareForDraw (const QColor &color)
 
 QDirectFBPaintEnginePrivate (QDirectFBPaintEngine *p)
 
void setBrush (const QBrush &brush)
 
void setCompositionMode (QPainter::CompositionMode mode)
 
void setPen (const QPen &pen)
 
void setRenderHints (QPainter::RenderHints hints)
 
void setTransform (const QTransform &transforma)
 
bool supportsStretchBlit () const
 
virtual void systemStateChanged ()
 
void unlock ()
 
void updateClip ()
 
 ~QDirectFBPaintEnginePrivate ()
 
- Public Functions inherited from QRasterPaintEnginePrivate
QTransform brushMatrix () const
 
bool canUseFastImageBlending (QPainter::CompositionMode mode, const QImage &image) const
 
const QClipDataclip () const
 
void drawImage (const QPointF &pt, const QImage &img, SrcOverBlendFunc func, const QRect &clip, int alpha, const QRect &sr=QRect())
 
ProcessSpans getBrushFunc (const QRect &rect, const QSpanData *data) const
 
ProcessSpans getBrushFunc (const QRectF &rect, const QSpanData *data) const
 
ProcessSpans getPenFunc (const QRectF &rect, const QSpanData *data) const
 
void initializeRasterizer (QSpanData *data)
 
bool isUnclipped (const QRect &rect, int penWidth) const
 
bool isUnclipped (const QRectF &rect, int penWidth) const
 
bool isUnclipped_normalized (const QRect &rect) const
 Returns true if the rectangle is completely within the current clip state of the paint engine. More...
 
void prepare (QCustomRasterPaintDevice *)
 
 QRasterPaintEnginePrivate ()
 
void rasterize (QT_FT_Outline *outline, ProcessSpans callback, QSpanData *spanData, QRasterBuffer *rasterBuffer)
 
void rasterize (QT_FT_Outline *outline, ProcessSpans callback, void *userData, QRasterBuffer *rasterBuffer)
 
void rasterizeLine_dashed (QLineF line, qreal width, int *dashIndex, qreal *dashOffset, bool *inDash)
 
void recalculateFastImages ()
 
void updateMatrixData (QSpanData *spanData, const QBrush &brush, const QTransform &brushMatrix)
 
- Public Functions inherited from QPaintEngineExPrivate
bool hasClipOperations () const
 
 QPaintEngineExPrivate ()
 
void replayClipOperations ()
 
 ~QPaintEngineExPrivate ()
 
- Public Functions inherited from QPaintEnginePrivate
void drawBoxTextItem (const QPointF &p, const QTextItemInt &ti)
 
 QPaintEnginePrivate ()
 
void setSystemTransform (const QTransform &xform)
 
void setSystemViewport (const QRegion &region)
 
void transformSystemClip ()
 
virtual ~QPaintEnginePrivate ()
 

Static Public Functions

static IDirectFBSurface * getSurface (const QImage &img, bool *release)
 
static uint getTransformationType (const QTransform &transform)
 
static void unlock (QDirectFBPaintDevice *device)
 

Public Variables

bool antialiased
 
ClipType clipType
 
QRect currentClip
 
QDirectFBPaintDevicedfbDevice
 
QDirectFBPaintEngineengine
 
IDirectFB * fb
 
bool inClip
 
bool isPremultiplied
 
quint8 opacity
 
bool supportedBrush
 
bool supportedComposition
 
bool supportedPen
 
IDirectFBSurface * surface
 
SurfaceCachesurfaceCache
 
uint transformationType
 
- Public Variables inherited from QRasterPaintEnginePrivate
QScopedPointer< QClipDatabaseClip
 
QStroker basicStroker
 
QDataBuffer< QLineFcachedLines
 
QScopedPointer< QDashStrokerdashStroker
 
QPaintDevicedevice
 
int deviceDepth
 
QRect deviceRect
 
QRect deviceRectUnclipped
 
QFontEngineGlyphCache::Type glyphCacheType
 
QScopedPointer< QT_FT_RastergrayRaster
 
HDC hdc
 
QSpanData image_filler
 
QSpanData image_filler_xform
 
uint isPlain45DegreeRotation: 1
 
uint mono_surface: 1
 
QScopedPointer< QOutlineMapperoutlineMapper
 
uint outlinemapper_xform_dirty: 1
 
QScopedPointer< QRasterBufferrasterBuffer
 
QScopedPointer< QRasterizerrasterizer
 
QSpanData solid_color_filler
 
- Public Variables inherited from QPaintEngineExPrivate
QStrokerOpsactiveStroker
 
QDashStroker dasher
 
QRect exDeviceRect
 
StrokeHandlerstrokeHandler
 
QStroker stroker
 
QPen strokerPen
 
- Public Variables inherited from QPaintEnginePrivate
QWidgetcurrentClipWidget
 
uint hasSystemTransform: 1
 
uint hasSystemViewport: 1
 
QPaintDevicepdev
 
QPaintEngineq_ptr
 
QRegion systemClip
 
QRect systemRect
 
QTransform systemTransform
 
QRegion systemViewport
 

Detailed Description

Definition at line 62 of file qdirectfbpaintengine.cpp.

Enumerations

◆ BlitFlag

Enumerator
HasAlpha 
Premultiplied 

Definition at line 123 of file qdirectfbpaintengine.cpp.

◆ ClipType

◆ TransformationTypeFlags

Constructors and Destructors

◆ QDirectFBPaintEnginePrivate()

QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate ( QDirectFBPaintEngine p)

Definition at line 965 of file qdirectfbpaintengine.cpp.

966  : surface(0), antialiased(false), supportedBrush(false), supportedPen(false),
967  transformationType(0), opacity(255),
969  supportedComposition(false), isPremultiplied(false), inClip(false), engine(p)
970 {
973 }
QDirectFBPaintDevice * dfbDevice
IDirectFB * dfb()
static QDirectFBScreen * instance()

◆ ~QDirectFBPaintEnginePrivate()

QDirectFBPaintEnginePrivate::~QDirectFBPaintEnginePrivate ( )

Definition at line 975 of file qdirectfbpaintengine.cpp.

976 {
977  delete surfaceCache;
978 }

Functions

◆ blit()

void QDirectFBPaintEnginePrivate::blit ( const QRectF dest,
IDirectFBSurface *  surface,
const QRectF src 
)

Definition at line 1220 of file qdirectfbpaintengine.cpp.

1221 {
1222  const QRect sr = src.toRect();
1223  const QRect dr = engine->state()->matrix.mapRect(dest).toRect();
1224  if (dr.isEmpty())
1225  return;
1226  const DFBRectangle sRect = { sr.x(), sr.y(), sr.width(), sr.height() };
1227  DFBResult result;
1228 
1229  if (dr.size() == sr.size()) {
1230  result = surface->Blit(surface, s, &sRect, dr.x(), dr.y());
1231  } else {
1233  const DFBRectangle dRect = { dr.x(), dr.y(), dr.width(), dr.height() };
1234  result = surface->StretchBlit(surface, s, &sRect, &dRect);
1235  }
1236  if (result != DFB_OK)
1237  DirectFBError("QDirectFBPaintEngine::drawPixmap()", result);
1238 }
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_ASSERT(cond)
Definition: qglobal.h:1823
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
QRect toRect() const
Returns a QRect based on the values of this rectangle.
Definition: qrect.h:845
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
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ drawTiledPixmap()

void QDirectFBPaintEnginePrivate::drawTiledPixmap ( const QRectF dest,
const QPixmap pixmap,
const QPointF pos,
const QTransform pixmapTransform 
)

Definition at line 1250 of file qdirectfbpaintengine.cpp.

1252 {
1253  const QTransform &transform = engine->state()->matrix;
1255  !(getTransformationType(pixmapTransform) & Matrix_BlitsUnsupported));
1256  const QRect destinationRect = dest.toRect();
1257  QRect newClip = destinationRect;
1258  if (!currentClip.isEmpty())
1259  newClip &= currentClip;
1260 
1261  if (newClip.isNull())
1262  return;
1263 
1264  const DFBRegion clip = {
1265  newClip.x(),
1266  newClip.y(),
1267  newClip.right(),
1268  newClip.bottom()
1269  };
1270  surface->SetClip(surface, &clip);
1271 
1272  QPointF offset = off;
1273  Q_ASSERT(transform.type() <= QTransform::TxScale);
1274  QPixmapData *data = pixmap.pixmapData();
1275  Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
1276  QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
1277  IDirectFBSurface *sourceSurface = dfbData->directFBSurface();
1278  uint blitFlags = 0;
1279  if (dfbData->hasAlphaChannel())
1280  blitFlags |= HasAlpha;
1281  if (QDirectFBScreen::isPremultiplied(dfbData->pixelFormat()))
1282  blitFlags |= Premultiplied;
1283  prepareForBlit(blitFlags);
1285  const QSize pixmapSize = dfbData->size();
1286  if (transform.isScaling() || pixmapTransform.isScaling()) {
1288  Q_ASSERT(qMin(transform.m11(), transform.m22()) >= 0);
1289  offset.rx() *= transform.m11();
1290  offset.ry() *= transform.m22();
1291 
1292  const QSizeF mappedSize(pixmapSize.width() * pixmapTransform.m11(), pixmapSize.height() * pixmapTransform.m22());
1293  qreal y = fixCoord(destinationRect.y(), mappedSize.height(), offset.y());
1294  const qreal startX = fixCoord(destinationRect.x(), mappedSize.width(), offset.x());
1295  while (y <= destinationRect.bottom()) {
1296  qreal x = startX;
1297  while (x <= destinationRect.right()) {
1298  const DFBRectangle destination = { qRound(x), qRound(y), mappedSize.width(), mappedSize.height() };
1299  surface->StretchBlit(surface, sourceSurface, 0, &destination);
1300  x += mappedSize.width();
1301  }
1302  y += mappedSize.height();
1303  }
1304  } else {
1305  qreal y = fixCoord(destinationRect.y(), pixmapSize.height(), offset.y());
1306  const qreal startX = fixCoord(destinationRect.x(), pixmapSize.width(), offset.x());
1307  int horizontal = qMax(1, destinationRect.width() / pixmapSize.width()) + 1;
1308  if (startX != destinationRect.x())
1309  ++horizontal;
1310  int vertical = qMax(1, destinationRect.height() / pixmapSize.height()) + 1;
1311  if (y != destinationRect.y())
1312  ++vertical;
1313 
1314  const int maxCount = (vertical * horizontal);
1315  QVarLengthArray<DFBRectangle, 16> sourceRects(maxCount);
1316  QVarLengthArray<DFBPoint, 16> points(maxCount);
1317 
1318  int i = 0;
1319  while (y <= destinationRect.bottom()) {
1320  Q_ASSERT(i < maxCount);
1321  qreal x = startX;
1322  while (x <= destinationRect.right()) {
1323  points[i].x = qRound(x);
1324  points[i].y = qRound(y);
1325  sourceRects[i].x = 0;
1326  sourceRects[i].y = 0;
1327  sourceRects[i].w = int(pixmapSize.width());
1328  sourceRects[i].h = int(pixmapSize.height());
1329  x += pixmapSize.width();
1330  ++i;
1331  }
1332  y += pixmapSize.height();
1333  }
1334  surface->BatchBlit(surface, sourceSurface, sourceRects.constData(), points.constData(), i);
1335  }
1336 
1337  if (currentClip.isEmpty()) {
1338  surface->SetClip(surface, 0);
1339  } else {
1340  const DFBRegion clip = {
1341  currentClip.x(),
1342  currentClip.y(),
1343  currentClip.right(),
1345  };
1346  surface->SetClip(surface, &clip);
1347  }
1348 }
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
Definition: qrect.h:231
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QRasterPaintEngineState * state()
static bool isPremultiplied(QImage::Format format)
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
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
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
TransformationType type() const
Returns the transformation type of this matrix.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
int width() const
Returns the width.
Definition: qsize.h:126
qreal & rx()
Returns a reference to the x coordinate of this point.
Definition: qpoint.h:302
static uint getTransformationType(const QTransform &transform)
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
QRect toRect() const
Returns a QRect based on the values of this rectangle.
Definition: qrect.h:845
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
Definition: qrect.h:234
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
bool isScaling() const
Returns true if the matrix represents a scaling transformation, otherwise returns false...
Definition: qtransform.h:214
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
const QClipData * clip() const
qreal & ry()
Returns a reference to the y coordinate of this point.
Definition: qpoint.h:307
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
virtual IDirectFBSurface * directFBSurface() const
static qreal fixCoord(qreal rect_pos, qreal pixmapSize, qreal offset)
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
QPixmapData * pixmapData() const
Definition: qpixmap.cpp:2277

◆ getSurface()

IDirectFBSurface * QDirectFBPaintEnginePrivate::getSurface ( const QImage img,
bool *  release 
)
static

Definition at line 1185 of file qdirectfbpaintengine.cpp.

Referenced by SurfaceCache::~SurfaceCache().

1186 {
1187 #ifdef QT_NO_DIRECTFB_IMAGECACHE
1188  *release = true;
1190 #else
1191  const qint64 key = img.cacheKey();
1192  *release = false;
1193  if (imageCache.contains(key)) {
1194  return imageCache[key]->surface;
1195  }
1196 
1197  const int cost = cacheCost(img);
1198  const bool cache = cost <= imageCache.maxCost();
1201  ? screen->alphaPixmapFormat() : screen->pixelFormat());
1202 
1203  IDirectFBSurface *surface = screen->createDFBSurface(img, format,
1204  cache
1207  if (cache) {
1208  CachedImage *cachedImage = new CachedImage;
1209  const_cast<QImage&>(img).data_ptr()->is_cached = true;
1210  cachedImage->surface = surface;
1211  imageCache.insert(key, cachedImage, cost);
1212  } else {
1213  *release = true;
1214  }
1215  return surface;
1216 #endif
1217 }
Format
The following image formats are available in Qt.
Definition: qimage.h:91
IDirectFBSurface * createDFBSurface(const QImage &image, QImage::Format format, SurfaceCreationOptions options, DFBResult *result=0)
QImage::Format alphaPixmapFormat() const
Format format() const
Returns the format of the image.
Definition: qimage.cpp:2305
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
__int64 qint64
Definition: qglobal.h:942
QImage::Format pixelFormat() const
Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a suppor...
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81
int key
bool hasAlphaChannel() const
static QDirectFBScreen * instance()
qint64 cacheKey() const
Returns a number that identifies the contents of this QImage object.
Definition: qimage.cpp:6282

◆ getTransformationType()

static uint QDirectFBPaintEnginePrivate::getTransformationType ( const QTransform transform)
inlinestatic

Definition at line 76 of file qdirectfbpaintengine.cpp.

Referenced by drawTiledPixmap(), QDirectFBPaintEngine::fillRect(), and setTransform().

77  {
78  int ret = transform.type();
79  if (transform.m11() < 0)
81  if (transform.m22() < 0)
83  return ret;
84  }
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
TransformationType type() const
Returns the transformation type of this matrix.
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237

◆ lock()

void QDirectFBPaintEnginePrivate::lock ( )

Definition at line 980 of file qdirectfbpaintengine.cpp.

981 {
982  // We will potentially get a new pointer to the buffer after a
983  // lock so we need to call the base implementation of prepare so
984  // it updates its rasterBuffer to point to the new buffer address.
986  if (dfbDevice->lockSurface(DSLF_READ|DSLF_WRITE)) {
988  }
989 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QDirectFBPaintDevice * dfbDevice
void prepare(QCustomRasterPaintDevice *)
bool lockSurface(DFBSurfaceLockFlags lockFlags)

◆ prepareForBlit()

void QDirectFBPaintEnginePrivate::prepareForBlit ( uint  blitFlags)

Definition at line 1107 of file qdirectfbpaintengine.cpp.

Referenced by drawTiledPixmap().

1108 {
1109  DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX;
1110 
1111 #if (Q_DIRECTFB_VERSION >= 0x010403)
1113  blittingFlags |= DSBLIT_FLIP_HORIZONTAL;
1114 
1116  blittingFlags |= DSBLIT_FLIP_VERTICAL;
1117 #endif
1118 
1119  if (flags & HasAlpha)
1120  blittingFlags |= DSBLIT_BLEND_ALPHACHANNEL;
1121 
1122  if (opacity != 255) {
1123  blittingFlags |= DSBLIT_BLEND_COLORALPHA;
1124  surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
1125  }
1126 
1127  if (flags & Premultiplied) {
1128  if (blittingFlags & DSBLIT_BLEND_COLORALPHA)
1129  blittingFlags |= DSBLIT_SRC_PREMULTCOLOR;
1130  } else {
1131  if (blittingFlags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA))
1132  blittingFlags |= DSBLIT_SRC_PREMULTIPLY;
1133  }
1134 
1135  surface->SetBlittingFlags(surface, blittingFlags);
1136 }

◆ prepareForDraw()

bool QDirectFBPaintEnginePrivate::prepareForDraw ( const QColor color)

Definition at line 1145 of file qdirectfbpaintengine.cpp.

1146 {
1147  Q_ASSERT(surface);
1149  const quint8 alpha = (opacity == 255 ?
1150  color.alpha() : ALPHA_MUL(color.alpha(), opacity));
1151  QColor col;
1152  if (isPremultiplied) {
1153  col = QColor(ALPHA_MUL(color.red(), alpha),
1154  ALPHA_MUL(color.green(), alpha),
1155  ALPHA_MUL(color.blue(), alpha),
1156  alpha);
1157  } else {
1158  col = QColor(color.red(), color.green(), color.blue(), alpha);
1159  }
1160  surface->SetColor(surface, col.red(), col.green(), col.blue(), col.alpha());
1161 
1162  bool blend = false;
1163 
1164  switch (engine->state()->composition_mode) {
1167  break;
1169  if (alpha == 0)
1170  return false;
1171 
1172  if (alpha != 255)
1173  blend = true;
1174  break;
1175  default:
1176  blend = true;
1177  break;
1178  }
1179 
1180  surface->SetDrawingFlags(surface, blend ? DSDRAW_BLEND : DSDRAW_NOFX);
1181 
1182  return true;
1183 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
QRasterPaintEngineState * state()
QPainter::CompositionMode composition_mode
Definition: qpainter_p.h:174
unsigned char quint8
Definition: qglobal.h:934
ushort red
Returns the red color component of this color.
Definition: qcolor.h:243
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
ushort blue
Returns the blue color component of this color.
Definition: qcolor.h:245
ushort alpha
Returns the alpha color component of this color.
Definition: qcolor.h:242
static uint ALPHA_MUL(uint x, uint a)
ushort green
Returns the green color component of this color.
Definition: qcolor.h:244

◆ setBrush()

void QDirectFBPaintEnginePrivate::setBrush ( const QBrush brush)

Definition at line 1011 of file qdirectfbpaintengine.cpp.

1012 {
1013  supportedBrush = (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased);
1014 }
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182

◆ setCompositionMode()

void QDirectFBPaintEnginePrivate::setCompositionMode ( QPainter::CompositionMode  mode)

Definition at line 1016 of file qdirectfbpaintengine.cpp.

1017 {
1018  if (!surface)
1019  return;
1020 
1021  static const bool forceRasterFallBack = qgetenv("QT_DIRECTFB_FORCE_RASTER").toInt() > 0;
1022  if (forceRasterFallBack) {
1023  supportedComposition = false;
1024  return;
1025  }
1026 
1027  supportedComposition = true;
1028  switch (mode) {
1030  surface->SetPorterDuff(surface, DSPD_CLEAR);
1031  break;
1033  surface->SetPorterDuff(surface, DSPD_SRC);
1034  break;
1036  surface->SetPorterDuff(surface, DSPD_SRC_OVER);
1037  break;
1039  surface->SetPorterDuff(surface, DSPD_DST_OVER);
1040  break;
1042  surface->SetPorterDuff(surface, DSPD_SRC_IN);
1043  break;
1045  surface->SetPorterDuff(surface, DSPD_DST_IN);
1046  break;
1048  surface->SetPorterDuff(surface, DSPD_SRC_OUT);
1049  break;
1051  surface->SetPorterDuff(surface, DSPD_DST_OUT);
1052  break;
1054  surface->SetSrcBlendFunction(surface, DSBF_ZERO);
1055  surface->SetDstBlendFunction(surface, DSBF_ONE);
1056  break;
1057 #if (Q_DIRECTFB_VERSION >= 0x010000)
1059  surface->SetPorterDuff(surface, DSPD_SRC_ATOP);
1060  break;
1062  surface->SetPorterDuff(surface, DSPD_DST_ATOP);
1063  break;
1065  surface->SetPorterDuff(surface, DSPD_ADD);
1066  break;
1068  surface->SetPorterDuff(surface, DSPD_XOR);
1069  break;
1070 #endif
1071  default:
1072  supportedComposition = false;
1073  break;
1074  }
1075 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
int toInt(bool *ok=0, int base=10) const
Returns the byte array converted to an int using base base, which is 10 by default and must be betwee...

◆ setPen()

void QDirectFBPaintEnginePrivate::setPen ( const QPen pen)

Definition at line 1077 of file qdirectfbpaintengine.cpp.

Referenced by setRenderHints(), and setTransform().

1078 {
1079  if (pen.style() == Qt::NoPen) {
1080  supportedPen = true;
1081  } else if (pen.style() == Qt::SolidLine
1082  && !antialiased
1083  && pen.brush().style() == Qt::SolidPattern
1084  && pen.widthF() <= 1.0
1086  supportedPen = true;
1087  } else {
1088  supportedPen = false;
1089  }
1090 }
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
bool isCosmetic() const
Returns true if the pen is cosmetic; otherwise returns false.
Definition: qpen.cpp:840
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition: qpen.cpp:797
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
qreal widthF() const
Returns the pen width with floating point precision.
Definition: qpen.cpp:645

◆ setRenderHints()

void QDirectFBPaintEnginePrivate::setRenderHints ( QPainter::RenderHints  hints)

Definition at line 1098 of file qdirectfbpaintengine.cpp.

1099 {
1100  const bool old = antialiased;
1101  antialiased = bool(hints & QPainter::Antialiasing);
1102  if (old != antialiased) {
1103  setPen(engine->state()->pen);
1104  }
1105 }
QRasterPaintEngineState * state()

◆ setTransform()

void QDirectFBPaintEnginePrivate::setTransform ( const QTransform transforma)

Definition at line 1092 of file qdirectfbpaintengine.cpp.

1093 {
1095  setPen(engine->state()->pen);
1096 }
QRasterPaintEngineState * state()
static uint getTransformationType(const QTransform &transform)

◆ supportsStretchBlit()

bool QDirectFBPaintEnginePrivate::supportsStretchBlit ( ) const

Definition at line 1376 of file qdirectfbpaintengine.cpp.

Referenced by blit(), and drawTiledPixmap().

1377 {
1378 #ifdef QT_DIRECTFB_STRETCHBLIT
1379  DFBGraphicsDeviceDescription desc;
1380 
1381  fb->GetDeviceDescription(fb, &desc);
1382 
1384  || (desc.acceleration_mask & DFXL_STRETCHBLIT);
1385 #else
1386  return false;
1387 #endif
1388 }
QRasterPaintEngineState * state()
QPainter::RenderHints renderHints
Definition: qpainter_p.h:158

◆ systemStateChanged()

void QDirectFBPaintEnginePrivate::systemStateChanged ( )
virtual

◆ unlock() [1/2]

void QDirectFBPaintEnginePrivate::unlock ( )

Definition at line 991 of file qdirectfbpaintengine.cpp.

Referenced by QDirectFBPaintEngine::begin(), QDirectFBPaintEngine::drawPixmap(), and drawTiledPixmap().

992 {
994 #ifdef QT_DIRECTFB_SUBSURFACE
995  dfbDevice->syncPending = true;
996 #else
998 #endif
999 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QDirectFBPaintDevice * dfbDevice

◆ unlock() [2/2]

void QDirectFBPaintEnginePrivate::unlock ( QDirectFBPaintDevice device)
inlinestatic

Definition at line 1001 of file qdirectfbpaintengine.cpp.

1002 {
1003 #ifdef QT_NO_DIRECTFB_SUBSURFACE
1004  Q_ASSERT(device);
1005  device->unlockSurface();
1006 #else
1007  Q_UNUSED(device);
1008 #endif
1009 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#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

◆ updateClip()

void QDirectFBPaintEnginePrivate::updateClip ( )

Definition at line 1350 of file qdirectfbpaintengine.cpp.

Referenced by systemStateChanged().

1351 {
1352  Q_ASSERT(surface);
1353  currentClip = QRect();
1354  const QClipData *clipData = clip();
1355  if (!clipData || !clipData->enabled) {
1356  surface->SetClip(surface, NULL);
1357  clipType = NoClip;
1358  } else if (clipData->hasRectClip) {
1359  const DFBRegion r = {
1360  clipData->clipRect.x(),
1361  clipData->clipRect.y(),
1362  clipData->clipRect.right(),
1363  clipData->clipRect.bottom()
1364  };
1365  surface->SetClip(surface, &r);
1366  currentClip = clipData->clipRect.normalized();
1367  // ### is this guaranteed to always be normalized?
1368  clipType = RectClip;
1369  } else if (clipData->hasRegionClip) {
1370  clipType = RegionClip;
1371  } else {
1373  }
1374 }
QRect normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
Definition: qrect.cpp:322
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
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
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
const QClipData * clip() const

Properties

◆ antialiased

bool QDirectFBPaintEnginePrivate::antialiased

Definition at line 131 of file qdirectfbpaintengine.cpp.

Referenced by setBrush(), setPen(), and setRenderHints().

◆ clipType

ClipType QDirectFBPaintEnginePrivate::clipType

Definition at line 141 of file qdirectfbpaintengine.cpp.

Referenced by rasterFallbackWarn(), and updateClip().

◆ currentClip

QRect QDirectFBPaintEnginePrivate::currentClip

Definition at line 147 of file qdirectfbpaintengine.cpp.

Referenced by drawTiledPixmap(), and updateClip().

◆ dfbDevice

QDirectFBPaintDevice* QDirectFBPaintEnginePrivate::dfbDevice

Definition at line 142 of file qdirectfbpaintengine.cpp.

Referenced by lock(), and unlock().

◆ engine

QDirectFBPaintEngine* QDirectFBPaintEnginePrivate::engine

◆ fb

IDirectFB* QDirectFBPaintEnginePrivate::fb

Definition at line 138 of file qdirectfbpaintengine.cpp.

Referenced by QDirectFBPaintEnginePrivate(), and supportsStretchBlit().

◆ inClip

bool QDirectFBPaintEnginePrivate::inClip

Definition at line 146 of file qdirectfbpaintengine.cpp.

◆ isPremultiplied

bool QDirectFBPaintEnginePrivate::isPremultiplied

Definition at line 144 of file qdirectfbpaintengine.cpp.

Referenced by prepareForDraw().

◆ opacity

quint8 QDirectFBPaintEnginePrivate::opacity

Definition at line 139 of file qdirectfbpaintengine.cpp.

Referenced by prepareForBlit(), and prepareForDraw().

◆ supportedBrush

bool QDirectFBPaintEnginePrivate::supportedBrush

Definition at line 132 of file qdirectfbpaintengine.cpp.

Referenced by rasterFallbackWarn(), and setBrush().

◆ supportedComposition

bool QDirectFBPaintEnginePrivate::supportedComposition

◆ supportedPen

bool QDirectFBPaintEnginePrivate::supportedPen

Definition at line 133 of file qdirectfbpaintengine.cpp.

Referenced by rasterFallbackWarn(), and setPen().

◆ surface

IDirectFBSurface* QDirectFBPaintEnginePrivate::surface

◆ surfaceCache

SurfaceCache* QDirectFBPaintEnginePrivate::surfaceCache

◆ transformationType

uint QDirectFBPaintEnginePrivate::transformationType

Definition at line 135 of file qdirectfbpaintengine.cpp.

Referenced by prepareForBlit(), rasterFallbackWarn(), setPen(), and setTransform().


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