42 #include <QtCore/qglobal.h> 43 #include <QtCore/qmutex.h> 45 #define QT_FT_BEGIN_HEADER 46 #define QT_FT_END_HEADER 48 #include <private/qrasterdefs_p.h> 49 #include <private/qgrayraster_p.h> 58 #if defined (Q_WS_X11) 59 # include <private/qfontengine_ft_p.h> 64 #include <private/qmath_p.h> 65 #include <private/qtextengine_p.h> 66 #include <private/qfontengine_p.h> 67 #include <private/qpixmap_raster_p.h> 70 #include <private/qimage_p.h> 71 #include <private/qstatictext_p.h> 72 #include <private/qcosmeticstroker_p.h> 82 # include <private/qfontengine_p.h> 83 # if defined(Q_OS_WINCE) 86 #elif defined(Q_WS_MAC) 87 # include <private/qt_mac_p.h> 88 # include <private/qpixmap_mac_p.h> 89 # include <private/qpaintengine_mac_p.h> 90 #elif defined(Q_WS_QWS) 91 # if !defined(QT_NO_FREETYPE) 92 # include <private/qfontengine_ft_p.h> 94 # if !defined(QT_NO_QWS_QPF2) 95 # include <private/qfontengine_qpf_p.h> 97 # include <private/qabstractfontengine_p.h> 98 #elif defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) 99 # include <private/qfontengine_s60_p.h> 100 #elif defined(Q_WS_QPA) 101 # include <private/qfontengine_ft_p.h> 104 #if defined(Q_WS_WIN64) 113 #define qreal_to_fixed_26_6(f) (int(f * 64)) 114 #define qt_swap_int(x, y) { int tmp = (x); (x) = (y); (y) = tmp; } 115 #define qt_swap_qreal(x, y) { qreal tmp = (x); (x) = (y); (y) = tmp; } 119 void dumpClip(
int width,
int height,
const QClipData *clip);
122 #define QT_FAST_SPANS 128 #define int_dim(pos, dim) (int(pos+dim) - int(pos)) 176 const QPointF *last = points + pointCount;
177 qreal minx, maxx, miny, maxy;
178 minx = maxx = e->
x();
179 miny = maxy = e->
y();
183 else if (e->
x() > maxx)
187 else if (e->
y() > maxy)
194 template <
typename T>
static inline bool isRect(
const T *pts,
int elementCount) {
195 return (elementCount == 5
196 && pts[0] == pts[8] && pts[1] == pts[9]
197 && pts[0] == pts[6] && pts[2] == pts[4]
198 && pts[1] == pts[3] && pts[5] == pts[7]
199 && pts[0] < pts[4] && pts[1] < pts[5]
202 && pts[0] == pts[6] && pts[2] == pts[4]
203 && pts[1] == pts[3] && pts[5] == pts[7]
204 && pts[0] < pts[4] && pts[1] < pts[5]
230 #if !defined(QT_NO_DEBUG) && 0 233 const char *names[] = {
240 fprintf(stderr,
"\nQPainterPath: elementCount=%d\n", path.
elementCount());
244 fprintf(stderr,
" - %3d:: %s, (%.2f, %.2f)\n", i, names[e.
type], e.
x, e.
y);
323 d_func()->device = device;
333 d_func()->device = device;
356 d->outlinemapper_xform_dirty =
true;
362 d->baseClip.reset(
new QClipData(
d->device->height()));
363 d->baseClip->setClipRect(
QRect(0, 0,
d->device->width(),
d->device->height()));
365 d->image_filler.init(
d->rasterBuffer.data(),
this);
368 d->image_filler_xform.init(
d->rasterBuffer.data(),
this);
371 d->solid_color_filler.init(
d->rasterBuffer.data(),
this);
374 d->deviceDepth =
d->device->depth();
376 d->mono_surface =
false;
381 switch (
d->device->devType()) {
383 qWarning(
"QRasterPaintEngine: unsupported for pixmaps...");
386 format =
d->rasterBuffer->prepare(static_cast<QImage *>(
d->device));
390 d->rasterBuffer->prepare(static_cast<QCustomRasterPaintDevice*>(
d->device));
394 qWarning(
"QRasterPaintEngine: unsupported target device %d\n",
d->device->devType());
402 d->mono_surface =
true;
459 d->systemStateChanged();
463 d->outlineMapper->m_clip_rect =
d->deviceRect;
470 d->rasterizer->setClipRect(
d->deviceRect);
475 d->basicStroker.setClipRect(
d->deviceRect);
485 qDebug() <<
"QRasterPaintEngine::begin(" << (
void *) device
486 <<
") devType:" << device->
devType()
487 <<
"devRect:" <<
d->deviceRect;
489 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->baseClip);
493 #if defined(Q_WS_WIN) 494 d->isPlain45DegreeRotation =
true;
499 #if defined(Q_WS_WIN) 501 #elif defined (Q_WS_MAC) 526 qDebug() <<
"QRasterPaintEngine::end devRect:" <<
d->deviceRect;
528 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->baseClip);
550 return QSize(
d->rasterBuffer->width(),
d->rasterBuffer->height());
560 d->rasterBuffer->bufferImage().save(s,
"PNG");
603 d->isPlain45DegreeRotation =
false;
605 d->isPlain45DegreeRotation =
633 if (
flags.has_clip_ownership)
650 flags.fast_pen =
true;
651 flags.antialiased =
false;
652 flags.bilinear =
false;
653 flags.fast_text =
true;
654 flags.int_xform =
true;
655 flags.tx_noshear =
true;
656 flags.fast_images =
true;
659 flags.has_clip_ownership =
false;
669 , strokeFlags(s.strokeFlags)
670 , lastBrush(s.lastBrush)
671 , brushData(s.brushData)
672 , fillFlags(s.fillFlags)
673 , pixmapFlags(s.pixmapFlags)
674 , intOpacity(s.intOpacity)
678 , flag_bits(s.flag_bits)
725 qDebug() <<
"QRasterPaintEngine::penChanged():" <<
state()->pen;
729 s->
dirty |= DirtyPen;
740 qDebug() <<
"QRasterPaintEngine::updatePen():" << s->
pen;
770 d->basicStroker.setStrokeWidth(1);
772 d->basicStroker.setStrokeWidth(penWidth);
780 d->dashStroker->setClipRect(
d->deviceRect);
784 d->dashStroker->setClipRect(clipRect);
827 qDebug() <<
"QRasterPaintEngine::brushChanged():" << s->
brush;
841 qDebug() <<
"QRasterPaintEngine::updateBrush()" <<
brush;
850 d_func()->updateMatrixData(&s->
brushData, brush,
d->brushMatrix());
865 if (s->
dirty & DirtyTransform)
868 if (s->
dirty & (DirtyPen|DirtyCompositionMode|DirtyOpacity)) {
889 qDebug() <<
"QRasterPaintEngine::opacityChanged()" << s->
opacity;
895 s->
dirty |= DirtyOpacity;
912 s->
dirty |= DirtyCompositionMode;
917 d->recalculateFastImages();
946 d->recalculateFastImages();
957 qDebug() <<
"QRasterPaintEngine::transformChanged()" << s->
matrix;
963 s->
dirty |= DirtyTransform;
966 d->recalculateFastImages();
991 rasterBuffer->prepare(device);
1002 if (alpha == 0 || !clip.
isValid())
1009 int srcSize = img.
depth() >> 3;
1010 int iw = img.
width();
1017 srcBits += ((sr.
y() * srcBPL) + sr.
x() * srcSize);
1023 int cx2 = clip.
x() + clip.
width();
1026 srcBits += srcSize *
d;
1031 int d = x + iw - cx2;
1039 int cy2 = clip.
y() + clip.
height();
1043 srcBits += srcBPL *
d;
1048 int d = y + ih - cy2;
1055 int dstSize = rasterBuffer->bytesPerPixel();
1056 int dstBPL = rasterBuffer->bytesPerLine();
1057 func(rasterBuffer->buffer() + x * dstSize + y * dstBPL, dstBPL,
1066 deviceRectUnclipped =
QRect(0, 0,
1070 if (!systemClip.isEmpty()) {
1071 QRegion clippedDeviceRgn = systemClip & deviceRectUnclipped;
1073 baseClip->setClipRegion(clippedDeviceRgn);
1075 deviceRect = deviceRectUnclipped;
1076 baseClip->setClipRect(deviceRect);
1078 #ifdef QT_DEBUG_DRAW 1079 qDebug() <<
"systemStateChanged" <<
this <<
"deviceRect" << deviceRect << deviceRectUnclipped << systemClip;
1082 exDeviceRect = deviceRect;
1096 bool bilinear = q->state()->flags.bilinear;
1111 spanData->
dx = -m.
dx();
1112 spanData->
dy = -m.
dy();
1125 #ifdef QT_CLIPPING_RATIOS 1138 if ((totalClips % 5000) == 0) {
1139 printf(
"Clipping ratio: rectangular=%f%%, region=%f%%, complex=%f%%\n",
1140 rectClips * 100.0 / (
qreal) totalClips,
1141 regionClips * 100.0 / (
qreal) totalClips,
1142 (totalClips - rectClips - regionClips) * 100.0 / (
qreal) totalClips);
1168 #ifdef QT_DEBUG_DRAW 1180 #ifdef QT_DEBUG_DRAW 1181 qDebug() <<
"QRasterPaintEngine::clip(): " << path << op;
1186 <<
'(' << path.
points()[i*2] <<
", " << path.
points()[i*2+1] <<
')';
1191 <<
'(' << path.
points()[i*2] <<
", " << path.
points()[i*2+1] <<
')';
1212 #ifdef QT_DEBUG_DRAW 1213 qDebug() <<
" --- optimizing vector clip to rect clip...";
1216 QRectF r(points[0], points[1], points[4]-points[0], points[5]-points[1]);
1217 if (setClipRectInDeviceCoords(s->
matrix.
mapRect(r).toRect(), op))
1242 ensureOutlineMapper();
1275 #ifdef QT_DEBUG_DRAW 1276 qDebug() <<
"QRasterPaintEngine::clip(): " << rect << op;
1288 }
else if (!setClipRectInDeviceCoords(s->
matrix.
mapRect(rect), op)) {
1351 #ifdef QT_DEBUG_DRAW 1352 qDebug() <<
"QRasterPaintEngine::clip(): " << region << op;
1406 #ifdef QT_DEBUG_DRAW 1410 if (!fillData->
blend)
1431 ensureOutlineMapper();
1440 bool rectClipped =
true;
1455 x1 =
qMax(r.
x(), 0);
1457 y1 =
qMax(r.
y(), 0);
1461 if (x2 <= x1 || y2 <= y1)
1464 const int width = x2 - x1;
1465 const int height = y2 - y1;
1467 bool isUnclipped = rectClipped
1470 if (pe && isUnclipped) {
1485 const int nspans = 256;
1491 int n =
qMin(nspans, y2 - y);
1495 spans[i].
len = width;
1501 blend(n, spans, data);
1511 #ifdef QT_DEBUG_DRAW 1512 qDebug(
" - QRasterPaintEngine::drawRect(), rectCount=%d", rectCount);
1522 const QRect *r = rects;
1523 const QRect *lastRect = rects + rectCount;
1525 int offset_x = int(s->
matrix.
dx());
1526 int offset_y = int(s->
matrix.
dy());
1527 while (r < lastRect) {
1535 for (
int i=0; i<rectCount; ++i) {
1537 fill(path, s->
brush);
1547 for (
int i = 0; i < rectCount; ++i) {
1552 for (
int i = 0; i < rectCount; ++i) {
1554 stroke(path, s->
pen);
1565 #ifdef QT_DEBUG_DRAW 1566 qDebug(
" - QRasterPaintEngine::drawRect(QRectF*), rectCount=%d", rectCount);
1568 #ifdef QT_FAST_SPANS 1578 for (
int i = 0; i < rectCount; ++i) {
1593 for (
int i = 0; i < rectCount; ++i) {
1598 for (
int i = 0; i < rectCount; ++i) {
1607 #endif // QT_FAST_SPANS 1634 qreal patternLength = 0;
1636 for (
int i = 0; i < pattern.
size(); ++i)
1637 patternLength += pattern.
at(i);
1639 if (patternLength > 0) {
1640 int n =
qFloor(dashOffset / patternLength);
1641 dashOffset -= n * patternLength;
1642 while (dashOffset >= pattern.
at(dashIndex)) {
1643 dashOffset -= pattern.
at(dashIndex);
1644 if (++dashIndex >= pattern.
size())
1655 for (
int i = 0; i < lineCount; ++i) {
1656 if (lines[i].p1() == lines[i].
p2()) {
1673 &dashIndex, &dashOffset, &inDash);
1693 return QRect(x1, y1, x2 - x1, y2 - y1);
1703 #ifdef QT_DEBUG_DRAW 1705 qDebug() <<
"QRasterPaintEngine::fill(): " 1707 <<
", hints=" <<
hex << path.
hints()
1759 ensureOutlineMapper();
1797 ensureOutlineMapper();
1798 fillPath(path, data);
1806 #ifdef QT_DEBUG_DRAW 1807 qDebug() <<
"QRasterPaintEngine::fillRecct(): " << r <<
brush;
1823 #ifdef QT_DEBUG_DRAW 1824 qDebug() <<
"QRasterPaintEngine::fillRect(): " << r << color;
1841 return a->
y() < b->
y();
1854 upper->
reserve(pointCount * 3 / 4);
1855 lower->
reserve(pointCount * 3 / 4);
1857 for (
int i = 0; i < pointCount; ++i)
1858 sorted << points + i;
1865 const QPointF *last = end - 1;
1869 for (
const QPointF *p = points; p <
end; ++p) {
1870 int side = p->y() < splitY;
1871 int lastSide = last->
y() < splitY;
1873 if (side != lastSide) {
1877 bin[side]->
append(*last);
1880 QPointF intersection(p->x() + delta.
x() * (splitY - p->y()) / delta.
y(), splitY);
1882 bin[0]->
append(intersection);
1883 bin[1]->
append(intersection);
1893 return upper->
size() < pointCount && lower->size() < pointCount;
1904 const int maxPoints = 0xffff;
1907 if (pointCount > maxPoints) {
1910 if (
splitPolygon(points, pointCount, &upper, &lower)) {
1914 qWarning(
"Polygon too complex for filling.");
1921 ensureOutlineMapper();
1938 #ifdef QT_DEBUG_DRAW 1939 qDebug(
" - QRasterPaintEngine::drawPolygon(F), pointCount=%d", pointCount);
1940 for (
int i=0; i<pointCount; ++i)
1941 qDebug() <<
" - " << points[i];
1945 if (mode != PolylineMode &&
isRect((
qreal *) points, pointCount)) {
1946 QRectF r(points[0], points[2]);
1952 if (mode != PolylineMode) {
1956 fillPolygon(points, pointCount, mode);
1979 #ifdef QT_DEBUG_DRAW 1980 qDebug(
" - QRasterPaintEngine::drawPolygon(I), pointCount=%d", pointCount);
1981 for (
int i=0; i<pointCount; ++i)
1982 qDebug() <<
" - " << points[i];
1985 if (mode != PolylineMode &&
isRect((
int *) points, pointCount)) {
1986 QRect r(points[0].x(),
1988 points[2].x() - points[0].x(),
1989 points[2].y() - points[0].y());
1997 if (mode != PolylineMode) {
2001 ensureOutlineMapper();
2004 const QPoint *p = points;
2005 const QPoint *ep = points + pointCount - 1;
2020 int count = pointCount * 2;
2023 for (
int i=0; i<count; i+=2) {
2024 fpoints[i] = ((
int *) points)[i+1];
2025 fpoints[i+1] = ((
int *) points)[i];
2028 for (
int i=0; i<count; ++i)
2029 fpoints[i] = ((
int *) points)[i];
2047 #ifdef QT_DEBUG_DRAW 2048 qDebug() <<
" - QRasterPaintEngine::drawPixmap(), pos=" << pos <<
" pixmap=" << pixmap.
size() <<
"depth=" << pixmap.
depth();
2054 if (image.
depth() == 1) {
2068 if (pixmap.
depth() == 1) {
2088 #ifdef QT_DEBUG_DRAW 2089 qDebug() <<
" - QRasterPaintEngine::drawPixmap(), r=" << r <<
" sr=" << sr <<
" pixmap=" << pixmap.
size() <<
"depth=" << pixmap.
depth();
2095 if (image.
depth() == 1) {
2108 drawImage(r, image, sr);
2114 if (image.
depth() == 1) {
2127 drawImage(r, image, translatedSource);
2135 const int x =
qRound(rect.
x());
2136 const int y =
qRound(rect.
y());
2137 const int w = int(rect.
width() +
qreal(0.5));
2140 return QRect(x, y, w, h);
2145 const int iv = int(v);
2154 const int xmin = int(rect.
x());
2156 const int ymin = int(rect.
y());
2158 return QRect(xmin, ymin, xmax - xmin, ymax - ymin);
2166 #ifdef QT_DEBUG_DRAW 2167 qDebug() <<
" - QRasterPaintEngine::drawImage(), p=" << p <<
" image=" << img.
size() <<
"depth=" << img.
depth();
2245 inline bool isPixelAligned(
const QRectF &rect) {
2254 Qt::ImageConversionFlags)
2256 #ifdef QT_DEBUG_DRAW 2257 qDebug() <<
" - QRasterPaintEngine::drawImage(), r=" << r <<
" sr=" << sr <<
" image=" << img.
size() <<
"depth=" << img.
depth();
2286 ((((color & 0x00ff00ff) * s->
intOpacity) >> 8) & 0x00ff00ff)
2287 | ((((color & 0xff00ff00) >> 8) * s->
intOpacity) & 0xff00ff00);
2329 || (isPixelAligned(transformedTargetRect) && isPixelAligned(sr)))
2332 if (clippedTransformedTargetRect.
isNull())
2337 QRect clippedSourceRect
2338 =
QRectF(sr.
x() + clippedTargetRect.
x() - r.
x(), sr.
y() + clippedTargetRect.
y() - r.
y(),
2339 clippedTargetRect.
width(), clippedTargetRect.
height()).toRect();
2347 const uchar *srcBase = img.
bits() + clippedSourceRect.
y() * sbpl + clippedSourceRect.
x() * bpp;
2348 uchar *dstBase = dst + clippedTransformedTargetRect.
y() * dbpl + clippedTransformedTargetRect.
x() * bpp;
2363 bool exceedsPrecision = targetBounds.
width() > 0xffff
2364 || targetBounds.
height() > 0xffff;
2418 #ifdef QT_FAST_SPANS 2443 m.
m31() - offs, m.
m32() - offs, m.
m33());
2471 const int x1 =
qRound(rr.
x());
2472 const int y1 =
qRound(rr.
y());
2485 #ifdef QT_DEBUG_DRAW 2486 qDebug() <<
" - QRasterPaintEngine::drawTiledPixmap(), r=" << r <<
"pixmap=" << pixmap.
size();
2500 if (image.
depth() == 1)
2513 #ifdef QT_FAST_SPANS 2551 return (s[x>>3] << (x&7)) & 0x80;
2567 const QRect rect(rx, ry, w, h);
2569 bool unclipped =
false;
2576 unclipped = rx > clip->
xmin 2577 && rx + w < clip->
xmax 2579 && ry + h < clip->
ymax;
2592 const bool contains = rect.
left() >= 0 && rect.
right() < rb->
width()
2599 const uchar * scanline =
static_cast<const uchar *
>(src);
2606 scanline, w, h, bpl);
2609 }
else if (depth == 8) {
2612 scanline, w, h, bpl, 0);
2615 }
else if (depth == 32) {
2619 (
const uint *) scanline, w, h, bpl / 4, 0);
2623 }
else if (d->
deviceDepth == 32 && (depth == 8 || depth == 32)) {
2626 int nx =
qMax(0, rx);
2627 int ny =
qMax(0, ry);
2630 int xdiff = nx - rx;
2631 int ydiff = ny - ry;
2632 scanline += ydiff * bpl;
2633 scanline += xdiff * (depth == 32 ? 4 : 1);
2648 scanline, w, h, bpl, clip);
2651 (
const uint *) scanline, w, h, bpl / 4, clip);
2666 scanline += bpl * y0;
2673 if (w <= 0 || h <= 0)
2676 const int NSPANS = 256;
2677 QSpan spans[NSPANS];
2680 const int x1 = x0 + w;
2681 const int y1 = y0 + h;
2684 for (
int y = y0; y < y1; ++y) {
2685 for (
int x = x0; x < x1; ) {
2691 if (current == NSPANS) {
2692 blend(current, spans, &s->
penData);
2695 spans[current].
x = x + rx;
2696 spans[current].
y = y + ry;
2701 while (x < x1 &&
monoVal(scanline, x)) {
2705 spans[current].
len = len;
2710 }
else if (depth == 8) {
2711 for (
int y = y0; y < y1; ++y) {
2712 for (
int x = x0; x < x1; ) {
2714 if (scanline[x] == 0) {
2719 if (current == NSPANS) {
2720 blend(current, spans, &s->
penData);
2723 int coverage = scanline[x];
2724 spans[current].
x = x + rx;
2725 spans[current].
y = y + ry;
2726 spans[current].
coverage = coverage;
2731 while (x < x1 && scanline[x] == coverage) {
2735 spans[current].
len = len;
2742 for (
int y = y0; y < y1; ++y) {
2743 for (
int x = x0; x < x1; ) {
2745 if ((sl[x] & 0x00ffffff) == 0) {
2750 if (current == NSPANS) {
2751 blend(current, spans, &s->
penData);
2754 uint rgbCoverage = sl[x];
2755 int coverage =
qGreen(rgbCoverage);
2756 spans[current].
x = x + rx;
2757 spans[current].
y = y + ry;
2758 spans[current].
coverage = coverage;
2763 while (x < x1 && sl[x] == rgbCoverage) {
2767 spans[current].
len = len;
2770 sl += bpl /
sizeof(
uint);
2777 blend(current, spans, &s->
penData);
2787 #if !defined(QT_NO_FREETYPE) 2796 if (d_func()->mono_surface
2813 || !fe->
loadGlyphs(gset, glyphs, numGlyphs, positions, neededFormat))
2819 switch (neededFormat) {
2834 for (
int i = 0; i < numGlyphs; i++) {
2838 if (!glyph || glyph->
format != neededFormat) {
2841 glyph = fe->
loadGlyph(gset, glyphs[i], spp, neededFormat);
2844 if (!glyph || !glyph->
data)
2848 switch (neededFormat) {
2850 pitch = ((glyph->
width + 31) & ~31) >> 3;
2853 pitch = (glyph->
width + 3) & ~3;
2856 pitch = glyph->
width * 4;
2863 alphaPenBlt(glyph->
data, pitch, depth,
2864 qFloor(positions[i].x + xOffs) + glyph->
x,
2865 qFloor(positions[i].y + offs) - glyph->
y,
2884 cache->
populate(fontEngine, numGlyphs, glyphs, positions);
2890 int depth = image.
depth();
2895 else if (depth == 1)
2900 for (
int i=0; i<numGlyphs; ++i) {
2919 alphaPenBlt(bits + ((c.
x << leftShift) >> rightShift) + c.
y * bpl, bpl, depth, x, y, c.
w, c.
h);
2925 #if defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) 2937 QFontEngineS60 *fe =
static_cast<QFontEngineS60 *
>(fontEngine);
2944 fe->setFontScale(matrix.
m11());
2949 for (
int i=0; i<glyphs.
size(); ++i) {
2950 TOpenFontCharMetrics tmetrics;
2951 const TUint8 *glyphBitmapBytes;
2952 TSize glyphBitmapSize;
2953 fe->getCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize);
2954 const int x =
qFloor(positions[i].x + tmetrics.HorizBearingX() + aliasDelta);
2955 const int y =
qFloor(positions[i].y - tmetrics.HorizBearingY() + aliasDelta);
2956 alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight);
2960 fe->setFontScale(1.0);
2964 #endif // Q_OS_SYMBIAN && QT_NO_FREETYPE 2975 const QRect &r1 = deviceRect;
3004 const QRect &r1 = deviceRect;
3019 r.
setX(r.
x() - penWidth);
3020 r.
setY(r.
y() - penWidth);
3077 if (!supportsTransformations(fontEngine)) {
3093 #ifdef QT_DEBUG_DRAW 3095 fprintf(stderr,
" - QRasterPaintEngine::drawTextItem(), (%.2f,%.2f), string=%s ct=%d\n",
3103 #if defined (Q_WS_WIN) || defined(Q_WS_MAC) || (defined(Q_OS_MAC) && defined(Q_WS_QPA)) 3105 if (!supportsTransformations(ti.
fontEngine)) {
3118 #elif defined (Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) // Q_WS_WIN || Q_WS_MAC 3122 drawGlyphsS60(p, ti);
3125 #else // Q_WS_WIN || Q_WS_MAC 3129 #if defined(Q_WS_QWS) 3157 if (glyphs.
size() == 0)
3160 for(
int i = 0; i < glyphs.
size(); i++) {
3165 qRound(positions[i].x + metrics.
x),
3166 qRound(positions[i].y + metrics.
y),
3173 #if (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) && !defined(QT_NO_FREETYPE) 3175 #if defined(Q_WS_QWS) && !defined(QT_NO_QWS_QPF2) 3178 if (renderingEngine)
3179 fontEngine = renderingEngine;
3196 if (glyphs.
size() == 0)
3254 #ifdef QT_DEBUG_DRAW 3255 qDebug() <<
" - QRasterPaintEngine::drawLines(QLine*)" << lineCount;
3266 for (
int i=0; i<lineCount; ++i) {
3267 const QLine &
l = lines[i];
3288 qreal patternLength = 0;
3289 for (
int i = 0; i < pattern.
size(); ++i)
3290 patternLength += pattern.
at(i);
3292 if (patternLength <= 0)
3297 while (length > 0) {
3298 const bool rasterize = *inDash;
3299 qreal dash = (pattern.
at(*dashIndex) - *dashOffset) * width;
3302 if (dash >= length) {
3304 *dashOffset += dash / width;
3308 *inDash = !(*inDash);
3309 if (++*dashIndex >= pattern.
size())
3316 if (rasterize && dash > 0)
3317 rasterizer->rasterizeLine(l.
p1(), l.
p2(), width / dash, squareCap);
3326 #ifdef QT_DEBUG_DRAW 3327 qDebug() <<
" - QRasterPaintEngine::drawLines(QLineF *)" << lineCount;
3337 for (
int i=0; i<lineCount; ++i) {
3395 return d->cgContext;
3429 #if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) 3443 #if defined(Q_WS_MAC) || (defined(Q_OS_MAC) && defined(Q_WS_QPA)) 3476 #if defined(Q_WS_QWS) && !defined(QT_NO_RASTERCALLBACKS) 3482 qFatal(
"QRasterPaintEngine::drawColorSpans must be reimplemented on " 3483 "a non memory-mapped device");
3505 int x,
int y,
int length,
uint const_alpha)
3513 qFatal(
"QRasterPaintEngine::drawBufferSpan must be reimplemented on " 3514 "a non memory-mapped device");
3527 const int spanCount = 256;
3532 int w = image.
width();
3539 int x_offset = xmin -
qRound(pos.
x());
3542 for (
int y = ymin; y < ymax; ++y) {
3545 for (
int x = 0; x < xmax - xmin; ++x) {
3546 int src_x = x + x_offset;
3547 uchar pixel = src[src_x >> 3];
3552 if (pixel & (0x1 << (src_x & 7))) {
3553 spans[n].
x = xmin + x;
3557 while (src_x+1 < w && src[(src_x+1) >> 3] & (0x1 << ((src_x+1) & 7))) {
3561 spans[n].
len = ((len + spans[n].
x) > xmax) ? (xmax - spans[n].
x) : len;
3564 if (n == spanCount) {
3565 fg->
blend(n, spans, fg);
3571 for (
int x = 0; x < xmax - xmin; ++x) {
3572 int src_x = x + x_offset;
3573 uchar pixel = src[src_x >> 3];
3578 if (pixel & (0x80 >> (x & 7))) {
3579 spans[n].
x = xmin + x;
3583 while (src_x+1 < w && src[(src_x+1) >> 3] & (0x80 >> ((src_x+1) & 7))) {
3587 spans[n].
len = ((len + spans[n].
x) > xmax) ? (xmax - spans[n].
x) : len;
3590 if (n == spanCount) {
3591 fg->
blend(n, spans, fg);
3599 fg->
blend(n, spans, fg);
3663 const QSpan *c1_spans = c1ClipLines[y].
spans;
3664 int c1_count = c1ClipLines[y].
count;
3665 const QSpan *c2_spans = c2ClipLines[y].
spans;
3666 int c2_count = c2ClipLines[y].
count;
3668 if (c1_count == 0 && c2_count == 0)
3670 if (c1_count == 0) {
3673 }
else if (c2_count == 0) {
3681 int max =
qMax(c1_spans[c1_count - 1].x + c1_spans[c1_count - 1].len,
3682 c2_spans[c2_count - 1].x + c2_spans[c2_count - 1].len);
3684 memset(buffer.
data(), 0, buffer.
size() *
sizeof(short));
3687 for (
int i = 0; i < c1_count; ++i) {
3688 const QSpan *cs = c1_spans + i;
3689 for (
int j=cs->
x; j<cs->x + cs->
len; ++j)
3694 for (
int i = 0; i < c2_count; ++i) {
3695 const QSpan *cs = c2_spans + i;
3696 for (
int j = cs->
x; j < cs->x + cs->
len; ++j) {
3698 if (buffer[j] > 255)
3707 while (x < max && buffer[x] == 0) ++x;
3708 if (x >= max)
break;
3711 int coverage = buffer[x];
3714 while (x < max && buffer[x] == coverage)
3729 QRect clipRect(deviceRect);
3738 blend = data->
blend;
3743 rasterizer->setClipRect(clipRect);
3744 rasterizer->initialize(blend, data);
3751 if (!callback || !outline)
3758 initializeRasterizer(spanData);
3764 rasterizer->rasterize(outline, fillRule);
3768 rasterize(outline, callback, (
void *)spanData, rasterBuffer);
3777 return (
uchar *)(((
quintptr)address + alignmentMask) & ~alignmentMask);
3784 if (!callback || !outline)
3792 rasterizer->setClipRect(deviceRect);
3793 rasterizer->initialize(callback, userData);
3799 rasterizer->rasterize(outline, fillRule);
3810 uchar *rasterPoolOnHeap = 0;
3814 void *
data = userData;
3818 deviceRect.x() + deviceRect.width(),
3819 deviceRect.y() + deviceRect.height() };
3823 rasterParams.
source = outline;
3835 int rendered_spans = 0;
3846 rasterPoolSize *= 2;
3847 if (rasterPoolSize > 1024 * 1024) {
3848 qWarning(
"QPainter: Rasterization of primitive failed");
3854 free(rasterPoolOnHeap);
3855 rasterPoolOnHeap = (
uchar *)malloc(rasterPoolSize + 0xf);
3869 free(rasterPoolOnHeap);
3902 int height = sourceImage.height();
3903 int width = sourceImage.width();
3904 for (
int y=0; y<height; ++y) {
3905 uchar *source = sourceImage.scanLine(y);
3907 if (!source || !target)
3909 for (
int x=0; x < width; ++x)
3910 target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg;
3922 monoDestinationWithClut =
false;
3932 bytes_per_pixel = image->
depth()/8;
3938 monoDestinationWithClut =
true;
3948 memset(m_buffer, val, m_height*bytes_per_line);
3952 #if defined(Q_WS_QWS) 3955 m_buffer =
reinterpret_cast<uchar*
>(device->
memory());
3958 bytes_per_pixel = device->
depth() / 8;
3961 #ifndef QT_NO_RASTERCALLBACKS 3985 return (width() * depth() + 7) / 8;
3988 #elif defined(Q_OS_SYMBIAN) 3994 #endif // Q_OS_SYMBIAN 4082 clipSpanHeight = height;
4087 xmin = xmax = ymin = ymax = 0;
4091 hasRectClip = hasRegionClip =
false;
4112 m_spans = (
QSpan *)malloc(clipSpanHeight*
sizeof(
QSpan));
4113 allocated = clipSpanHeight;
4120 m_clipLines[y].spans = 0;
4121 m_clipLines[y].count = 0;
4125 const int len = clipRect.width();
4128 QSpan *span = m_spans + count;
4135 m_clipLines[y].spans = span;
4136 m_clipLines[y].count = 1;
4140 while (y < clipSpanHeight) {
4141 m_clipLines[y].spans = 0;
4142 m_clipLines[y].count = 0;
4145 }
else if (hasRegionClip) {
4148 const int numRects = rects.
size();
4151 const int maxSpans = (ymax - ymin) * numRects;
4152 if (maxSpans > allocated) {
4154 allocated = maxSpans;
4159 int firstInBand = 0;
4161 while (firstInBand < numRects) {
4162 const int currMinY = rects.
at(firstInBand).
y();
4163 const int currMaxY = currMinY + rects.
at(firstInBand).
height();
4165 while (y < currMinY) {
4166 m_clipLines[y].spans = 0;
4167 m_clipLines[y].count = 0;
4171 int lastInBand = firstInBand;
4172 while (lastInBand + 1 < numRects && rects.
at(lastInBand+1).
top() == y)
4175 while (y < currMaxY) {
4177 m_clipLines[y].spans = m_spans + count;
4178 m_clipLines[y].count = lastInBand - firstInBand + 1;
4180 for (
int r = firstInBand; r <= lastInBand; ++r) {
4181 const QRect &currRect = rects.
at(r);
4182 QSpan *span = m_spans + count;
4183 span->
x = currRect.
x();
4192 firstInBand = lastInBand + 1;
4197 while (y < clipSpanHeight) {
4198 m_clipLines[y].spans = 0;
4199 m_clipLines[y].count = 0;
4221 ymin = ymax = xmin = xmax = 0;
4226 ymin = m_spans[0].y;
4227 ymax = m_spans[count-1].y + 1;
4231 const int firstLeft = m_spans[0].x;
4232 const int firstRight = m_spans[0].x + m_spans[0].len;
4235 for (
int i = 0; i < count; ++i) {
4239 if (span.
y != y + 1 && y != -1)
4242 m_clipLines[y].spans = &span;
4243 m_clipLines[y].count = 1;
4245 ++m_clipLines[y].count;
4247 const int spanLeft = span.
x;
4248 const int spanRight = spanLeft + span.
len;
4250 if (spanLeft < xmin)
4253 if (spanRight > xmax)
4256 if (spanLeft != firstLeft || spanRight != firstRight)
4262 clipRect.setRect(xmin, ymin, xmax - xmin, ymax - ymin);
4271 if (hasRectClip && rect == clipRect)
4276 hasRegionClip =
false;
4280 xmax = rect.
x() + rect.
width();
4281 ymin =
qMin(rect.
y(), clipSpanHeight);
4282 ymax =
qMin(rect.
y() + rect.
height(), clipSpanHeight);
4298 setClipRect(region.
rects().
at(0));
4302 hasRegionClip =
true;
4303 hasRectClip =
false;
4309 xmax = rect.
x() + rect.
width();
4311 ymax = rect.
y() + rect.
height();
4327 QSpan **outSpans,
int available)
4331 QSpan *out = *outSpans;
4336 while (available && spans < end ) {
4337 if (clipSpans >= clipEnd) {
4341 if (clipSpans->
y > spans->
y) {
4345 if (spans->
y != clipSpans->
y) {
4355 int sx2 = sx1 + spans->
len;
4356 int cx1 = clipSpans->
x;
4357 int cx2 = cx1 + clipSpans->
len;
4359 if (cx1 < sx1 && cx2 < sx1) {
4362 }
else if (sx1 < cx1 && sx2 < cx1) {
4366 int x =
qMax(sx1, cx1);
4367 int len =
qMin(sx2, cx2) - x;
4369 out->
x =
qMax(sx1, cx1);
4370 out->
len =
qMin(sx2, cx2) - out->
x;
4384 *currentClip = clipSpans - clip->
m_spans;
4395 const int NSPANS = 256;
4396 QSpan cspans[NSPANS];
4397 int currentClip = 0;
4398 const QSpan *
end = spans + spanCount;
4399 while (spans < end) {
4400 QSpan *clipped = cspans;
4405 if (clipped - cspans)
4418 const short minx = clip.
left();
4419 const short miny = clip.
top();
4420 const short maxx = clip.
right();
4421 const short maxy = clip.
bottom();
4424 for (
int i = 0; i < numSpans; ++i) {
4425 if (spans[i].y > maxy)
4427 if (spans[i].y < miny
4428 || spans[i].x > maxx
4429 || spans[i].x + spans[i].len <= minx) {
4432 if (spans[i].x < minx) {
4433 spans[n].
len =
qMin(spans[i].len - (minx - spans[i].x), maxx - minx + 1);
4436 spans[n].
x = spans[i].
x;
4437 spans[n].
len =
qMin(spans[i].len,
ushort(maxx - spans[n].x + 1));
4439 if (spans[n].len == 0)
4441 spans[n].
y = spans[i].
y;
4481 int currentClip = 0;
4483 while (spans < end) {
4510 for (
int y = 0; y < m_height; ++y) {
4511 uint *span = (
uint *)const_cast<QRasterBuffer *>(
this)->scanLine(y);
4513 for (
int x=0; x<m_width; ++x) {
4514 uint argb = span[x];
4528 for (
int y=0; y<h; ++y) {
4529 uint *sourceLine = (
uint *)const_cast<QRasterBuffer *>(
this)->scanLine(y);
4531 for (
int x=0; x<w; ++x) {
4532 QRgb pixel = sourceLine[x];
4533 int alpha =
qAlpha(pixel);
4537 dest[x] = (alpha << 24)
4538 | ((255*
qRed(pixel)/alpha) << 16)
4539 | ((255*
qGreen(pixel)/alpha) << 8)
4540 | ((255*
qBlue(pixel)/alpha) << 0);
4552 stops(s),
opacity(op), interpolationMode(mode) {}
4566 for (
int i = 0; i < stops.
size() && i <= 2; i++)
4567 hash_val += stops[i].second.rgba();
4570 QGradientColorTableHash::const_iterator
it = cache.constFind(hash_val);
4572 if (it == cache.constEnd())
4573 return addCacheElement(hash_val, gradient, opacity);
4576 const CacheInfo &cache_info = it.value();
4578 return cache_info.
buffer;
4580 }
while (it != cache.constEnd() && it.key() == hash_val);
4582 return addCacheElement(hash_val, gradient, opacity);
4589 inline void generateGradientColorTable(
const QGradient& g,
4593 if (cache.size() == maxCacheSize()) {
4595 cache.erase(cache.begin() + (
qrand() % maxCacheSize()));
4598 generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity);
4599 return cache.insert(hash_val, cache_entry).value().buffer;
4609 int stopCount = stops.
count();
4614 if (stopCount == 2) {
4621 if (second_stop < first_stop) {
4622 qSwap(first_color, second_color);
4623 qSwap(first_stop, second_stop);
4626 if (colorInterpolation) {
4627 first_color =
PREMUL(first_color);
4628 second_color =
PREMUL(second_color);
4634 uint red_first =
qRed(first_color) << 16;
4635 uint green_first =
qGreen(first_color) << 16;
4636 uint blue_first =
qBlue(first_color) << 16;
4637 uint alpha_first =
qAlpha(first_color) << 16;
4639 uint red_second =
qRed(second_color) << 16;
4640 uint green_second =
qGreen(second_color) << 16;
4641 uint blue_second =
qBlue(second_color) << 16;
4642 uint alpha_second =
qAlpha(second_color) << 16;
4646 if (colorInterpolation)
4647 colorTable[i] = first_color;
4649 colorTable[i] =
PREMUL(first_color);
4652 if (i < second_index) {
4653 qreal reciprocal =
qreal(1) / (second_index - first_index);
4655 int red_delta =
qRound(
int(red_second - red_first) * reciprocal);
4656 int green_delta =
qRound(
int(green_second - green_first) * reciprocal);
4657 int blue_delta =
qRound(
int(blue_second - blue_first) * reciprocal);
4658 int alpha_delta =
qRound(
int(alpha_second - alpha_first) * reciprocal);
4661 red_first += 1 << 15;
4662 green_first += 1 << 15;
4663 blue_first += 1 << 15;
4664 alpha_first += 1 << 15;
4667 red_first += red_delta;
4668 green_first += green_delta;
4669 blue_first += blue_delta;
4670 alpha_first += alpha_delta;
4672 const uint color = ((alpha_first << 8) & 0xff000000) | (red_first & 0xff0000)
4673 | ((green_first >> 8) & 0xff00) | (blue_first >> 16);
4675 if (colorInterpolation)
4676 colorTable[i] = color;
4678 colorTable[i] =
PREMUL(color);
4683 if (colorInterpolation)
4684 colorTable[i] = second_color;
4686 colorTable[i] =
PREMUL(second_color);
4693 if (stopCount == 1) {
4694 current_color =
PREMUL(current_color);
4695 for (
int i = 0; i < size; ++i)
4696 colorTable[i] = current_color;
4708 qreal dpos = 1.5 * incr;
4711 colorTable[pos++] =
PREMUL(current_color);
4712 while (dpos <= begin_pos) {
4713 colorTable[pos] = colorTable[pos - 1];
4718 int current_stop = 0;
4723 if (dpos < end_pos) {
4725 while (dpos > stops[current_stop+1].first)
4728 if (current_stop != 0)
4732 if (colorInterpolation) {
4733 current_color =
PREMUL(current_color);
4734 next_color =
PREMUL(next_color);
4739 t = (dpos - stops[current_stop].
first) * c;
4743 Q_ASSERT(current_stop < stopCount);
4746 int idist = 256 - dist;
4748 if (colorInterpolation)
4756 if (dpos >= end_pos)
4762 while (dpos > stops[current_stop+skip+1].first)
4766 current_stop += skip;
4768 current_color = next_color;
4773 if (colorInterpolation) {
4775 current_color =
PREMUL(current_color);
4776 next_color =
PREMUL(next_color);
4781 t = (dpos - stops[current_stop].
first) * c;
4789 while (pos < size - 1) {
4790 colorTable[pos] = current_color;
4795 colorTable[size - 1] = current_color;
4810 m11 = m22 = m33 = 1.;
4811 m12 = m13 = m21 = m23 = dx = dy = 0.0;
4812 clip = pe ? pe->d_func()->clip() : 0;
4820 switch (brushStyle) {
4826 if ((solid.color & 0xff000000) == 0
4835 type = LinearGradient;
4837 gradient.alphaColor = !brush.
isOpaque() || alpha != 256;
4838 gradient.colorTable =
const_cast<uint*
>(qt_gradient_cache()->getBuffer(*g, alpha));
4839 gradient.spread = g->
spread();
4852 type = RadialGradient;
4854 gradient.alphaColor = !brush.
isOpaque() || alpha != 256;
4855 gradient.colorTable =
const_cast<uint*
>(qt_gradient_cache()->getBuffer(*g, alpha));
4856 gradient.spread = g->
spread();
4865 radialData.
focal.
x = focal.
x();
4866 radialData.
focal.
y = focal.
y();
4873 type = ConicalGradient;
4875 gradient.alphaColor = !brush.
isOpaque() || alpha != 256;
4876 gradient.colorTable =
const_cast<uint*
>(qt_gradient_cache()->getBuffer(*g, alpha));
4903 tempImage =
new QImage();
4910 tempImage =
new QImage();
4924 adjustSpanMethods();
4937 unclipped_blend = 0;
4940 unclipped_blend = rasterBuffer->drawHelper->blendColor;
4941 bitmapBlit = rasterBuffer->drawHelper->bitmapBlit;
4942 alphamapBlit = rasterBuffer->drawHelper->alphamapBlit;
4943 alphaRGBBlit = rasterBuffer->drawHelper->alphaRGBBlit;
4944 fillRect = rasterBuffer->drawHelper->fillRect;
4946 case LinearGradient:
4947 case RadialGradient:
4948 case ConicalGradient:
4949 unclipped_blend = rasterBuffer->drawHelper->blendGradient;
4953 #ifndef QT_NO_RASTERCALLBACKS 4954 if (!rasterBuffer->buffer())
4962 if (!texture.imageData)
4963 unclipped_blend = 0;
4968 if (!unclipped_blend) {
4971 blend = unclipped_blend;
4983 delta.
translate(1.0 / 65536, 1.0 / 65536);
4998 const bool affine = !m13 && !m23;
4999 fast_matrix = affine
5000 && m11 * m11 + m21 * m21 < 1e4
5001 && m12 * m12 + m22 * m22 < 1e4
5005 adjustSpanMethods();
5013 if (!d || d->
height == 0) {
5014 texture.imageData = 0;
5021 texture.bytesPerLine = 0;
5023 texture.colorTable = 0;
5024 texture.hasAlpha = alpha != 256;
5026 texture.imageData = d->
data;
5027 texture.width = d->
width;
5028 texture.height = d->
height;
5030 if (sourceRect.
isNull()) {
5033 texture.x2 = texture.width;
5034 texture.y2 = texture.height;
5036 texture.x1 = sourceRect.
x();
5037 texture.y1 = sourceRect.
y();
5044 texture.format = d->
format;
5048 texture.const_alpha = alpha;
5049 texture.type = _type;
5051 adjustSpanMethods();
5068 const int midx = rect.
x() + (rect.
width() + 1) / 2;
5069 const int midy = rect.
y() + (rect.
height() + 1) / 2;
5075 outline[0].
x = midx + (midx - x) - (length - 1) - (rect.
width() & 0x1);
5076 outline[0].
len =
qMin(length, x - outline[0].x);
5082 outline[1].
len = length;
5087 outline[2].
x = outline[0].
x;
5088 outline[2].
len = outline[0].
len;
5089 outline[2].
y = midy + (midy - y) - (rect.
height() & 0x1);
5094 outline[3].
len = length;
5095 outline[3].
y = outline[2].
y;
5098 if (brush_func && outline[0].x + outline[0].len < outline[1].x) {
5102 fill[0].
x = outline[0].
x + outline[0].
len - 1;
5103 fill[0].
len =
qMax(0, outline[1].x - fill[0].x);
5104 fill[0].
y = outline[1].
y;
5108 fill[1].
x = outline[2].
x + outline[2].
len - 1;
5109 fill[1].
len =
qMax(0, outline[3].x - fill[1].x);
5110 fill[1].
y = outline[3].
y;
5113 int n = (fill[0].
y >= fill[1].
y ? 1 : 2);
5116 brush_func(n, fill, brush_data);
5119 int n = (outline[1].
y >= outline[2].
y ? 2 : 4);
5122 pen_func(n, outline, pen_data);
5142 int y = (rect.
height() + 1) / 2;
5146 while (a*a*(2*y - 1) > 2*b*b*(x + 1)) {
5151 d += b*b*(2*x + 3) + a*a*(-2*y + 2);
5153 pen_func, brush_func, pen_data, brush_data);
5159 pen_func, brush_func, pen_data, brush_data);
5162 d = b*b*(x +
qreal(0.5))*(x +
qreal(0.5)) + a*a*((y - 1)*(y - 1) - b*b);
5163 const int miny = rect.
height() & 0x1;
5166 d += b*b*(2*x + 2) + a*a*(-2*y + 3);
5169 d += a*a*(-2*y + 3);
5173 pen_func, brush_func, pen_data, brush_data);
5198 #ifdef QT_DEBUG_DRAW 5202 clipImg.
fill(0xffff0000);
5211 for (
int i = 0; i < clip->
count; ++i) {
5213 for (
int j = 0; j < span->
len; ++j)
5214 clipImg.
setPixel(span->
x + j, span->
y, 0xffffff00);
5215 x0 =
qMin(x0,
int(span->
x));
5216 x1 =
qMax(x1,
int(span->
x + span->
len - 1));
5218 y0 =
qMin(y0,
int(span->
y));
5219 y1 =
qMax(y1,
int(span->
y));
5222 static int counter = 0;
5229 fprintf(stderr,
"clip %d: %d %d - %d %d\n", counter, x0, y0, x1, y1);
ElementType type
the type of element
qreal focalRadius() const
Returns the focal radius of this radial gradient in logical coordinates.
virtual void drawPoints(const QPointF *points, int pointCount)
Draws the first pointCount points in the buffer points.
QPaintDevice * device() const
Returns the paint device on which this painter is currently painting, or 0 if the painter is not acti...
static const qreal aliasedCoordinateDelta
The QColor class provides colors based on RGB, HSV or CMYK values.
QRect toAlignedRect() const
Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle...
QPointF bottomRight() const
Returns the position of the rectangle's bottom-right corner.
static const QSpan * qt_intersect_spans(const QClipData *clip, int *currentClip, const QSpan *spans, const QSpan *end, QSpan **outSpans, int available)
void qBlendTextureCallback(int count, const QSpan *spans, void *userData)
QPointF focalPoint() const
Returns the focal point of this radial gradient in logical coordinates.
The QPainterPath::Element class specifies the position and type of a subpath.
const QT_FT_Raster_Funcs qt_ft_grays_raster
static void qt_span_clip(int count, const QSpan *spans, void *userData)
const T * constData() const
QImage toImage() const
Converts the pixmap to a QImage.
ElementType
This enum describes the types of elements used to connect vertices in subpaths.
QPaintEngine::DirtyFlags state() const
Returns a combination of flags identifying the set of properties that need to be updated when updatin...
void setClipRegion(const QRegion ®ion)
QScopedPointer< QClipData > baseClip
Format
The following image formats are available in Qt.
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
void saveBuffer(const QString &s) const
void setP1(const QPointF &p1)
Sets the starting point of this line to p1.
void lineTo(const QPointF &pt)
qreal right() const
Returns the x-coordinate of the rectangle's right edge.
QT_FT_Raster_DoneFunc raster_done
virtual bool supportsSubPixelPositions() const
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
void setHeight(int h)
Sets the height of the rectangle to the given height.
void(* SrcOverScaleFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int srch, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clipRect, int const_alpha)
QIntegerForSizeof< void * >::Unsigned quintptr
virtual QImage alphaMapForGlyph(glyph_t)
qreal opacity() const
Returns the opacity in the current paint engine state.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
int q_gray_rendered_spans(QT_FT_Raster raster)
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
QHash< GlyphAndSubPixelPosition, Coord > coords
static void qt_ft_outline_move_to(qfixed x, qfixed y, void *data)
The QMutex class provides access serialization between threads.
#define GRADIENT_STOPTABLE_SIZE
QFontEngine * fontEngine() const
QPointer< QWidget > widget
static uchar * alignAddress(uchar *address, quintptr alignmentMask)
QSize size() const
Returns the size of the pixmap.
~QRasterPaintEngineState()
qreal length() const
Returns the length of the line.
char * data()
Returns a pointer to the data stored in the byte array.
The QCustomRasterPaintDevice class is provided to activate hardware accelerated paint engines in Qt f...
QRasterPaintEngineState * state()
bool setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op)
CompositionMode
Defines the modes supported for digital image compositing.
The QLine class provides a two-dimensional vector using integer precision.
QPainter::RenderHints renderHints
T * data() const
Returns the value of the pointer referenced by this object.
const QGradient * gradient() const
Returns the gradient describing this brush.
QPainter::CompositionMode composition_mode
#define it(className, varName)
QRect deviceRectUnclipped
Qt::BrushStyle qbrush_style(const QBrush &b)
PaintEngineFeatures gccaps
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
QFixedPoint * glyphPositions
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
int count(const T &t) const
Returns the number of occurrences of value in the vector.
QFixed subPixelPositionForX(QFixed x) const
static void qt_ft_outline_line_to(qfixed x, qfixed y, void *data)
QPoint p1() const
Returns the line's start point.
void drawLine(const QPointF &p1, const QPointF &p2)
GlyphFormat defaultGlyphFormat() const
const QImage & image() const
ClipType clipType() const
Returns the type of the clip currently set.
void rasterize(const QT_FT_Outline *outline, Qt::FillRule fillRule)
void moveTo(const QPointF &pt)
void updateMatrixData(QSpanData *spanData, const QBrush &brush, const QTransform &brushMatrix)
QPointF p1() const
Returns the line's start point.
QScopedPointer< QBrushData, QBrushDataPointerDeleter > d
QPoint p2() const
Returns the line's end point.
T & first()
Returns a reference to the first item in the vector.
~QRasterPaintEngine()
Destroys this paint engine.
void fill(uint pixel)
Fills the entire image with the given pixelValue.
The QConicalGradient class is used in combination with QBrush to specify a conical gradient brush...
void drawLines(const QLine *line, int lineCount)
Reimplemented Function
QTransform transform() const
Returns the matrix in the current paint engine state.
AlphaRGBBlitFunc alphaRGBBlit
QGradientColorTableHash cache
The QPointF class defines a point in the plane using floating point precision.
QT_FT_SpanFunc gray_spans
qreal left() const
Returns the x-coordinate of the rectangle's left edge.
void resetBuffer(int val=0)
static bool isRect(const T *pts, int elementCount)
void drawEllipse(const QRectF &rect)
Reimplemented Function
QRect clipBoundingRect() const
Returns the bounding rect of the currently set clip.
static void drawEllipsePoints(int x, int y, int length, const QRect &rect, const QRect &clip, ProcessSpans pen_func, ProcessSpans brush_func, QSpanData *pen_data, QSpanData *brush_data)
QRect normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
QT_FT_SpanFunc ProcessSpans
CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode)
bool begin(QPaintDevice *device)
Reimplemented Function
QPointF topLeft() const
Returns the position of the rectangle's top-left corner.
bool save(const QString &fileName, const char *format=0, int quality=-1) const
Saves the image to the file with the given fileName, using the given image file format and quality fa...
int left() const
Returns the x-coordinate of the rectangle's left edge.
QColor color() const
Returns the color of this pen's brush.
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
QRasterPaintEngineState()
void drawBitmap(const QPointF &pos, const QImage &image, QSpanData *fill)
int width() const
Returns the width of the rectangle.
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
Reimplemented Function
virtual uint flags() const
ProcessSpans getBrushFunc(const QRect &rect, const QSpanData *data) const
void updateBrush(const QBrush &brush)
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
QPoint coordinateOffset() const
int bytesPerLine() const
Returns the number of bytes per image scanline.
long ASN1_INTEGER_get ASN1_INTEGER * a
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
QRect boundingRect() const
Returns the bounding rectangle of this region.
Qt::PenJoinStyle qpen_joinStyle(const QPen &p)
void fillPath(const QPainterPath &path, QSpanData *fillData)
QPointF bottomLeft() const
Returns the position of the rectangle's bottom-left corner.
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]
void setClipRect(const QRect &rect)
virtual QImage::Format format() const
Returns the format of the device's memory buffet.
int depth() const
Returns the depth of the pixmap.
MemRotateFunc qMemRotateFunctions[QImage::NImageFormats][3]
QRectF qt_mapRect_non_normalizing(const QRectF &r, const QTransform &t)
QScopedPointer< QRasterBuffer > rasterBuffer
int height() const
Returns the height of the rectangle.
The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush...
void setY(int y)
Sets the top edge of the rectangle to the given y coordinate.
qreal y
the y coordinate of the element's position.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
Q_CORE_EXPORT int qrand()
Qt::PenCapStyle qpen_capStyle(const QPen &p)
static bool monoVal(const uchar *s, int x)
QMatrix matrix() const
Returns the matrix in the current paint engine state.
static QFixed fromReal(qreal r)
const QVector< QRgb > * qt_image_colortable(const QImage &image)
Q_DECL_CONSTEXPR T qAbs(const T &t)
#define QT_FT_RASTER_FLAG_CLIP
QVector< QRgb > colortable
bool isUnclipped_normalized(const QRect &rect) const
Returns true if the rectangle is completely within the current clip state of the paint engine...
QTransform transform() const
Returns the current transformation matrix for the brush.
qreal angle() const
Returns the start angle of the conical gradient in logical coordinates.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
QRgb pixel(int x, int y) const
Returns the color of the pixel at coordinates (x, y).
virtual Type type() const =0
virtual int devType() const
const QPainterPath::ElementType * elements() const
void fillInPendingGlyphs()
static QString fromRawData(const QChar *, int size)
Constructs a QString that uses the first size Unicode characters in the array unicode.
bool end()
Reimplemented Function
QPainter::CompositionMode compositionMode
QVector< qreal > dashPattern() const
Returns the dash pattern of this pen.
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
int rectCount() const
Returns the number of rectangles that will be returned in rects().
Format format() const
Returns the format of the image.
void updateMatrix(const QTransform &matrix)
Q_CORE_EXPORT QTextStream & hex(QTextStream &s)
virtual int bytesPerLine() const
Returns the number of bytes per line in the framebuffer.
Glyph * getGlyph(glyph_t index, QFixed subPixelPosition=0) const
InterpolationMode interpolationMode() const
Returns the interpolation mode of this gradient.
void compositionModeChanged()
QT_FT_Raster_BitSet_Func bit_set
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void renderHintsChanged()
void drawRects(const QRect *rects, int rectCount)
Reimplemented Function
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
qreal x() const
Returns the x-coordinate of this point.
QPointF center() const
Returns the center of the conical gradient in logical coordinates.
QT_FT_Outline * outline()
BitmapBlitFunc bitmapBlit
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
void setAntialiased(bool antialiased)
struct QConicalGradientData::@233 center
QRectF boundingRect() const
Returns the bounding rectangle of this painter path as a rectangle with floating point precision...
The QLineF class provides a two-dimensional vector using floating point precision.
bool qt_applefontsmoothing_enabled
static void qt_span_fill_clipped(int count, const QSpan *spans, void *userData)
static const QRectF boundingRect(const QPointF *points, int pointCount)
QRectF controlPointRect() const
Q_CORE_EXPORT void qDebug(const char *,...)
QGradientStops stops() const
Returns the stop points for this gradient.
void drawImage(const QPointF &p, const QImage &img)
void initializeRasterizer(QSpanData *data)
void qBlendTexture(int count, const QSpan *spans, void *userData)
virtual void stroke(const QVectorPath &path, const QPen &pen)
static bool splitPolygon(const QPointF *points, int pointCount, QVector< QPointF > *upper, QVector< QPointF > *lower)
void ensureOutlineMapper()
virtual QImage toImage() const =0
virtual int metric(PaintDeviceMetric m) const
Reimplemented Function
#define ARGB_COMBINE_ALPHA(argb, alpha)
QMultiHash< quint64, CacheInfo > QGradientColorTableHash
#define QT_BEGIN_NAMESPACE
This macro expands to.
QBrush brush() const
Returns the brush in the current paint engine state.
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]
The QRectF class defines a rectangle in the plane using floating point precision. ...
static void qrasterpaintengine_dirty_clip(QRasterPaintEnginePrivate *d, QRasterPaintEngineState *s)
struct FT_FaceRec_ * FT_Face
void setupMatrix(const QTransform &matrix, int bilinear)
bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush &brush)
const int QT_RASTER_COORD_LIMIT
void updateOutlineMapper()
static float pixelSize(const QFontDef &request, int dpi)
QImage bufferImage() const
bool isCosmetic() const
Returns true if the pen is cosmetic; otherwise returns false.
static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, ProcessSpans pen_func, ProcessSpans brush_func, QSpanData *pen_data, QSpanData *brush_data)
Draws an ellipse using the integer point midpoint algorithm.
void drawPoints(const QPointF *points, int pointCount)
Reimplemented Function
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
void setCGContext(CGContextRef ref)
static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *result)
Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
static QRect toNormalizedFillRect(const QRectF &rect)
uint buffer[GRADIENT_STOPTABLE_SIZE]
struct QClipData::ClipLine * m_clipLines
void setActive(bool newState)
Sets the active state of the paint engine to state.
Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b)
static void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface)
#define QT_FT_RASTER_FLAG_DIRECT
qreal height() const
Returns the height of the rectangle.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
qreal qpen_widthf(const QPen &p)
void drawStaticTextItem(QStaticTextItem *textItem)
Reimplemented Function
void rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap=false)
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
static uint polygonFlags(QPaintEngine::PolygonDrawMode mode)
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
void append(const T &t)
Inserts value at the end of the vector.
virtual void drawColorSpans(const QSpan *spans, int count, uint color)
Draws the given color spans with the specified color.
Q_CORE_EXPORT void qWarning(const char *,...)
QGlyphSet * defaultGlyphs()
Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert)
The QImage class provides a hardware-independent image representation that allows direct access to th...
QPainter::CompositionMode compositionMode() const
Returns the composition mode in the current paint engine state.
bool isBitmapFont() const
static const char * data(const QByteArray &arr)
bool isQBitmap() const
Returns true if this is a QBitmap; otherwise returns false.
void releaseDC(HDC hdc) const
Q_CORE_EXPORT QTextStream & bin(QTextStream &s)
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
void rasterize(QT_FT_Outline *outline, ProcessSpans callback, QSpanData *spanData, QRasterBuffer *rasterBuffer)
void setLength(qreal len)
Sets the length of the line to the given length.
qreal width() const
Returns the width of the rectangle.
The QRegion class specifies a clip region for a painter.
void setDirty(DirtyFlags df)
void clip(const QVectorPath &path, Qt::ClipOperation op)
virtual void setState(QPainterState *s)
static void qt_ft_outline_cubic_to(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data)
QImage colorizeBitmap(const QImage &image, const QColor &color)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
int depth() const
Returns the depth of the image.
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)=0
Qt::FillRule fillRule() const
Returns the painter path's currently set fill rule.
void initTexture(const QImage *image, int alpha, QTextureData::Type=QTextureData::Plain, const QRect &sourceRect=QRect())
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set...
bool isOpaque() const
Returns true if the brush is fully opaque otherwise false.
DrawHelper qDrawHelper[QImage::NImageFormats]
void(* SrcOverBlendFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int w, int h, int const_alpha)
QImage::Format prepare(QImage *image)
bool loadGlyphs(QGlyphSet *gs, const glyph_t *glyphs, int num_glyphs, const QFixedPoint *positions, GlyphFormat format=Format_Render)
bool isUnclipped(const QRect &rect, int penWidth) const
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
void appendSpan(int x, int length, int y, int coverage)
void translate(qreal dx, qreal dy)
Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position...
QPointF start() const
Returns the start point of this linear gradient in logical coordinates.
void setX(int x)
Sets the left edge of the rectangle to the given x coordinate.
static bool isAbove(const QPointF *a, const QPointF *b)
QRect toRect() const
Returns a QRect based on the values of this rectangle.
void qSort(RandomAccessIterator start, RandomAccessIterator end)
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
bool supportsTransformations(const QFontEngine *fontEngine) const
QT_FT_SpanFunc black_spans
void fill(const QVectorPath &path, const QBrush &brush)
void qSwap(T &value1, T &value2)
const T & at(int i) const
Returns the item at index position i in the vector.
void drawPixmap(const QPointF &p, const QPixmap &pm)
QSize size() const
Returns the size of the image, i.
DrawHelper qDrawHelperCallback[QImage::NImageFormats]
QPainter * painter() const
Returns a pointer to the painter currently updating the paint engine.
CGContextRef getCGContext() const
void setState(QPainterState *s)
#define qt_fixed_to_real(fixed)
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
void drawPoints(const QPoint *points, int num)
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
virtual void drawLines(const QLine *lines, int lineCount)
The default implementation converts the first lineCount lines in lines to a QLineF and calls the floa...
The QBrush class defines the fill pattern of shapes drawn by QPainter.
void updatePen(const QPen &pen)
uchar * bits()
Returns a pointer to the first pixel data.
const uint * getBuffer(const QGradient &gradient, int opacity)
void appendSpans(const QSpan *s, int num)
void setPixel(int x, int y, uint index_or_rgb)
Sets the pixel index or color at (x, y) to index_or_rgb.
Q_CORE_EXPORT void qFatal(const char *,...)
int top() const
Returns the y-coordinate of the rectangle's top edge.
int width() const
Returns the width of the image.
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
void prepare(QCustomRasterPaintDevice *)
void recalculateFastImages()
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
int right() const
Returns the x-coordinate of the rectangle's right edge.
void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode)
virtual int glyphMargin() const
void rasterizeLine_dashed(QLineF line, qreal width, int *dashIndex, qreal *dashOffset, bool *inDash)
void setGlyphCache(void *key, QFontEngineGlyphCache *data)
void init(QRasterBuffer *rb, const QRasterPaintEngine *pe)
virtual void drawBufferSpan(const uint *buffer, int bufsize, int x, int y, int length, uint const_alpha)
Draws the given buffer.
QRectF controlPointRect() const
Returns the rectangle containing all the points and control points in this path.
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush...
int y() const
Returns the y-coordinate of the rectangle's top edge.
QRasterBuffer * rasterBuffer
The QGradient class is used in combination with QBrush to specify gradient fills. ...
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
QFixed subPixelPositionForX(QFixed x)
struct QLinearGradientData::@229 origin
void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
void * data_ptr(const QTransform &t)
qreal miterLimit() const
Returns the miter limit of the pen.
#define QT_FT_OUTLINE_NONE
void beginOutline(Qt::FillRule fillRule)
bool populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions)
int x() const
Returns the x-coordinate of the rectangle's left edge.
void alphaPenBlt(const void *src, int bpl, int depth, int rx, int ry, int w, int h)
Q_GUI_EXPORT bool qt_region_strictContains(const QRegion ®ion, const QRect &rect)
Returns true if rect is guaranteed to be fully contained in region.
The QPoint class defines a point in the plane using integer precision.
virtual void drawStaticTextItem(QStaticTextItem *)
struct QRadialGradientData::@232 focal
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
void fillRect(const QRectF &rect, const QBrush &brush)
Reimplemented Function
const qreal * points() const
FT_Face lockFace(Scaling scale=Scaled) const
QPainterState * createState(QPainterState *orig) const
void setWidth(int w)
Sets the width of the rectangle to the given width.
QPointF p2() const
Returns the line's end point.
static QReadWriteLock lock
qreal widthF() const
Returns the pen width with floating point precision.
The QRect class defines a rectangle in the plane using integer precision.
const QClipData * clip() const
const QColor & qbrush_color(const QBrush &b)
Spread spread() const
Returns the spread method use by this gradient.
QSpanData image_filler_xform
int height() const
Returns the height of the image.
void flushToARGBImage(QImage *image) const
QSizeF size() const
Returns the size of the rectangle.
QGradient::InterpolationMode interpolationMode
void drawImage(const QPointF &pt, const QImage &img, SrcOverBlendFunc func, const QRect &clip, int alpha, const QRect &sr=QRect())
QRect rect() const
Returns the pixmap's enclosing rectangle.
#define MINIMUM_POOL_SIZE
qreal x
the x coordinate of the element's position.
qreal y() const
Returns the y-coordinate of this point.
ProcessSpans getPenFunc(const QRectF &rect, const QSpanData *data) const
QPointF center() const
Returns the center of this radial gradient in logical coordinates.
QRasterPaintEnginePrivate()
The QPixmap class is an off-screen image representation that can be used as a paint device...
virtual void * memory() const
Returns a pointer to the paint device's memory buffer, or 0 if no such buffer exists.
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
uint * addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity)
static int fast_ceil_positive(const qreal &v)
QT_FT_Raster_BitTest_Func bit_test
virtual QImage * buffer()
QRegion clipRegion() const
Returns the clip region in the current paint engine state.
void systemStateChanged()
qreal top() const
Returns the y-coordinate of the rectangle's top edge.
Q_STATIC_INLINE_FUNCTION int qt_div_255(int x)
qreal dashOffset() const
Returns the dash offset for the pen.
QGlyphSet * loadTransformedGlyphSet(const QTransform &matrix)
struct QLinearGradientData::@230 end
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
Reimplemented Function
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
QT_FT_Raster_RenderFunc raster_render
static const QRect toRect_normalized(const QRectF &rect)
bool qt_cleartype_enabled
void prepareBuffer(int w, int h)
The QSize class defines the size of a two-dimensional object using integer point precision.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
void drawTextItem(const QPointF &p, const QTextItem &textItem)
Reimplemented Function
int elementCount() const
Returns the number of path elements in the painter path.
void brushOriginChanged()
bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine)
const T * constData() const
Returns a const pointer to the data stored in the vector.
void reserve(int size)
Attempts to allocate memory for at least size elements.
QFontEngineGlyphCache * glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
QPen pen() const
Returns the pen in the current paint engine state.
virtual void drawRects(const QRect *rects, int rectCount)
The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF an...
struct CGContext * CGContextRef
void(* SrcOverTransformFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clipRect, const QTransform &targetRectTransform, int const_alpha)
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
QFontEngineGlyphCache::Type glyphCacheType
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
qreal bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
ProcessSpans unclipped_blend
void stroke(const QVectorPath &path, const QPen &pen)
QScopedPointer< QOutlineMapper > outlineMapper
QT_FT_Raster_ResetFunc raster_reset
The QTextItem class provides all the information required to draw text in a custom paint engine...
QRectF translated(qreal dx, qreal dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
qreal centerRadius() const
Returns the center radius of this radial gradient in logical coordinates.
QPointF topRight() const
Returns the position of the rectangle's top-right corner.
Qt::PenCapStyle capStyle() const
Returns the pen's cap style.
QRectF normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
static const KeyPair *const end
Qt::PenStyle qpen_style(const QPen &p)
QImage textureImage() const
Returns the custom brush pattern, or a null image if no custom brush pattern has been set...
void drawPath(const QVectorPath &path)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const
enum QSpanData::Type type
int size() const
Returns the number of items in the vector.
void clipEnabledChanged()
QT_FT_Raster_NewFunc raster_new
struct QRadialGradientData::@231 center
static void qrasterpaintengine_state_setNoClip(QRasterPaintEngineState *s)
QScopedPointer< QRasterizer > rasterizer
QVector< QRgb > colorTable() const
Returns a list of the colors contained in the image's color table, or an empty list if the image does...
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]
QRasterPaintEngine(QPaintDevice *device)
Creates a raster based paint engine for operating on the given device, with the complete set of QPain...
void generateGradientColorTable(const QGradient &g, uint *colorTable, int size, int opacity) const
Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice::PaintDeviceMetric metric)
static void fillRect_normalized(const QRect &r, QSpanData *data, QRasterPaintEnginePrivate *pe)
Q_DECL_CONSTEXPR int qRound(qreal d)
bool canUseFastImageBlending(QPainter::CompositionMode mode, const QImage &image) const
virtual void drawEllipse(const QRectF &r)
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect...
QT_FT_Outline * convertPath(const QPainterPath &path)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
static const QRect toAlignedRect_positive(const QRectF &rect)
#define int_dim(pos, dim)
AlphamapBlitFunc alphamapBlit
Qt::ClipOperation operation
QSpanData solid_color_filler
QPointF finalStop() const
Returns the final stop point of this linear gradient in logical coordinates.
void setStyle(Qt::PenStyle)
Sets the pen style to the given style.
static void qt_span_fill_clipRect(int count, const QSpan *spans, void *userData)
#define QT_FT_RASTER_FLAG_AA
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
virtual void clip(const QVectorPath &path, Qt::ClipOperation op)=0
QPixmapData * pixmapData() const
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.