Qt 4.8
Classes | Macros | Enumerations | Functions
qdirectfbpaintengine.cpp File Reference
#include "qdirectfbpaintengine.h"
#include "qdirectfbwindowsurface.h"
#include "qdirectfbscreen.h"
#include "qdirectfbpixmap.h"
#include <directfb.h>
#include <qtransform.h>
#include <qvarlengtharray.h>
#include <qcache.h>
#include <qmath.h>
#include <private/qpixmapdata_p.h>
#include <private/qpixmap_raster_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>

Go to the source code of this file.

Classes

class  QDirectFBPaintEnginePrivate
 
class  SurfaceCache
 

Macros

#define CLIPPED_PAINT(operation)
 
#define RASTERFALLBACK(op, one, two, three)
 
#define VOID_ARG()   static_cast<bool>(false)
 

Enumerations

enum  { RasterWarn = 1, RasterDisable = 2 }
 
enum  PaintOperation {
  DRAW_RECTS = 0x0001, DRAW_LINES = 0x0002, DRAW_IMAGE = 0x0004, DRAW_PIXMAP = 0x0008,
  DRAW_TILED_PIXMAP = 0x0010, STROKE_PATH = 0x0020, DRAW_PATH = 0x0040, DRAW_POINTS = 0x0080,
  DRAW_ELLIPSE = 0x0100, DRAW_POLYGON = 0x0200, DRAW_TEXT = 0x0400, FILL_PATH = 0x0800,
  FILL_RECT = 0x1000, DRAW_COLORSPANS = 0x2000, DRAW_ROUNDED_RECT = 0x4000, DRAW_STATICTEXT = 0x8000,
  ALL = 0xffff
}
 

Functions

static uint ALPHA_MUL (uint x, uint a)
 
template<class T >
static void drawLines (const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface)
 
template<class T >
static void drawPoints (const T *points, int n, const QTransform &transform, IDirectFBSurface *surface)
 
template<class T >
static void drawRects (const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
 
template<class T >
static void fillRects (const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
 
static qreal fixCoord (qreal rect_pos, qreal pixmapSize, qreal offset)
 
static QRect map (const QTransform &transform, const QRect &rect)
 
static QRect map (const QTransform &transform, const QRectF &rect)
 
static QLine map (const QTransform &transform, const QLine &line)
 
static QLine map (const QTransform &transform, const QLineF &line)
 
static QPoint map (const QTransform &transform, const QPoint &point)
 
static QPoint map (const QTransform &transform, const QPointF &point)
 
template<typename T >
const T * ptr (const T &t)
 
template<>
const bool * ptr< bool > (const bool &)
 
static uint rasterFallbacksMask (PaintOperation op)
 
template<typename device , typename T1 , typename T2 , typename T3 >
static void rasterFallbackWarn (const char *msg, const char *func, const device *dev, QDirectFBPaintEnginePrivate *priv, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, const char *nameThree, const T3 &three)
 

Macro Definition Documentation

◆ CLIPPED_PAINT

#define CLIPPED_PAINT (   operation)
Value:
{ \
d->unlock(); \
DFBRegion clipRegion; \
switch (d->clipType) { \
operation; \
break; \
Q_ASSERT(d->clip()); \
const QVector<QRect> cr = d->clip()->clipRegion.rects(); \
const int size = cr.size(); \
for (int i=0; i<size; ++i) { \
d->currentClip = cr.at(i); \
clipRegion.x1 = d->currentClip.x(); \
clipRegion.y1 = d->currentClip.y(); \
clipRegion.x2 = d->currentClip.right(); \
clipRegion.y2 = d->currentClip.bottom(); \
d->surface->SetClip(d->surface, &clipRegion); \
operation; \
} \
d->updateClip(); \
break; } \
qFatal("CLIPPED_PAINT internal error %d", d->clipType); \
break; \
} \
}
double d
Definition: qnumeric_p.h:62

Definition at line 320 of file qdirectfbpaintengine.cpp.

Referenced by QDirectFBPaintEngine::drawImage(), QDirectFBPaintEngine::drawLines(), QDirectFBPaintEngine::drawPixmap(), QDirectFBPaintEngine::drawPoints(), QDirectFBPaintEngine::drawRects(), QDirectFBPaintEngine::drawTiledPixmap(), and QDirectFBPaintEngine::fillRect().

◆ RASTERFALLBACK

#define RASTERFALLBACK (   op,
  one,
  two,
  three 
)
Value:
{ \
static const uint rasterFallbacks = rasterFallbacksMask(op); \
switch (rasterFallbacks) { \
case 0: break; \
case RasterWarn: \
rasterFallbackWarn("Falling back to raster engine for", \
__FUNCTION__, \
state()->painter->device(), \
d_func(), \
#one, one, #two, two, #three, three); \
break; \
case RasterDisable|RasterWarn: \
rasterFallbackWarn("Disabled raster engine operation", \
__FUNCTION__, \
state()->painter->device(), \
d_func(), \
#one, one, #two, two, #three, three); \
case RasterDisable: \
return; \
} \
}
static uint rasterFallbacksMask(PaintOperation op)
unsigned int uint
Definition: qglobal.h:996

Definition at line 288 of file qdirectfbpaintengine.cpp.

Referenced by QDirectFBPaintEngine::drawEllipse(), QDirectFBPaintEngine::drawImage(), QDirectFBPaintEngine::drawLines(), QDirectFBPaintEngine::drawPath(), QDirectFBPaintEngine::drawPixmap(), QDirectFBPaintEngine::drawPoints(), QDirectFBPaintEngine::drawPolygon(), QDirectFBPaintEngine::drawRects(), QDirectFBPaintEngine::drawRoundedRect(), QDirectFBPaintEngine::drawStaticTextItem(), QDirectFBPaintEngine::drawTextItem(), QDirectFBPaintEngine::drawTiledPixmap(), QDirectFBPaintEngine::fill(), QDirectFBPaintEngine::fillRect(), and QDirectFBPaintEngine::stroke().

◆ VOID_ARG

#define VOID_ARG ( )    static_cast<bool>(false)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RasterWarn 
RasterDisable 

Definition at line 206 of file qdirectfbpaintengine.cpp.

◆ PaintOperation

Enumerator
DRAW_RECTS 
DRAW_LINES 
DRAW_IMAGE 
DRAW_PIXMAP 
DRAW_TILED_PIXMAP 
STROKE_PATH 
DRAW_PATH 
DRAW_POINTS 
DRAW_ELLIPSE 
DRAW_POLYGON 
DRAW_TEXT 
FILL_PATH 
FILL_RECT 
DRAW_COLORSPANS 
DRAW_ROUNDED_RECT 
DRAW_STATICTEXT 
ALL 

Definition at line 184 of file qdirectfbpaintengine.cpp.

Function Documentation

◆ ALPHA_MUL()

static uint ALPHA_MUL ( uint  x,
uint  a 
)
inlinestatic

Definition at line 1138 of file qdirectfbpaintengine.cpp.

Referenced by QDirectFBPaintEnginePrivate::prepareForDraw().

1139 {
1140  uint t = x * a;
1141  t = ((t + (t >> 8) + 0x80) >> 8) & 0xff;
1142  return t;
1143 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned int uint
Definition: qglobal.h:996

◆ drawLines()

template<class T >
static void drawLines ( const T *  lines,
int  n,
const QTransform transform,
IDirectFBSurface *  surface 
)
inlinestatic

Definition at line 1452 of file qdirectfbpaintengine.cpp.

Referenced by QPainter::drawLine(), QOpenGLPaintEngine::drawLines(), QPainter::drawLines(), QPaintEngine::setActive(), QOpenGLPaintEngine::state(), QRasterPaintEngine::state(), QPaintBufferEngine::type(), and QPdfBaseEngine::~QPdfBaseEngine().

1453 {
1454  if (n == 1) {
1455  const QLine l = map(transform, lines[0]);
1456  surface->DrawLine(surface, l.x1(), l.y1(), l.x2(), l.y2());
1457  } else {
1458  QVarLengthArray<DFBRegion, 32> lineArray(n);
1459  for (int i=0; i<n; ++i) {
1460  const QLine l = map(transform, lines[i]);
1461  lineArray[i].x1 = l.x1();
1462  lineArray[i].y1 = l.y1();
1463  lineArray[i].x2 = l.x2();
1464  lineArray[i].y2 = l.y2();
1465  }
1466  surface->DrawLines(surface, lineArray.constData(), n);
1467  }
1468 }
The QLine class provides a two-dimensional vector using integer precision.
Definition: qline.h:57
int y1() const
Returns the y-coordinate of the line&#39;s start point.
Definition: qline.h:117
int x2() const
Returns the x-coordinate of the line&#39;s end point.
Definition: qline.h:122
QFactoryLoader * l
int y2() const
Returns the y-coordinate of the line&#39;s end point.
Definition: qline.h:127
static QRect map(const QTransform &transform, const QRect &rect)
int x1() const
Returns the x-coordinate of the line&#39;s start point.
Definition: qline.h:112

◆ drawPoints()

template<class T >
static void drawPoints ( const T *  points,
int  n,
const QTransform transform,
IDirectFBSurface *  surface 
)
inlinestatic

Definition at line 1433 of file qdirectfbpaintengine.cpp.

Referenced by QCosmeticStroker::drawLine(), QOpenGLPaintEngine::drawLines(), QPainter::drawPoint(), QOpenGLPaintEngine::drawPoints(), QPaintEngine::drawPoints(), QPainter::drawPoints(), QPaintEngine::setActive(), QOpenGLPaintEngine::state(), QRasterPaintEngine::state(), QPainter::testRenderHint(), QPaintBufferEngine::type(), and QPdfBaseEngine::~QPdfBaseEngine().

1434 {
1435  if (n == 1) {
1436  const QPoint p = map(transform, points[0]);
1437  surface->FillRectangle(surface, p.x(), p.y(), 1, 1);
1438  } else {
1439  QVarLengthArray<DFBRectangle, 32> rectArray(n);
1440  for (int i=0; i<n; ++i) {
1441  const QPoint p = map(transform, points[i]);
1442  rectArray[i].x = p.x();
1443  rectArray[i].y = p.y();
1444  rectArray[i].w = 1;
1445  rectArray[i].h = 1;
1446  }
1447  surface->FillRectangles(surface, rectArray.constData(), n);
1448  }
1449 }
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
static QRect map(const QTransform &transform, const QRect &rect)

◆ drawRects()

template<class T >
static void drawRects ( const T *  rects,
int  n,
const QTransform transform,
IDirectFBSurface *  surface 
)
inlinestatic

Definition at line 1490 of file qdirectfbpaintengine.cpp.

Referenced by QRasterPaintEngine::drawPolygon(), QPainter::drawRect(), QOpenGLPaintEngine::drawRects(), QPainter::drawRects(), QOpenGLPaintEngine::fill(), QPaintEngine::setActive(), QOpenGLPaintEngine::state(), QRasterPaintEngine::state(), QPaintBufferEngine::type(), and QPdfBaseEngine::~QPdfBaseEngine().

1491 {
1492  for (int i=0; i<n; ++i) {
1493  const QRect r = map(transform, rects[i]);
1494  surface->DrawRectangle(surface, r.x(), r.y(), r.width(), r.height());
1495  }
1496 }
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
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
static QRect map(const QTransform &transform, const QRect &rect)

◆ fillRects()

template<class T >
static void fillRects ( const T *  rects,
int  n,
const QTransform transform,
IDirectFBSurface *  surface 
)
inlinestatic

Definition at line 1471 of file qdirectfbpaintengine.cpp.

1472 {
1473  if (n == 1) {
1474  const QRect r = map(transform, rects[0]);
1475  surface->FillRectangle(surface, r.x(), r.y(), r.width(), r.height());
1476  } else {
1477  QVarLengthArray<DFBRectangle, 32> rectArray(n);
1478  for (int i=0; i<n; ++i) {
1479  const QRect r = map(transform, rects[i]);
1480  rectArray[i].x = r.x();
1481  rectArray[i].y = r.y();
1482  rectArray[i].w = r.width();
1483  rectArray[i].h = r.height();
1484  }
1485  surface->FillRectangles(surface, rectArray.constData(), n);
1486  }
1487 }
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
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
static QRect map(const QTransform &transform, const QRect &rect)

◆ fixCoord()

static qreal fixCoord ( qreal  rect_pos,
qreal  pixmapSize,
qreal  offset 
)
inlinestatic

Definition at line 1240 of file qdirectfbpaintengine.cpp.

Referenced by QDirectFBPaintEnginePrivate::drawTiledPixmap().

1241 {
1242  qreal pos = rect_pos - offset;
1243  while (pos > rect_pos)
1244  pos -= pixmapSize;
1245  while (pos + pixmapSize < rect_pos)
1246  pos += pixmapSize;
1247  return pos;
1248 }
double qreal
Definition: qglobal.h:1193

◆ map() [1/6]

static QRect map ( const QTransform transform,
const QRect rect 
)
inlinestatic

Definition at line 1425 of file qdirectfbpaintengine.cpp.

Referenced by drawLines(), drawPoints(), drawRects(), and fillRects().

1425 { return transform.mapRect(rect); }
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...

◆ map() [2/6]

static QRect map ( const QTransform transform,
const QRectF rect 
)
inlinestatic

Definition at line 1426 of file qdirectfbpaintengine.cpp.

1426 { return transform.mapRect(rect).toRect(); }
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...

◆ map() [3/6]

static QLine map ( const QTransform transform,
const QLine line 
)
inlinestatic

Definition at line 1427 of file qdirectfbpaintengine.cpp.

1427 { return transform.map(line); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ map() [4/6]

static QLine map ( const QTransform transform,
const QLineF line 
)
inlinestatic

Definition at line 1428 of file qdirectfbpaintengine.cpp.

1428 { return transform.map(line).toLine(); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ map() [5/6]

static QPoint map ( const QTransform transform,
const QPoint point 
)
inlinestatic

Definition at line 1429 of file qdirectfbpaintengine.cpp.

1429 { return transform.map(point); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ map() [6/6]

static QPoint map ( const QTransform transform,
const QPointF point 
)
inlinestatic

Definition at line 1430 of file qdirectfbpaintengine.cpp.

1430 { return transform.map(point).toPoint(); }
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...

◆ ptr()

template<typename T >
const T* ptr ( const T &  t)
inline

Definition at line 1498 of file qdirectfbpaintengine.cpp.

Referenced by _decOctet(), _fragment(), _getWord0(), _getWord1(), _HEXDIG(), _hierPart(), _host(), _IPLiteral(), _IPv4Address(), _IPv6Address(), _IPvFuture(), _ls32(), _pctEncoded(), _port(), QProcessPrivate::_q_canReadStandardError(), QProcessPrivate::_q_canReadStandardOutput(), _q_ia64_fetchadd_immediate(), QHttpPrivate::_q_slotReadyRead(), _query(), _scheme(), _setWord0(), _setWord1(), _subDelims(), _unreserved(), _userInfo(), QNetworkManagerEngine::activationFinished(), QNetworkManagerEngine::activeConnectionPropertiesChanged(), QIcdEngine::addConfiguration(), QConnmanEngine::addServiceConfiguration(), QNetworkConfigurationManagerPrivate::allConfigurations(), QNetworkInterfaceManager::allInterfaces(), QHashData::allocateNode(), QPMCache::allPixmaps(), buttonChange(), QNetworkManagerEngine::bytesReceived(), QNetworkManagerEngine::bytesWritten(), QVariant::canConvert(), QUrlPrivate::canonicalHost(), QMetaObject::changeGuard(), QNetworkConfigurationManagerPrivate::configurationAdded(), QConnmanEngine::configurationChange(), QNetworkConfigurationManagerPrivate::configurationChanged(), QNetworkConfigurationManagerPrivate::configurationRemoved(), QIcdEngine::connectionStateSignalsSlot(), QCoreWlanEngine::connectToId(), connManager(), construct(), QScriptEngine::convert(), convertFlags(), QCP949Codec::convertFromUnicode(), QScriptEnginePrivate::convertNumber(), QScriptEnginePrivate::convertString(), QScriptEnginePrivate::convertValue(), QScriptEnginePrivate::create(), createInterfaces(), QNetworkConfigurationManagerPrivate::defaultConfiguration(), QIcdEngine::deleteConfiguration(), QDBusConnectionPrivate::deliverCall(), QLocalSocketPrivate::destroyPipeHandles(), QAxBasePrivate::dispatch(), QTranslatorPrivate::do_load(), QGenericEngine::doRequestUpdate(), QIcdEngine::doRequestUpdate(), downloadBufferDeleter(), QGraphicsScenePrivate::draw(), QPaintEngineEx::drawEllipse(), QIcdEngine::ensureDBusConnection(), QPixmapCache::find(), QAbstractSocketPrivate::flush(), QScanThread::foundNetwork(), QScriptEngine::fromScriptValue(), QScriptEnginePrivate::get(), QIcdEngine::getIcdInitialState(), QIcdEngine::icdServiceOwnerChanged(), QRingBuffer< T >::indexOf(), QXcbConnection::initializeAllAtoms(), QTestLiteStaticInfoPrivate::initializeAllAtoms(), interfaceListing(), interfaceListingWin2k(), interfaceListingWinXP(), QNetworkManagerEngine::interfacePropertiesChanged(), QtSharedPointer::internalSafetyCheckRemove(), ipv4Netmasks(), QBasicAtomicPointer< QBrushData >::isFetchAndAddWaitFree(), QOCIResult::lastInsertId(), QFSFileEnginePrivate::longFileName(), QFSFileEnginePrivate::map(), myalloc(), QFSFileEnginePrivate::nativeRead(), QFSFileEnginePrivate::nativeWrite(), QCoreWlanEngine::networksChanged(), QNlaEngine::networksChanged(), QNetworkManagerEngine::newAccessPoint(), QNetworkManagerEngine::newConnection(), QPMCache::object(), QScriptValuePrivate::operator delete(), QExplicitlySharedDataPointer< QSslConfigurationPrivate >::operator!=(), QModelIndex::operator<(), QExplicitlySharedDataPointer< QSslConfigurationPrivate >::operator==(), QTextStream::operator>>(), QTest::outputMessage(), QUrlPrivate::parse(), QNetworkManagerEngine::parseConnection(), QDirectFBWindowSurface::permanentState(), QWSLocalMemSurface::permanentState(), QWSSharedMemSurface::permanentState(), QWSOnScreenSurface::permanentState(), QWSYellowSurface::permanentState(), QRingBuffer< T >::putChar(), q_strchr(), QAxBasePrivate::QAxBasePrivate(), qdbus_resolve_me(), qFieldSerial(), qFreeAligned(), qGetPtrHelper(), qIterGet(), qPixmapSerial(), qt_atomic_tasb(), qt_load_library_runtime(), qt_message_output(), qt_socks5_set_host_address_and_port(), qt_socks5_set_host_name_and_port(), qt_x11_create_intern_atoms(), rasterFallbackWarn(), QRfbDualColorHextile< SRC >::read(), QRingBuffer< T >::read(), QRfbMultiColorHextile< SRC >::read(), QAbstractSocket::readData(), QProcess::readData(), QAbstractSocketPrivate::readFromSocket(), QRfbMultiColorHextile< SRC >::rectx(), QRfbMultiColorHextile< SRC >::recty(), QFactoryLoader::refreshAll(), QDeclarativeEnginePrivate::registerCompositeType(), QDynamicFileResourceRoot::registerSelf(), QNetworkManagerEngine::removeAccessPoint(), QBBEngine::removeConfiguration(), QConnmanEngine::removeConfiguration(), QNetworkManagerEngine::removeConnection(), QMetaObject::removeGuard(), QNativeWifiEngine::scanComplete(), QScript::scriptableFromQObject(), QTest::sendKeyEvent(), QGenericEngine::sessionStateForId(), QBBEngine::sessionStateForId(), QCoreWlanEngine::sessionStateForId(), QNativeWifiEngine::sessionStateForId(), QNetworkManagerEngine::sessionStateForId(), QConnmanEngine::sessionStateForId(), QNlaEngine::sessionStateForId(), QDBusContextPrivate::set(), QNetmaskAddress::setAddress(), QWSRegionCommand::setData(), QPluginLoader::setFileName(), QRfbMultiColorHextile< SRC >::setHeight(), QDirectFBWindowSurface::setPermanentState(), QWSLocalMemSurface::setPermanentState(), QWSSharedMemSurface::setPermanentState(), QWSOnScreenSurface::setPermanentState(), QWSYellowSurface::setPermanentState(), QNetworkSessionPrivate::setPrivateConfiguration(), QRfbMultiColorHextile< SRC >::setWidth(), QRfbMultiColorHextile< SRC >::setX(), QRfbMultiColorHextile< SRC >::setY(), QLocalSocketPrivate::startAsyncRead(), QNetworkSessionPrivateImpl::syncStateWithInterface(), QDBusDemarshaller::toVariantInternal(), QSslSocketBackendPrivate::transmit(), QFSFileEnginePrivate::unmap(), QNetworkManagerEngine::updateAccessPoint(), QBBEngine::updateConfiguration(), QNetworkManagerEngine::updateConnection(), voidptr_destructor(), QOstDevice::writeData(), QAbstractSocket::writeData(), and QAxBasePrivate::~QAxBasePrivate().

1498 { return &t; }

◆ ptr< bool >()

template<>
const bool* ptr< bool > ( const bool &  )
inline

Definition at line 1499 of file qdirectfbpaintengine.cpp.

1499 { return 0; }

◆ rasterFallbacksMask()

static uint rasterFallbacksMask ( PaintOperation  op)
inlinestatic

Definition at line 207 of file qdirectfbpaintengine.cpp.

208 {
209  uint ret = 0;
210 #ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS
211  if (op & QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)
212  ret |= RasterWarn;
213 #endif
214 #ifdef QT_DIRECTFB_DISABLE_RASTERFALLBACKS
215  if (op & QT_DIRECTFB_DISABLE_RASTERFALLBACKS)
216  ret |= RasterDisable;
217 #endif
218  static int warningMask = -1;
219  static int disableMask = -1;
220  if (warningMask < 0) {
221  struct {
222  const char *name;
223  PaintOperation operation;
224  } const operations[] = {
225  { "DRAW_RECTS", DRAW_RECTS },
226  { "DRAW_LINES", DRAW_LINES },
227  { "DRAW_IMAGE", DRAW_IMAGE },
228  { "DRAW_PIXMAP", DRAW_PIXMAP },
229  { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP },
230  { "STROKE_PATH", STROKE_PATH },
231  { "DRAW_PATH", DRAW_PATH },
232  { "DRAW_POINTS", DRAW_POINTS },
233  { "DRAW_ELLIPSE", DRAW_ELLIPSE },
234  { "DRAW_POLYGON", DRAW_POLYGON },
235  { "DRAW_TEXT", DRAW_TEXT },
236  { "FILL_PATH", FILL_PATH },
237  { "FILL_RECT", FILL_RECT },
238  { "DRAW_COLORSPANS", DRAW_COLORSPANS },
239  { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT },
240  { "ALL", ALL },
241  { 0, ALL }
242  };
243 
244  QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
246  QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
248  warningMask = 0;
249  disableMask = 0;
250  if (!warning.isEmpty() || !disable.isEmpty()) {
251  for (int i=0; operations[i].name; ++i) {
252  const QString name = QString::fromLatin1(operations[i].name);
253  int idx = warning.indexOf(name);
254  if (idx != -1) {
255  warningMask |= operations[i].operation;
256  warning.erase(warning.begin() + idx);
257  }
258  idx = disable.indexOf(name);
259  if (idx != -1) {
260  disableMask |= operations[i].operation;
261  disable.erase(disable.begin() + idx);
262  }
263  }
264  }
265  if (!warning.isEmpty()) {
266  qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s",
267  qPrintable(warning.join(QLatin1String("|"))));
268  }
269  if (!disable.isEmpty()) {
270  qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s",
271  qPrintable(disable.join(QLatin1String("|"))));
272  }
273  }
274  if (op & warningMask)
275  ret |= RasterWarn;
276  if (op & disableMask)
277  ret |= RasterDisable;
278  return ret;
279 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlist.h:267
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
int indexOf(const QRegExp &rx, int from=0) const
Returns the index position of the first exact match of rx in the list, searching forward from index p...
Definition: qstringlist.h:195
const char * name
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
Q_CORE_EXPORT void qWarning(const char *,...)
unsigned int uint
Definition: qglobal.h:996
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QString join(const QString &sep) const
Joins all the string list&#39;s strings into a single string with each element separated by the given sep...
Definition: qstringlist.h:162
iterator erase(iterator pos)
Removes the item associated with the iterator pos from the list, and returns an iterator to the next ...
Definition: qlist.h:464
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
#define qPrintable(string)
Definition: qglobal.h:1750
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ rasterFallbackWarn()

template<typename device , typename T1 , typename T2 , typename T3 >
static void rasterFallbackWarn ( const char *  msg,
const char *  func,
const device *  dev,
QDirectFBPaintEnginePrivate priv,
const char *  nameOne,
const T1 &  one,
const char *  nameTwo,
const T2 &  two,
const char *  nameThree,
const T3 &  three 
)
static

Definition at line 1501 of file qdirectfbpaintengine.cpp.

Referenced by rasterFallbacksMask().

1506 {
1507  QString out;
1508  QDebug dbg(&out);
1509 
1510 
1511  dbg << "***";
1512 
1513 
1514  dbg << msg << (QByteArray(func) + "()") << "painting on";
1515  if (dev->devType() == QInternal::Widget) {
1516  dbg << static_cast<const QWidget*>(dev);
1517  } else {
1518  dbg << dev << "of type" << dev->devType();
1519  }
1520 
1521  dbg << "\n\t";
1522 
1523 
1524  dbg << ((priv->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) ? "*" : "") << QString::fromLatin1("transformationType 0x%1").arg(priv->transformationType, 3, 16, QLatin1Char('0'));
1525 
1526  dbg << priv->engine->state()->matrix;
1527 
1528  dbg << "\n\t";
1529 
1530 
1531 
1532  dbg << (priv->supportedBrush ? "" : "*") << "supportedBrush" << priv->supportedBrush;
1533 
1534  dbg << priv->engine->state()->brush;
1535 
1536  dbg << "\n\t";
1537 
1538  const QGradient *gradient = priv->engine->state()->brush.gradient();
1539  if (gradient) {
1540  const QGradientStops &stops = gradient->stops();
1541 
1542  dbg << "gradient: " << *gradient;
1543  dbg << "stops: " << stops.count();
1544  dbg << "\n\t";
1545 
1546  for (int i=0; i<stops.count(); i++) {
1547  dbg << stops[i].first << stops[i].second;
1548  }
1549  dbg << "\n\t";
1550  }
1551 
1552 
1553  dbg << (priv->supportedPen ? "" : "*") << "supportedPen" << priv->supportedPen;
1554 
1555  dbg << priv->engine->state()->pen;
1556 
1557  dbg << "\n\t";
1558 
1559 
1560 
1561  dbg << (priv->clipType == QDirectFBPaintEnginePrivate::ComplexClip ? "*" : "") << "clipType" << priv->clipType;
1562 
1563  dbg << "\n\t";
1564 
1565 
1566  dbg << (priv->supportedComposition ? "" : "*") << "supportedComposition" << priv->supportedComposition;
1567 
1568  dbg << "\n\t";
1569 
1570 
1571  const T1 *t1 = ptr(one);
1572  const T2 *t2 = ptr(two);
1573  const T3 *t3 = ptr(three);
1574 
1575  if (t1) {
1576  dbg << nameOne << *t1;
1577  if (t2) {
1578  dbg << nameTwo << *t2;
1579  if (t3) {
1580  dbg << nameThree << *t3;
1581  }
1582  }
1583  }
1584  qWarning("%s", qPrintable(out));
1585 }
The QDebug class provides an output stream for debugging information.
Definition: qdebug.h:62
QRasterPaintEngineState * state()
const QGradient * gradient() const
Returns the gradient describing this brush.
Definition: qbrush.cpp:871
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
T & first()
Returns a reference to the first item in the vector.
Definition: qvector.h:260
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QTransform matrix
Definition: qpainter_p.h:161
The QString class provides a Unicode character string.
Definition: qstring.h:83
QGradientStops stops() const
Returns the stop points for this gradient.
Definition: qbrush.cpp:1520
Q_CORE_EXPORT void qWarning(const char *,...)
const T * ptr(const T &t)
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
The QGradient class is used in combination with QBrush to specify gradient fills. ...
Definition: qbrush.h:201
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
QBrush brush
Definition: qpainter_p.h:153
#define qPrintable(string)
Definition: qglobal.h:1750
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55