40 #include <QtCore/qglobal.h>
41 #include <QtCore/qmutex.h>
43 #define QT_FT_BEGIN_HEADER
44 #define QT_FT_END_HEADER
46 #include <private/qrasterdefs_p.h>
47 #include <private/qgrayraster_p.h>
57 #include <private/qtextengine_p.h>
58 #include <private/qfontengine_p.h>
59 #include <private/qpixmap_raster_p.h>
61 #include <private/qimage_p.h>
62 #include <private/qstatictext_p.h>
63 #include <private/qcosmeticstroker_p.h>
64 #include <private/qdrawhelper_p.h>
65 #include <private/qmemrotate_p.h>
66 #include <private/qpixellayout_p.h>
67 #include <private/qrgba64_p.h>
78 # include <private/qfontengine_p.h>
137 #define qreal_to_fixed_26_6(f) (int(f * 64))
138 #define qt_swap_int(x, y) { int tmp = (x); (x) = (y); (y) = tmp; }
139 #define qt_swap_qreal(x, y) { qreal tmp = (x); (x) = (y); (y) = tmp; }
146 #define QT_FAST_SPANS
152 #define int_dim(pos, dim) (int(pos+dim) - int(pos))
156 static inline bool winClearTypeFontsEnabled()
159 #if !defined(SPI_GETFONTSMOOTHINGTYPE)
160 # define SPI_GETFONTSMOOTHINGTYPE 0x200A
161 # define FE_FONTSMOOTHINGCLEARTYPE 0x002
163 SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &
result, 0);
164 return result == FE_FONTSMOOTHINGCLEARTYPE;
170 bool QRasterPaintEngine::clearTypeFontsEnabled()
172 static const bool result = winClearTypeFontsEnabled();
183 static void qt_span_fill_clipRect(
int count,
const QSpan *spans,
void *userData);
184 static void qt_span_fill_clipped(
int count,
const QSpan *spans,
void *userData);
185 static void qt_span_clip(
int count,
const QSpan *spans,
void *userData);
200 static void drawEllipse_midpoint_i(
const QRect &
rect,
const QRect &clip,
214 qreal minx, maxx, miny, maxy;
215 minx = maxx =
e->x();
216 miny = maxy =
e->y();
220 else if (
e->x() > maxx)
224 else if (
e->y() > maxy)
241 static void qt_ft_outline_cubic_to(
qfixed c1x,
qfixed c1y,
252 #if !defined(QT_NO_DEBUG) && 0
255 const char *
names[] = {
262 fprintf(stderr,
"\nQPainterPath: elementCount=%d\n",
path.elementCount());
263 for (
int i=0;
i<
path.elementCount(); ++
i) {
266 fprintf(stderr,
" - %3d:: %s, (%.2f, %.2f)\n",
i,
names[
e.type],
e.x,
e.y);
335 d_func()->device =
device;
345 d_func()->device =
device;
349 void QRasterPaintEngine::init()
362 QT_THROW(std::bad_alloc());
368 d->outlinemapper_xform_dirty =
true;
370 d->basicStroker.setMoveToHook(qt_ft_outline_move_to);
371 d->basicStroker.setLineToHook(qt_ft_outline_line_to);
372 d->basicStroker.setCubicToHook(qt_ft_outline_cubic_to);
374 d->baseClip.reset(
new QClipData(
d->device->height()));
375 d->baseClip->setClipRect(
QRect(0, 0,
d->device->width(),
d->device->height()));
377 d->image_filler.init(
d->rasterBuffer.data(),
this);
380 d->image_filler_xform.init(
d->rasterBuffer.data(),
this);
383 d->solid_color_filler.init(
d->rasterBuffer.data(),
this);
386 d->deviceDepth =
d->device->depth();
388 d->mono_surface =
false;
393 switch (
d->device->devType()) {
395 qWarning(
"QRasterPaintEngine: unsupported for pixmaps...");
398 format =
d->rasterBuffer->prepare(
static_cast<QImage *
>(
d->device));
401 qWarning(
"QRasterPaintEngine: unsupported target device %d\n",
d->device->devType());
409 d->mono_surface =
true;
451 d->systemStateChanged();
454 ensureOutlineMapper();
455 d->outlineMapper->m_clip_rect =
d->deviceRect;
462 d->rasterizer->setClipRect(
d->deviceRect);
464 s->penData.init(
d->rasterBuffer.data(),
this);
465 s->penData.setup(
s->pen.brush(),
s->intOpacity,
s->composition_mode);
466 s->stroker = &
d->basicStroker;
467 d->basicStroker.setClipRect(
d->deviceRect);
469 s->brushData.init(
d->rasterBuffer.data(),
this);
470 s->brushData.setup(
s->brush,
s->intOpacity,
s->composition_mode);
477 qDebug() <<
"QRasterPaintEngine::begin(" << (
void *)
device
478 <<
") devType:" <<
device->devType()
479 <<
"devRect:" <<
d->deviceRect;
481 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->baseClip);
487 #if defined(Q_OS_WIN)
488 else if (clearTypeFontsEnabled())
512 qDebug() <<
"QRasterPaintEngine::end devRect:" <<
d->deviceRect;
514 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->baseClip);
531 ensureOutlineMapper();
538 if (
flags.has_clip_ownership)
555 flags.fast_pen =
true;
556 flags.non_complex_pen =
false;
557 flags.antialiased =
false;
558 flags.bilinear =
false;
559 flags.fast_text =
true;
560 flags.tx_noshear =
true;
561 flags.fast_images =
true;
564 flags.has_clip_ownership =
false;
574 , strokeFlags(
s.strokeFlags)
575 , lastBrush(
s.lastBrush)
576 , brushData(
s.brushData)
577 , fillFlags(
s.fillFlags)
578 , pixmapFlags(
s.pixmapFlags)
579 , intOpacity(
s.intOpacity)
583 , flag_bits(
s.flag_bits)
587 flags.has_clip_ownership =
false;
612 if (
t->clip &&
t->clip->enabled !=
t->clipEnabled) {
614 t->clip->enabled =
t->clipEnabled;
616 d->rasterBuffer->compositionMode =
s->composition_mode;
651 qDebug() <<
"QRasterPaintEngine::updatePen():" <<
s->pen;
659 s->penData.clip =
d->clip();
664 d->updateMatrixData(&
s->penData, pen.
brush(),
s->matrix);
681 d->basicStroker.setStrokeWidth(1);
683 d->basicStroker.setStrokeWidth(penWidth);
686 s->stroker = &
d->basicStroker;
691 d->dashStroker->setClipRect(
d->deviceRect);
694 QRectF clipRect =
s->matrix.inverted().mapRect(
QRectF(
d->deviceRect));
695 d->dashStroker->setClipRect(clipRect);
699 s->stroker =
d->dashStroker.data();
701 s->stroker =
nullptr;
708 && ((cosmetic && penWidth <= 1)
709 || (!cosmetic && (
s->flags.tx_noshear || !
s->flags.antialiased) && penWidth *
s->txscale <= 1));
725 qDebug() <<
"QRasterPaintEngine::brushOriginChanged()" <<
s->brushOrigin;
739 qDebug() <<
"QRasterPaintEngine::brushChanged():" <<
s->brush;
753 qDebug() <<
"QRasterPaintEngine::updateBrush()" <<
brush;
758 s->brushData.clip =
d->clip();
759 s->brushData.setup(
brush,
s->intOpacity,
s->composition_mode);
762 d_func()->updateMatrixData(&
s->brushData,
brush,
d->brushMatrix());
767 void QRasterPaintEngine::updateOutlineMapper()
773 void QRasterPaintEngine::updateRasterState()
783 &&
s->intOpacity == 256
786 &&
s->penData.solidColor.isOpaque()));
801 qDebug() <<
"QRasterPaintEngine::opacityChanged()" <<
s->opacity;
808 s->intOpacity = (int) (
s->opacity * 256);
820 qDebug() <<
"QRasterPaintEngine::compositionModeChanged()" <<
s->composition_mode;
827 d->rasterBuffer->compositionMode =
s->composition_mode;
829 d->recalculateFastImages();
840 qDebug() <<
"QRasterPaintEngine::renderHintsChanged()" <<
Qt::hex <<
s->renderHints;
843 bool was_aa =
s->flags.antialiased;
844 bool was_bilinear =
s->flags.bilinear;
849 if (was_aa !=
s->flags.antialiased)
852 if (was_bilinear !=
s->flags.bilinear) {
858 d->recalculateFastImages();
860 if (was_aa !=
s->flags.antialiased)
872 qDebug() <<
"QRasterPaintEngine::transformChanged()" <<
s->matrix;
881 d->recalculateFastImages();
892 qDebug() <<
"QRasterPaintEngine::clipEnabledChanged()" <<
s->clipEnabled;
896 s->clip->enabled =
s->clipEnabled;
921 int srcSize =
img.depth() >> 3;
922 int iw =
img.width();
923 int ih =
img.height();
929 srcBits += ((sr.
y() * srcBPL) + sr.
x() * srcSize);
938 srcBits += srcSize *
d;
943 int d =
x + iw - cx2;
955 srcBits += srcBPL *
d;
960 int d =
y + ih - cy2;
991 int srcSize =
img.depth() >> 3;
992 int iw =
img.width();
993 int ih =
img.height();
999 srcBits += ((sr.
y() * srcBPL) + sr.
x() * srcSize);
1008 srcBits += srcSize *
d;
1013 int d =
x + iw - cx2;
1021 int cy2 =
clip.y() +
clip.height();
1025 srcBits += srcBPL *
d;
1030 int d =
y + ih - cy2;
1043 for (
int y = 0;
y < ih; ++
y) {
1065 #ifdef QT_DEBUG_DRAW
1085 bool bilinear =
q->state()->flags.bilinear;
1100 spanData->
dx = -
m.dx();
1101 spanData->
dy = -
m.dy();
1102 spanData->
txop =
m.type();
1114 #ifdef QT_CLIPPING_RATIOS
1121 if (
d->clip()->hasRectClip)
1123 if (
d->clip()->hasRegionClip)
1127 if ((totalClips % 5000) == 0) {
1128 printf(
"Clipping ratio: rectangular=%f%%, region=%f%%, complex=%f%%\n",
1129 rectClips * 100.0 / (
qreal) totalClips,
1130 regionClips * 100.0 / (
qreal) totalClips,
1131 (totalClips - rectClips - regionClips) * 100.0 / (
qreal) totalClips);
1142 if (
s->flags.has_clip_ownership)
1145 s->flags.has_clip_ownership =
false;
1154 d->solid_color_filler.clip =
d->clip();
1155 d->solid_color_filler.adjustSpanMethods();
1157 #ifdef QT_DEBUG_DRAW
1158 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->clip());
1169 #ifdef QT_DEBUG_DRAW
1170 qDebug() <<
"QRasterPaintEngine::clip(): " <<
path <<
op;
1172 if (
path.elements()) {
1173 for (
int i=0;
i<
path.elementCount(); ++
i) {
1175 <<
'(' <<
path.points()[
i*2] <<
", " <<
path.points()[
i*2+1] <<
')';
1178 for (
int i=0;
i<
path.elementCount(); ++
i) {
1180 <<
'(' <<
path.points()[
i*2] <<
", " <<
path.points()[
i*2+1] <<
')';
1192 #ifdef QT_DEBUG_DRAW
1193 qDebug(
" --- optimizing vector clip to rect clip...");
1203 qrasterpaintengine_state_setNoClip(
s);
1216 if (
base ==
nullptr)
1222 ensureOutlineMapper();
1223 d->rasterize(
d->outlineMapper->convertPath(
path), qt_span_clip, &
clipData,
nullptr);
1227 if (
s->flags.has_clip_ownership)
1231 s->flags.has_clip_ownership =
true;
1233 qrasterpaintengine_dirty_clip(
d,
s);
1243 #ifdef QT_DEBUG_DRAW
1244 qDebug() <<
"QRasterPaintEngine::clip(): " <<
rect <<
op;
1250 qrasterpaintengine_state_setNoClip(
s);
1266 QRect clipRect =
r &
d->deviceRect;
1277 clip->setClipRect(clipRect);
1279 clip->setClipRegion(clipRegion & clipRect);
1281 if (
s->flags.has_clip_ownership)
1285 s->clip->enabled =
true;
1286 s->flags.has_clip_ownership =
true;
1292 if (
base->hasRectClip ||
base->hasRegionClip) {
1293 if (!
s->flags.has_clip_ownership) {
1294 s->clip =
new QClipData(
d->rasterBuffer->height());
1295 s->flags.has_clip_ownership =
true;
1297 if (
base->hasRectClip)
1298 s->clip->setClipRect(
base->clipRect & clipRect);
1300 s->clip->setClipRegion(
base->clipRegion & clipRect);
1301 s->clip->enabled =
true;
1309 qrasterpaintengine_dirty_clip(
d,
s);
1319 #ifdef QT_DEBUG_DRAW
1320 qDebug() <<
"QRasterPaintEngine::clip(): " << region <<
op;
1332 const QClipData *baseClip =
d->baseClip.data();
1335 qrasterpaintengine_state_setNoClip(
s);
1349 if (
s->flags.has_clip_ownership) {
1353 newClip =
new QClipData(
d->rasterBuffer->height());
1355 s->flags.has_clip_ownership =
true;
1364 qrasterpaintengine_dirty_clip(
d,
s);
1380 #ifdef QT_DEBUG_DRAW
1381 qDebug() <<
" --- fillPath, bounds=" <<
path.boundingRect();
1384 if (!fillData->
blend)
1389 const QRectF controlPointRect =
path.controlPointRect();
1399 if (!
s->flags.antialiased && !do_clip) {
1400 d->initializeRasterizer(fillData);
1401 d->rasterizer->rasterize(
path *
s->matrix,
path.fillRule());
1405 ensureOutlineMapper();
1406 d->rasterize(
d->outlineMapper->convertPath(
path), blend, fillData,
d->rasterBuffer.data());
1414 bool rectClipped =
true;
1417 x1 = qMax(
r.x(),
data->clip->xmin);
1418 x2 = qMin(
r.x() +
r.width(),
data->clip->xmax);
1419 y1 = qMax(
r.y(),
data->clip->ymin);
1420 y2 = qMin(
r.y() +
r.height(),
data->clip->ymax);
1421 rectClipped =
data->clip->hasRectClip;
1429 x1 = qMax(
r.x(), 0);
1430 x2 = qMin(
r.x() +
r.width(),
data->rasterBuffer->width());
1431 y1 = qMax(
r.y(), 0);
1432 y2 = qMin(
r.y() +
r.height(),
data->rasterBuffer->height());
1441 bool isUnclipped = rectClipped
1444 if (pe && isUnclipped) {
1449 &&
data->solidColor.isOpaque())))
1458 const int nspans = 256;
1464 int n = qMin(nspans,
y2 -
y);
1474 blend(
n, spans,
data);
1484 #ifdef QT_DEBUG_DRAW
1485 qDebug(
" - QRasterPaintEngine::drawRect(), rectCount=%d", rectCount);
1488 ensureRasterState();
1493 if (
s->brushData.blend) {
1496 const QRect *lastRect = rects + rectCount;
1498 int offset_x = int(
s->matrix.dx());
1499 int offset_y = int(
s->matrix.dy());
1500 while (
r < lastRect) {
1502 QRect rr =
rect.translated(offset_x, offset_y);
1503 fillRect_normalized(rr, &
s->brushData,
d);
1508 for (
int i=0;
i<rectCount; ++
i) {
1516 if (
s->penData.blend) {
1518 if (
s->flags.fast_pen) {
1520 for (
int i = 0;
i < rectCount; ++
i) {
1525 for (
int i = 0;
i < rectCount; ++
i) {
1538 #ifdef QT_DEBUG_DRAW
1539 qDebug(
" - QRasterPaintEngine::drawRect(QRectF*), rectCount=%d", rectCount);
1541 #ifdef QT_FAST_SPANS
1543 ensureRasterState();
1547 if (
s->flags.tx_noshear) {
1549 if (
s->brushData.blend) {
1550 d->initializeRasterizer(&
s->brushData);
1551 for (
int i = 0;
i < rectCount; ++
i) {
1557 d->rasterizer->rasterizeLine(
a,
b,
rect.height() /
rect.width());
1562 if (
s->penData.blend) {
1564 if (
s->flags.fast_pen) {
1566 for (
int i = 0;
i < rectCount; ++
i) {
1571 for (
int i = 0;
i < rectCount; ++
i) {
1594 if (!
s->penData.blend)
1597 if (
s->flags.fast_pen) {
1605 qreal dashOffset =
s->lastPen.dashOffset();
1607 qreal patternLength = 0;
1612 if (patternLength > 0) {
1613 dashOffset = std::fmod(dashOffset, patternLength);
1615 dashOffset += patternLength;
1616 while (dashOffset >=
pattern.at(dashIndex)) {
1617 dashOffset -=
pattern.at(dashIndex);
1618 if (++dashIndex >=
pattern.size())
1625 d->initializeRasterizer(&
s->penData);
1626 int lineCount =
path.elementCount() / 2;
1629 for (
int i = 0;
i < lineCount; ++
i) {
1636 d->rasterizer->rasterizeLine(mappedline.
p1(), mappedline.
p2(),
1643 d->rasterizer->rasterizeLine(
line.p1(),
line.p2(),
1648 int dIndex = dashIndex;
1649 qreal dOffset = dashOffset;
1651 d->rasterizeLine_dashed(
line,
width, &dIndex, &dOffset, &inD);
1681 #ifdef QT_DEBUG_DRAW
1683 qDebug() <<
"QRasterPaintEngine::fill(): "
1684 <<
"size=" <<
path.elementCount()
1693 if (!
s->brushData.blend)
1701 fillRect_normalized(toNormalizedFillRect(
QRectF(tl, br)), &
s->brushData,
d);
1704 ensureRasterState();
1705 if (
s->flags.tx_noshear) {
1706 d->initializeRasterizer(&
s->brushData);
1711 const QPointF a =
s->matrix.map((
r.topLeft() +
r.bottomLeft()) * 0.5f);
1712 const QPointF b =
s->matrix.map((
r.topRight() +
r.bottomRight()) * 0.5f);
1713 d->rasterizer->rasterizeLine(
a,
b,
r.height() /
r.width());
1721 const QRectF pathDeviceRect =
s->matrix.mapRect(cpRect);
1726 ProcessSpans blend =
d->getBrushFunc(pathDeviceRect, &
s->brushData);
1741 ensureOutlineMapper();
1742 d->rasterize(
d->outlineMapper->convertPath(
path), blend, &
s->brushData,
d->rasterBuffer.data());
1750 if (!
s->flags.antialiased) {
1751 uint txop =
s->matrix.type();
1753 fillRect_normalized(toNormalizedFillRect(
r),
data,
d);
1756 const QRect rr = toNormalizedFillRect(
r.translated(
s->matrix.dx(),
s->matrix.dy()));
1757 fillRect_normalized(rr,
data,
d);
1760 const QRect rr = toNormalizedFillRect(
s->matrix.mapRect(
r));
1761 fillRect_normalized(rr,
data,
d);
1765 ensureRasterState();
1766 if (
s->flags.tx_noshear) {
1767 d->initializeRasterizer(
data);
1779 ensureOutlineMapper();
1788 #ifdef QT_DEBUG_DRAW
1789 qDebug() <<
"QRasterPaintEngine::fillRecct(): " <<
r <<
brush;
1794 if (!
s->brushData.blend)
1805 #ifdef QT_DEBUG_DRAW
1806 qDebug() <<
"QRasterPaintEngine::fillRect(): " <<
r <<
color;
1813 if (
d->solid_color_filler.solidColor.isTransparent()
1817 d->solid_color_filler.clip =
d->clip();
1818 d->solid_color_filler.adjustSpanMethods();
1824 return a->y() <
b->y();
1835 sorted.reserve(pointCount);
1837 upper->
reserve(pointCount * 3 / 4);
1838 lower->
reserve(pointCount * 3 / 4);
1840 for (
int i = 0;
i < pointCount; ++
i)
1853 int side =
p->y() < splitY;
1854 int lastSide = last->
y() < splitY;
1856 if (side != lastSide) {
1858 bin[!side]->append(*
p);
1860 bin[side]->append(*last);
1863 QPointF intersection(
p->x() + delta.
x() * (splitY -
p->y()) / delta.
y(), splitY);
1865 bin[0]->append(intersection);
1866 bin[1]->append(intersection);
1870 bin[side]->append(*
p);
1876 return upper->
size() < pointCount && lower->
size() < pointCount;
1887 const int maxPoints = 0xffff;
1890 if (pointCount > maxPoints) {
1893 if (splitPolygon(
points, pointCount, &upper, &lower)) {
1897 qWarning(
"Polygon too complex for filling.");
1904 ensureOutlineMapper();
1908 ProcessSpans brushBlend =
d->getBrushFunc(
d->outlineMapper->controlPointRect,
1910 d->rasterize(outline, brushBlend, &
s->brushData,
d->rasterBuffer.data());
1921 #ifdef QT_DEBUG_DRAW
1922 qDebug(
" - QRasterPaintEngine::drawPolygon(F), pointCount=%d", pointCount);
1923 for (
int i=0;
i<pointCount; ++
i)
1938 if (
s->brushData.blend)
1943 if (
s->penData.blend) {
1945 if (
s->flags.fast_pen) {
1962 #ifdef QT_DEBUG_DRAW
1963 qDebug(
" - QRasterPaintEngine::drawPolygon(I), pointCount=%d", pointCount);
1964 for (
int i=0;
i<pointCount; ++
i)
1982 if (
s->brushData.blend) {
1984 ensureOutlineMapper();
1986 d->outlineMapper->moveTo(*
points);
1990 d->outlineMapper->lineTo(*(++
p));
1992 d->outlineMapper->endOutline();
1995 ProcessSpans brushBlend =
d->getBrushFunc(
d->outlineMapper->controlPointRect,
1997 d->rasterize(
d->outlineMapper->outline(), brushBlend, &
s->brushData,
d->rasterBuffer.data());
2002 if (
s->penData.blend) {
2003 int count = pointCount * 2;
2006 fpoints[
i] = ((
const int *)
points)[
i];
2009 if (
s->flags.fast_pen) {
2023 #ifdef QT_DEBUG_DRAW
2024 qDebug() <<
" - QRasterPaintEngine::drawPixmap(), pos=" <<
pos <<
" pixmap=" <<
pixmap.size() <<
"depth=" <<
pixmap.depth();
2030 if (
image.depth() == 1) {
2044 if (
pixmap.depth() == 1) {
2064 #ifdef QT_DEBUG_DRAW
2065 qDebug() <<
" - QRasterPaintEngine::drawPixmap(), r=" <<
r <<
" sr=" << sr <<
" pixmap=" <<
pixmap.size() <<
"depth=" <<
pixmap.depth();
2071 if (
image.depth() == 1) {
2075 &&
r.size() == sr.
size()
2076 &&
r.size() ==
pixmap.size()) {
2078 drawBitmap(
r.topLeft() +
QPointF(
s->matrix.dx(),
s->matrix.dy()),
image, &
s->penData);
2090 if (
image.depth() == 1) {
2094 &&
r.size() == sr.
size()
2095 &&
r.size() ==
pixmap.size()) {
2097 drawBitmap(
r.topLeft() +
QPointF(
s->matrix.dx(),
s->matrix.dy()),
image, &
s->penData);
2100 drawImage(
r,
d->rasterBuffer->colorizeBitmap(
image,
s->pen.color()), translatedSource);
2108 static inline int fast_ceil_positive(
const qreal &
v)
2110 const int iv = int(
v);
2119 const int xmin = int(
rect.x());
2120 const int xmax = int(fast_ceil_positive(
rect.right()));
2121 const int ymin = int(
rect.y());
2122 const int ymax = int(fast_ceil_positive(
rect.bottom()));
2123 return QRect(xmin, ymin, xmax - xmin, ymax - ymin);
2131 #ifdef QT_DEBUG_DRAW
2132 qDebug() <<
" - QRasterPaintEngine::drawImage(), p=" <<
p <<
" image=" <<
img.size() <<
"depth=" <<
img.depth();
2146 QPointF pt(
p.x() +
s->matrix.dx(),
p.y() +
s->matrix.dy());
2148 if (
d->canUseImageBlitting(
d->rasterBuffer->compositionMode,
img, pt,
img.rect())) {
2150 d->blitImage(pt,
img,
d->deviceRect);
2152 }
else if (
clip->hasRectClip) {
2153 d->blitImage(pt,
img,
clip->clipRect);
2156 }
else if (
d->canUseFastImageBlending(
d->rasterBuffer->compositionMode,
img)) {
2160 d->drawImage(pt,
img,
func,
d->deviceRect,
s->intOpacity);
2162 }
else if (
clip->hasRectClip) {
2171 d->image_filler.clip =
clip;
2173 if (!
d->image_filler.blend)
2175 d->image_filler.dx = -pt.
x();
2176 d->image_filler.dy = -pt.
y();
2179 fillRect_normalized(rr, &
d->image_filler,
d);
2186 return QRectF(
r.topLeft() *
t,
r.bottomRight() *
t);
2219 inline bool isPixelAligned(
const QPointF &pt)
2223 inline bool isPixelAligned(
const QRectF &
rect)
2233 Qt::ImageConversionFlags)
2235 #ifdef QT_DEBUG_DRAW
2236 qDebug() <<
" - QRasterPaintEngine::drawImage(), r=" <<
r <<
" sr=" << sr <<
" image=" <<
img.
size() <<
"depth=" <<
img.depth();
2250 if (
s->matrix.type() <=
QTransform::TxScale && !
s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) {
2257 switch (
img.format()) {
2277 d->solid_color_filler.clip =
d->clip();
2278 d->solid_color_filler.adjustSpanMethods();
2285 bool stretch_sr =
r.width() != sr.
width() ||
r.height() != sr.
height();
2292 &&
s->intOpacity == 256
2296 RotationType rotationType = qRotationType(
s->matrix);
2300 QRectF transformedTargetRect =
s->matrix.mapRect(
r);
2302 if (
d->canUseImageBlitting(
d->rasterBuffer->compositionMode,
img, transformedTargetRect.
topRight(), sr)) {
2304 if (clippedTransformedTargetRect.
isNull())
2307 QRectF clippedTargetRect =
s->matrix.inverted().mapRect(
QRectF(clippedTransformedTargetRect));
2309 QRect clippedSourceRect
2310 =
QRectF(sr.
x() + clippedTargetRect.
x() -
r.x(), sr.
y() + clippedTargetRect.
y() -
r.y(),
2315 const qsizetype dbpl =
d->rasterBuffer->bytesPerLine();
2321 const uchar *srcBase =
img.bits() + clippedSourceRect.
y() * sbpl + clippedSourceRect.
x() *
bpp;
2322 uchar *dstBase =
dst + clippedTransformedTargetRect.
y() * dbpl + clippedTransformedTargetRect.
x() *
bpp;
2336 QRectF targetBounds =
s->matrix.mapRect(
r);
2337 bool exceedsPrecision =
r.
width() > 0x7fff
2338 ||
r.height() > 0x7fff
2339 || targetBounds.
left() < -0x7fff
2340 || targetBounds.
top() < -0x7fff
2341 || targetBounds.
right() > 0x7fff
2342 || targetBounds.
bottom() > 0x7fff
2343 || targetBounds.
width() > 0x7fff
2344 || targetBounds.
height() > 0x7fff
2345 ||
s->matrix.m11() >= 512
2346 ||
s->matrix.m22() >= 512;
2347 if (!exceedsPrecision &&
d->canUseFastImageBlending(
d->rasterBuffer->compositionMode,
img)) {
2352 if (
func && (!
clip ||
clip->hasRectClip) && !
s->flags.antialiased && targetBounds.
width() >= 16 && targetBounds.
height() >= 16) {
2353 func(
d->rasterBuffer->buffer(),
d->rasterBuffer->bytesPerLine(),
img.bits(),
2354 img.bytesPerLine(),
r, sr, !
clip ?
d->deviceRect :
clip->clipRect,
2355 s->matrix,
s->intOpacity);
2360 bool sourceRect2x =
r.width() * 2 == sr.
width() &&
r.height() * 2 == sr.
height();
2361 bool scale2x = (
s->matrix.m11() ==
qreal(2)) && (
s->matrix.m22() ==
qreal(2));
2365 QPointF pt(
r.x() * 2 +
s->matrix.dx(),
r.y() * 2 +
s->matrix.dy());
2369 }
else if (
clip->hasRectClip) {
2377 func(
d->rasterBuffer->buffer(),
d->rasterBuffer->bytesPerLine(),
2378 img.bits(),
img.bytesPerLine(),
img.height(),
2393 d->image_filler_xform.clip =
clip;
2395 if (!
d->image_filler_xform.blend)
2397 d->image_filler_xform.setupMatrix(copy,
s->flags.bilinear);
2411 #ifdef QT_FAST_SPANS
2412 ensureRasterState();
2414 d->initializeRasterizer(&
d->image_filler_xform);
2415 d->rasterizer->setAntialiased(
s->flags.antialiased);
2421 if (
s->flags.tx_noshear)
2422 d->rasterizer->rasterizeLine(
a,
b,
rect.height() /
rect.width());
2424 d->rasterizer->rasterizeLine(
a,
b,
qAbs((
s->matrix.m22() *
rect.height()) / (
s->matrix.m11() *
rect.width())));
2432 m.m21(),
m.m22(),
m.m23(),
2433 m.m31(),
m.m32(),
m.m33());
2437 QPointF pt(
r.x() +
s->matrix.dx(),
r.y() +
s->matrix.dy());
2438 if (
d->canUseImageBlitting(
d->rasterBuffer->compositionMode,
img, pt, sr)) {
2440 d->blitImage(pt,
img,
d->deviceRect, sr.
toRect());
2442 }
else if (
clip->hasRectClip) {
2446 }
else if (
d->canUseFastImageBlending(
d->rasterBuffer->compositionMode,
img)) {
2452 }
else if (
clip->hasRectClip) {
2459 d->image_filler.clip =
clip;
2461 if (!
d->image_filler.blend)
2463 d->image_filler.dx = -(
r.x() +
s->matrix.dx()) + sr.
x();
2464 d->image_filler.dy = -(
r.y() +
s->matrix.dy()) + sr.
y();
2483 #ifdef QT_DEBUG_DRAW
2484 qDebug() <<
" - QRasterPaintEngine::drawTiledPixmap(), r=" <<
r <<
"pixmap=" <<
pixmap.size();
2499 if (
image.depth() == 1)
2500 image =
d->rasterBuffer->colorizeBitmap(
image,
s->pen.color());
2502 const qreal pixmapDevicePixelRatio =
pixmap.devicePixelRatio();
2507 const qreal inverseDpr =
qreal(1.0) / pixmapDevicePixelRatio;
2508 copy.
scale(inverseDpr, inverseDpr);
2509 d->image_filler_xform.clip =
d->clip();
2511 if (!
d->image_filler_xform.blend)
2513 d->image_filler_xform.setupMatrix(copy,
s->flags.bilinear);
2515 #ifdef QT_FAST_SPANS
2516 ensureRasterState();
2518 d->initializeRasterizer(&
d->image_filler_xform);
2519 d->rasterizer->setAntialiased(
s->flags.antialiased);
2524 if (
s->flags.tx_noshear)
2525 d->rasterizer->rasterizeLine(
a,
b,
rect.height() /
rect.width());
2527 d->rasterizer->rasterizeLine(
a,
b,
qAbs((
s->matrix.m22() *
rect.height()) / (
s->matrix.m11() *
rect.width())));
2535 d->image_filler.clip =
d->clip();
2538 if (!
d->image_filler.blend)
2540 d->image_filler.dx = -(
r.x() +
s->matrix.dx()) + sr.
x();
2541 d->image_filler.dy = -(
r.y() +
s->matrix.dy()) + sr.
y();
2551 static inline bool monoVal(
const uchar*
s,
int x)
2553 return (
s[
x>>3] << (
x&7)) & 0x80;
2562 return d->rasterBuffer.data();
2573 if (!
s->penData.blend)
2578 useGammaCorrection =
false;
2582 bool unclipped =
false;
2585 const bool intersects = qMax(
clip->xmin,
rect.left()) <= qMin(
clip->xmax - 1,
rect.right())
2588 if (
clip->hasRectClip) {
2589 unclipped =
rx >
clip->xmin
2599 const bool intersects = qMax(0,
rect.left()) <= qMin(
rb->width() - 1,
rect.right())
2600 && qMax(0,
rect.top()) <= qMin(
rb->height() - 1,
rect.bottom());
2606 &&
rect.top() >= 0 &&
rect.bottom() <
rb->height();
2611 ProcessSpans blend = unclipped ?
s->penData.unclipped_blend :
s->penData.blend;
2614 if (
s->flags.fast_text) {
2617 if (
s->penData.bitmapBlit) {
2618 s->penData.bitmapBlit(
rb,
rx,
ry,
s->penData.solidColor,
2619 scanline,
w,
h, bpl);
2622 }
else if (
depth == 8) {
2623 if (
s->penData.alphamapBlit) {
2624 s->penData.alphamapBlit(
rb,
rx,
ry,
s->penData.solidColor,
2625 scanline,
w,
h, bpl,
nullptr, useGammaCorrection);
2628 }
else if (
depth == 32) {
2630 if (
s->penData.alphaRGBBlit) {
2631 s->penData.alphaRGBBlit(
rb,
rx,
ry,
s->penData.solidColor,
2632 (
const uint *) scanline,
w,
h, bpl / 4,
nullptr, useGammaCorrection);
2636 }
else if ((
depth == 8 &&
s->penData.alphamapBlit) || (
depth == 32 &&
s->penData.alphaRGBBlit)) {
2639 int nx = qMax(0,
rx);
2640 int ny = qMax(0,
ry);
2643 int xdiff =
nx -
rx;
2644 int ydiff =
ny -
ry;
2645 scanline += ydiff * bpl;
2646 scanline += xdiff * (
depth == 32 ? 4 : 1);
2651 if (
nx +
w >
d->rasterBuffer->width())
2652 w =
d->rasterBuffer->width() -
nx;
2653 if (
ny +
h >
d->rasterBuffer->height())
2654 h =
d->rasterBuffer->height() -
ny;
2660 s->penData.alphamapBlit(
rb,
rx,
ry,
s->penData.solidColor,
2661 scanline,
w,
h, bpl,
clip, useGammaCorrection);
2662 else if (
depth == 32)
2663 s->penData.alphaRGBBlit(
rb,
rx,
ry,
s->penData.solidColor,
2664 (
const uint *) scanline,
w,
h, bpl / 4,
clip, useGammaCorrection);
2678 scanline += bpl *
y0;
2682 w = qMin(
w,
rb->width() - qMax(0,
rx));
2683 h = qMin(
h,
rb->height() - qMax(0,
ry));
2685 if (
w <= 0 ||
h <= 0)
2688 const int NSPANS = 256;
2689 QSpan spans[NSPANS];
2692 const int x1 =
x0 +
w;
2693 const int y1 =
y0 +
h;
2696 for (
int y =
y0;
y <
y1; ++
y) {
2697 for (
int x =
x0;
x <
x1; ) {
2698 if (!monoVal(scanline,
x)) {
2703 if (current == NSPANS) {
2704 blend(current, spans, &
s->penData);
2707 spans[current].
x =
x +
rx;
2708 spans[current].
y =
y +
ry;
2713 while (
x <
x1 && monoVal(scanline,
x)) {
2717 spans[current].
len =
len;
2722 }
else if (
depth == 8) {
2723 for (
int y =
y0;
y <
y1; ++
y) {
2724 for (
int x =
x0;
x <
x1; ) {
2726 if (scanline[
x] == 0) {
2731 if (current == NSPANS) {
2732 blend(current, spans, &
s->penData);
2735 int coverage = scanline[
x];
2736 spans[current].
x =
x +
rx;
2737 spans[current].
y =
y +
ry;
2738 spans[current].
coverage = coverage;
2743 while (
x <
x1 && scanline[
x] == coverage) {
2747 spans[current].
len =
len;
2753 const uint *sl = (
const uint *) scanline;
2754 for (
int y =
y0;
y <
y1; ++
y) {
2755 for (
int x =
x0;
x <
x1; ) {
2757 if ((sl[
x] & 0x00ffffff) == 0) {
2762 if (current == NSPANS) {
2763 blend(current, spans, &
s->penData);
2766 uint rgbCoverage = sl[
x];
2767 int coverage =
qGreen(rgbCoverage);
2768 spans[current].
x =
x +
rx;
2769 spans[current].
y =
y +
ry;
2770 spans[current].
coverage = coverage;
2775 while (
x <
x1 && sl[
x] == rgbCoverage) {
2779 spans[current].
len =
len;
2782 sl += bpl /
sizeof(
uint);
2789 blend(current, spans, &
s->penData);
2810 if (d_func()->mono_surface)
2815 if (!verticalSubPixelPositions)
2824 switch (alphaMap->
format) {
2827 bytesPerLine = ((alphaMap->
width + 31) & ~31) >> 3;
2831 bytesPerLine = (alphaMap->
width + 3) & ~3;
2835 bytesPerLine = alphaMap->
width * 4;
2841 QFixed y = verticalSubPixelPositions
2862 cache->populate(fontEngine,
numGlyphs, glyphs, positions,
s->renderHints);
2863 cache->fillInPendingGlyphs();
2873 else if (
depth == 1)
2876 int margin = fontEngine->
glyphMargin(glyphFormat);
2880 if (!verticalSubPixelPositions)
2881 subPixelPosition.
y = 0;
2888 int x =
qFloor(positions[
i].
x) +
c.baseLineX - margin;
2889 int y = (verticalSubPixelPositions
2892 y -=
c.baseLineY + margin;
2902 const uchar *glyphBits =
bits + ((
c.x << leftShift) >> rightShift) +
c.y * bpl;
2911 s->matrix = originalTransform;
2946 return qt_region_strictContains(cl->
clipRegion,
r);
2969 if (
s->flags.antialiased)
2973 r.
setX(
r.x() - penWidth);
2974 r.setY(
r.y() - penWidth);
2975 r.setWidth(
r.width() + 2 * penWidth);
2976 r.setHeight(
r.height() + 2 * penWidth);
2985 return qt_region_strictContains(cl->
clipRegion,
r);
2993 if (norm.
left() <= INT_MIN || norm.
top() <= INT_MIN
2994 || norm.
right() > INT_MAX || norm.
bottom() > INT_MAX
2995 || norm.
width() > INT_MAX || norm.
height() > INT_MAX)
3023 const int penWidth =
s->flags.fast_pen ? 1 :
qCeil(
s->lastPen.widthF());
3047 while (last >
first) {
3069 ensureRasterState();
3103 #ifdef QT_DEBUG_DRAW
3105 fprintf(stderr,
" - QRasterPaintEngine::drawTextItem(), (%.2f,%.2f), string=%s ct=%d\n",
3107 d->glyphCacheFormat);
3113 ensureRasterState();
3137 ti.
flags, glyphs, positions);
3146 staticTextItem.
color =
s->pen.color();
3147 staticTextItem.
font =
s->font;
3167 if (!
s->penData.blend)
3170 if (!
s->flags.fast_pen) {
3186 if (!
s->penData.blend)
3189 if (!
s->flags.fast_pen) {
3203 #ifdef QT_DEBUG_DRAW
3204 qDebug() <<
" - QRasterPaintEngine::drawLines(QLine*)" << lineCount;
3210 if (!
s->penData.blend)
3213 if (
s->flags.fast_pen) {
3215 for (
int i=0;
i<lineCount; ++
i) {
3233 const QPen &pen =
s->lastPen;
3237 qreal patternLength = 0;
3241 if (patternLength <= 0)
3258 *dashOffset += dash /
width;
3262 *inDash = !(*inDash);
3263 if (++*dashIndex >=
pattern.size())
3280 #ifdef QT_DEBUG_DRAW
3281 qDebug() <<
" - QRasterPaintEngine::drawLines(QLineF *)" << lineCount;
3287 if (!
s->penData.blend)
3289 if (
s->flags.fast_pen) {
3291 for (
int i=0;
i<lineCount; ++
i) {
3312 && !
s->flags.antialiased
3325 drawEllipse_midpoint_i(brect,
d->deviceRect, penBlend, brushBlend,
3326 &
s->penData, &
s->brushData);
3338 void QRasterPaintEngine::setDC(HDC hdc) {
3346 HDC QRasterPaintEngine::getDC()
const
3355 void QRasterPaintEngine::releaseDC(HDC)
const
3412 const int spanCount = 256;
3419 int ymax = qMin(
qRound(
pos.y() +
h),
d->rasterBuffer->height());
3421 int xmax = qMin(
qRound(
pos.x() +
w),
d->rasterBuffer->width());
3427 for (
int y = ymin;
y < ymax; ++
y) {
3430 for (
int x = 0;
x < xmax - xmin; ++
x) {
3431 int src_x =
x + x_offset;
3437 if (pixel & (0x1 << (src_x & 7))) {
3438 spans[
n].
x = xmin +
x;
3442 while (src_x+1 <
w &&
src[(src_x+1) >> 3] & (0x1 << ((src_x+1) & 7))) {
3446 spans[
n].
len = ((
len + spans[
n].
x) > xmax) ? (xmax - spans[
n].
x) :
len;
3449 if (
n == spanCount) {
3456 for (
int x = 0;
x < xmax - xmin; ++
x) {
3457 int src_x =
x + x_offset;
3463 if (pixel & (0x80 >> (
x & 7))) {
3464 spans[
n].
x = xmin +
x;
3468 while (src_x+1 <
w &&
src[(src_x+1) >> 3] & (0x80 >> ((src_x+1) & 7))) {
3472 spans[
n].
len = ((
len + spans[
n].
x) > xmax) ? (xmax - spans[
n].
x) :
len;
3475 if (
n == spanCount) {
3523 return d->deviceRect;
3525 if (
clip->hasRectClip)
3526 return clip->clipRect;
3545 QSize(
c->xmax -
c->xmin,
c->ymax -
c->ymin));
3547 blend =
data->blend;
3549 blend =
data->unclipped_blend;
3560 if (!callback || !outline)
3566 if (!
s->flags.antialiased) {
3593 if (!callback || !outline)
3599 if (!
s->flags.antialiased) {
3618 uchar *rasterPoolBase = alignAddress(rasterPoolOnStack, 0xf);
3619 uchar *rasterPoolOnHeap =
nullptr;
3623 void *
data = userData;
3631 rasterParams.
target =
nullptr;
3632 rasterParams.
source = outline;
3637 rasterParams.
bit_set =
nullptr;
3644 int rendered_spans = 0;
3655 rasterPoolSize *= 2;
3656 if (rasterPoolSize > 1024 * 1024) {
3657 qWarning(
"QPainter: Rasterization of primitive failed");
3663 free(rasterPoolOnHeap);
3664 rasterPoolOnHeap = (
uchar *)malloc(rasterPoolSize + 0xf);
3668 rasterPoolBase = alignAddress(rasterPoolOnHeap, 0xf);
3678 free(rasterPoolOnHeap);
3686 if (!
s->clipEnabled)
3689 qrasterpaintengine_state_setNoClip(
s);
3707 return s->flags.fast_images
3710 && !
image.hasAlphaChannel()));
3719 && !
image.hasAlphaChannel())))
3725 if (
s->intOpacity != 256
3726 ||
image.depth() < 8
3728 && (!isPixelAligned(pt) || !isPixelAligned(sr))))
3742 return (dFormat == sFormat);
3785 bytes_per_pixel =
image->depth()/8;
3786 bytes_per_line =
image->bytesPerLine();
3790 if (
image->depth() == 1 &&
image->colorTable().size() == 2) {
3838 const int maxSpans = (
ymax -
ymin) * numRects;
3844 int firstInBand = 0;
3845 while (firstInBand < numRects) {
3846 const int currMinY = rects[firstInBand].y();
3847 const int currMaxY = currMinY + rects[firstInBand].height();
3849 while (
y < currMinY) {
3855 int lastInBand = firstInBand;
3856 while (lastInBand + 1 < numRects && rects[lastInBand+1].
top() ==
y)
3859 while (
y < currMaxY) {
3864 for (
int r = firstInBand;
r <= lastInBand; ++
r) {
3865 const QRect &currRect = rects[
r];
3867 span->x = currRect.
x();
3870 span->coverage = 255;
3876 firstInBand = lastInBand + 1;
3907 span->coverage = 255;
3948 const int firstLeft =
m_spans[0].
x;
3956 if (
span.y !=
y + 1 &&
y != -1)
3964 const int spanLeft =
span.x;
3965 const int spanRight = spanLeft +
span.len;
3967 if (spanLeft <
xmin)
3970 if (spanRight >
xmax)
3973 if (spanLeft != firstLeft || spanRight != firstRight)
4042 static const QSpan *qt_intersect_spans(
const QClipData *clip,
int *currentClip,
4044 QSpan **outSpans,
int available)
4053 while (available && spans <
end ) {
4054 if (clipSpans >= clipEnd) {
4058 if (clipSpans->
y > spans->
y) {
4062 if (spans->
y != clipSpans->
y) {
4072 int sx2 = sx1 + spans->
len;
4073 int cx1 = clipSpans->
x;
4074 int cx2 = cx1 + clipSpans->
len;
4076 if (cx1 < sx1 && cx2 < sx1) {
4079 }
else if (sx1 < cx1 && sx2 < cx1) {
4083 int x = qMax(sx1, cx1);
4084 int len = qMin(sx2, cx2) -
x;
4086 out->x = qMax(sx1, cx1);
4087 out->len = qMin(sx2, cx2) -
out->x;
4101 *currentClip = clipSpans - clip->
m_spans;
4105 static void qt_span_fill_clipped(
int spanCount,
const QSpan *spans,
void *userData)
4112 const int NSPANS = 256;
4113 QSpan cspans[NSPANS];
4114 int currentClip = 0;
4115 const QSpan *
end = spans + spanCount;
4116 while (spans <
end) {
4117 QSpan *clipped = cspans;
4118 spans = qt_intersect_spans(fillData->
clip, ¤tClip, spans,
end, &clipped, NSPANS);
4122 if (clipped - cspans)
4132 static int qt_intersect_spans(
QT_FT_Span *&spans,
int numSpans,
4135 const int minx = clip.
left();
4136 const int miny = clip.
top();
4137 const int maxx = clip.
right();
4138 const int maxy = clip.
bottom();
4141 while (spans <
end) {
4142 if (spans->
y >= miny)
4151 if (
s->x > maxx ||
s->x +
s->len <= minx) {
4157 s->len = qMin(
s->len - (minx -
s->x), maxx - minx + 1);
4160 s->len = qMin(
s->len, (maxx -
s->x + 1));
4169 static void qt_span_fill_clipRect(
int count,
const QSpan *spans,
4186 static void qt_span_clip(
int count,
const QSpan *spans,
void *userData)
4202 int currentClip = 0;
4204 while (spans <
end) {
4206 spans = qt_intersect_spans(clipData->
oldClip, ¤tClip, spans,
end,
4245 for (
int i = 0;
i < stops.
size() &&
i <= 2;
i++)
4246 hash_val += stops[
i].second.rgba64();
4255 const auto &cache_info =
it.value();
4256 if (cache_info->stops == stops && cache_info->opacity == opacity && cache_info->interpolationMode == gradient.
interpolationMode())
4270 int size,
int opacity)
const;
4279 cache_entry->buffer32[
i] = cache_entry->buffer64[
i].toArgb32();
4280 return cache.
insert(hash_val, cache_entry).value();
4290 int stopCount = stops.
count();
4295 if (stopCount == 2) {
4302 if (second_stop < first_stop) {
4304 first_color = second_color;
4306 qSwap(first_stop, second_stop);
4309 if (colorInterpolation) {
4329 if (colorInterpolation)
4335 if (
i < second_index) {
4336 qreal reciprocal =
qreal(1) / (second_index - first_index);
4338 int red_delta =
qRound((
qreal(red_second) - red_first) * reciprocal);
4339 int green_delta =
qRound((
qreal(green_second) - green_first) * reciprocal);
4340 int blue_delta =
qRound((
qreal(blue_second) - blue_first) * reciprocal);
4341 int alpha_delta =
qRound((
qreal(alpha_second) - alpha_first) * reciprocal);
4344 red_first += 1 << 15;
4345 green_first += 1 << 15;
4346 blue_first += 1 << 15;
4347 alpha_first += 1 << 15;
4350 red_first += red_delta;
4351 green_first += green_delta;
4352 blue_first += blue_delta;
4353 alpha_first += alpha_delta;
4355 const QRgba64 color =
qRgba64(red_first >> 16, green_first >> 16, blue_first >> 16, alpha_first >> 16);
4357 if (colorInterpolation)
4365 if (colorInterpolation)
4375 if (stopCount == 1) {
4377 for (
int i = 0;
i <
size; ++
i)
4390 qreal dpos = 1.5 * incr;
4394 while (dpos <= begin_pos) {
4400 int current_stop = 0;
4405 if (dpos < end_pos) {
4407 while (dpos > stops[current_stop+1].
first)
4410 if (current_stop != 0)
4411 current_color =
combineAlpha256(stops[current_stop].second.rgba64(), opacity);
4412 next_color =
combineAlpha256(stops[current_stop+1].second.rgba64(), opacity);
4414 if (colorInterpolation) {
4421 t = (dpos - stops[current_stop].
first) *
c;
4425 Q_ASSERT(current_stop < stopCount);
4428 int idist = 256 -
dist;
4430 if (colorInterpolation)
4438 if (dpos >= end_pos)
4444 while (dpos > stops[current_stop+skip+1].
first)
4448 current_stop += skip;
4450 current_color = next_color;
4452 current_color =
combineAlpha256(stops[current_stop].second.rgba64(), opacity);
4453 next_color =
combineAlpha256(stops[current_stop+1].second.rgba64(), opacity);
4455 if (colorInterpolation) {
4463 t = (dpos - stops[current_stop].
first) *
c;
4489 m11 = m22 = m33 = 1.;
4490 m12 = m13 = m21 = m23 = dx = dy = 0.0;
4491 clip = pe ? pe->d_func()->clip() :
nullptr;
4500 switch (brushStyle) {
4516 auto cacheInfo = qt_gradient_cache()->getBuffer(*
g,
alpha);
4518 #if QT_CONFIG(raster_64bit) || QT_CONFIG(raster_fp)
4519 gradient.colorTable64 = cacheInfo->buffer64;
4527 linearData.
origin.
x =
g->start().x();
4528 linearData.
origin.
y =
g->start().y();
4529 linearData.
end.
x =
g->finalStop().x();
4530 linearData.
end.
y =
g->finalStop().y();
4540 auto cacheInfo = qt_gradient_cache()->getBuffer(*
g,
alpha);
4542 #if QT_CONFIG(raster_64bit) || QT_CONFIG(raster_fp)
4543 gradient.colorTable64 = cacheInfo->buffer64;
4556 radialData.
focal.
x = focal.
x();
4557 radialData.
focal.
y = focal.
y();
4568 auto cacheInfo = qt_gradient_cache()->getBuffer(*
g,
alpha);
4570 #if QT_CONFIG(raster_64bit) || QT_CONFIG(raster_fp)
4571 gradient.colorTable64 = cacheInfo->buffer64;
4666 blend = qt_span_fill_clipped;
4674 delta.
translate(1.0 / 65536, 1.0 / 65536);
4689 const bool affine = inv.
isAffine();
4695 && f1 > (1.0 / 65536)
4696 && f2 > (1.0 / 65536)
4706 if (!
d ||
d->height == 0) {
4723 if (sourceRect.
isNull()) {
4735 texture.bytesPerLine =
d->bytes_per_line;
4751 static inline void drawEllipsePoints(
int x,
int y,
int length,
4762 const int midx =
rect.x() + (
rect.width() + 1) / 2;
4763 const int midy =
rect.y() + (
rect.height() + 1) / 2;
4769 outline[0].
x = midx + (midx -
x) - (
length - 1) - (
rect.width() & 0x1);
4781 outline[2].
x = outline[0].
x;
4782 outline[2].
len = outline[0].
len;
4783 outline[2].
y = midy + (midy -
y) - (
rect.height() & 0x1);
4789 outline[3].
y = outline[2].
y;
4792 if (brush_func && outline[0].
x + outline[0].
len < outline[1].
x) {
4797 fill[0].x = outline[0].
x + outline[0].
len - 1;
4798 fill[0].len = qMax(0, outline[1].
x -
fill[0].
x);
4799 fill[0].y = outline[1].
y;
4800 fill[0].coverage = 255;
4803 fill[1].x = outline[2].
x + outline[2].
len - 1;
4804 fill[1].len = qMax(0, outline[3].
x -
fill[1].
x);
4805 fill[1].y = outline[3].
y;
4806 fill[1].coverage = 255;
4808 int n = (
fill[0].y >=
fill[1].y ? 1 : 2);
4809 n = qt_intersect_spans(
fill,
n, clip);
4811 brush_func(
n,
fill, brush_data);
4814 int n = (outline[1].
y >= outline[2].
y ? 2 : 4);
4815 n = qt_intersect_spans(outline,
n, clip);
4817 pen_func(
n, outline, pen_data);
4825 static void drawEllipse_midpoint_i(
const QRect &
rect,
const QRect &clip,
4834 int y = (
rect.height() + 1) / 2;
4838 while (
a*
a*(2*
y - 1) > 2*
b*
b*(
x + 1)) {
4843 d +=
b*
b*(2*
x + 3) +
a*
a*(-2*
y + 2);
4844 drawEllipsePoints(startx,
y,
x - startx + 1,
rect, clip,
4845 pen_func, brush_func, pen_data, brush_data);
4850 drawEllipsePoints(startx,
y,
x - startx + 1,
rect, clip,
4851 pen_func, brush_func, pen_data, brush_data);
4854 d =
b*
b*(
x + 0.5)*(
x + 0.5) +
a*
a*((
y - 1)*(
y - 1) -
b*
b);
4855 const int miny =
rect.height() & 0x1;
4858 d +=
b*
b*(2*
x + 2) +
a*
a*(-2*
y + 3);
4861 d +=
a*
a*(-2*
y + 3);
4864 drawEllipsePoints(
x,
y, 1,
rect, clip,
4865 pen_func, brush_func, pen_data, brush_data);
4876 #ifdef QT_DEBUG_DRAW
4880 clipImg.fill(0xffff0000);
4889 for (
int i = 0;
i < clip->
count; ++
i) {
4891 for (
int j = 0;
j <
span->len; ++
j)
4892 clipImg.setPixel(
span->x +
j,
span->y, 0xffffff00);
small capitals from c petite p scientific i
[1]
The QBrush class defines the fill pattern of shapes drawn by QPainter.
QTransform transform() const
struct QClipData::ClipLine * m_clipLines
void setClipRegion(const QRegion ®ion)
void setClipRect(const QRect &rect)
void appendSpans(const QSpan *s, int num)
The QColor class provides colors based on RGB, HSV or CMYK values.
The QConicalGradient class is used in combination with QBrush to specify a conical gradient brush.
void drawPath(const QVectorPath &path)
void drawPoints(const QPoint *points, int num)
void drawLine(const QPointF &p1, const QPointF &p2)
static int repetitionLimit()
void setGlyphCache(const void *key, QFontEngineGlyphCache *data)
virtual bool expectsGammaCorrectedBlending() const
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)=0
virtual Glyph * glyphData(glyph_t glyph, const QFixedPoint &subPixelPosition, GlyphFormat neededFormat, const QTransform &t)
virtual int glyphMargin(GlyphFormat format)
virtual bool supportsVerticalSubPixelPositions() const
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
virtual bool supportsTransformation(const QTransform &transform) const
QFontEngineGlyphCache * glyphCache(const void *key, GlyphFormat format, const QTransform &transform, const QColor &color=QColor()) const
virtual bool hasInternalCaching() const
virtual QFixedPoint subPixelPositionFor(const QFixedPoint &position) const
QSharedPointer< const CacheInfo > addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity)
QMultiHash< quint64, QSharedPointer< const CacheInfo > > QGradientColorTableHash
QSharedPointer< const CacheInfo > getBuffer(const QGradient &gradient, int opacity)
void generateGradientColorTable(const QGradient &g, QRgba64 *colorTable, int size, int opacity) const
QGradientColorTableHash cache
The QGradient class is used in combination with QBrush to specify gradient fills.
InterpolationMode interpolationMode() const
QGradientStops stops() const
The QImage class provides a hardware-independent image representation that allows direct access to th...
static QPixelFormat toPixelFormat(QImage::Format format) noexcept
@ Format_ARGB6666_Premultiplied
@ Format_ARGB8555_Premultiplied
@ Format_RGBA8888_Premultiplied
@ Format_ARGB8565_Premultiplied
@ Format_A2BGR30_Premultiplied
@ Format_ARGB32_Premultiplied
@ Format_A2RGB30_Premultiplied
@ Format_ARGB4444_Premultiplied
const uchar * constScanLine(int) const
The QLineF class provides a two-dimensional vector using floating point precision.
constexpr QPointF p1() const
constexpr QPointF p2() const
The QLine class provides a two-dimensional vector using integer precision.
The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush.
qsizetype size() const noexcept
const_pointer constData() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
void reserve(qsizetype size)
bool qFuzzyCompare(const QMatrix4x4 &m1, const QMatrix4x4 &m2)
The QMultiHash class is a convenience QHash subclass that provides multi-valued hashes.
const_iterator constEnd() const noexcept
iterator insert(const Key &key, const T &value)
qsizetype size() const noexcept
friend class const_iterator
iterator erase(const_iterator it)
const_iterator constFind(const Key &key) const noexcept
The QMutex class provides access serialization between threads.
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes.
virtual int devType() const
virtual void drawRects(const QRect *rects, int rectCount) override
virtual void stroke(const QVectorPath &path, const QPen &pen)
virtual void drawEllipse(const QRectF &r) override
virtual void drawLines(const QLine *lines, int lineCount) override
virtual void clip(const QVectorPath &path, Qt::ClipOperation op)=0
virtual bool requiresPretransformedGlyphPositions(QFontEngine *fontEngine, const QTransform &m) const
virtual bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
virtual void setState(QPainterState *s)
virtual void drawPoints(const QPointF *points, int pointCount) override
virtual void drawStaticTextItem(QStaticTextItem *)
void replayClipOperations()
void setActive(bool newState)
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
QPainter * painter() const
void setDirty(DirtyFlags df)
PaintEngineFeatures gccaps
QRegion systemClip() const
QPaintEngine::DirtyFlags state() const
QPaintDevice * device() const
@ VerticalSubpixelPositioning
@ CompositionMode_SourceOver
The QPainterPath::Element class specifies the position and type of a subpath.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
The QPen class defines how a QPainter should draw lines and outlines of shapes.
QList< qreal > dashPattern() const
Qt::PenCapStyle capStyle() const
The QPixmap class is an off-screen image representation that can be used as a paint device.
The QPointF class defines a point in the plane using floating point precision.
constexpr qreal x() const noexcept
constexpr qreal y() const noexcept
constexpr QPoint toPoint() const
The QPoint class defines a point in the plane using integer precision.
The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush.
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
double bounded(double highest)
bool monoDestinationWithClut
QImage::Format prepare(QImage *image)
QPainter::CompositionMode compositionMode
qsizetype bytesPerLine() const
QImage colorizeBitmap(const QImage &image, const QColor &color)
int bytesPerPixel() const
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
void compositionModeChanged() override
QPainterState * createState(QPainterState *orig) const override
void drawStaticTextItem(QStaticTextItem *textItem) override
void fill(const QVectorPath &path, const QBrush &brush) override
void transformChanged() override
void setState(QPainterState *s) override
void drawEllipse(const QRectF &rect) override
virtual bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine)
ClipType clipType() const
void brushChanged() override
void updatePen(const QPen &pen)
void renderHintsChanged() override
void drawPoints(const QPointF *points, int pointCount) override
QRasterPaintEngineState * state()
const QClipData * clipData() const
virtual void fillPath(const QPainterPath &path, QSpanData *fillData)
void stroke(const QVectorPath &path, const QPen &pen) override
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
void updateMatrix(const QTransform &matrix)
void opacityChanged() override
void drawPixmap(const QPointF &p, const QPixmap &pm) override
void updateBrush(const QBrush &brush)
void drawImage(const QPointF &p, const QImage &img) override
bool begin(QPaintDevice *device) override
bool requiresPretransformedGlyphPositions(QFontEngine *fontEngine, const QTransform &m) const override
QPoint coordinateOffset() const override
void alphaPenBlt(const void *src, int bpl, int depth, int rx, int ry, int w, int h, bool useGammaCorrection)
void clipEnabledChanged() override
QRasterBuffer * rasterBuffer()
void penChanged() override
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override
void drawLines(const QLine *line, int lineCount) override
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) override
bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const override
void fillRect(const QRectF &rect, const QBrush &brush) override
void clip(const QVectorPath &path, Qt::ClipOperation op) override
virtual void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)
QRasterPaintEngine(QPaintDevice *device)
void brushOriginChanged() override
QRectF clipBoundingRect() const
void drawRects(const QRect *rects, int rectCount) override
bool isUnclipped_normalized(const QRect &rect) const
QScopedPointer< QT_FT_Raster > grayRaster
void recalculateFastImages()
void initializeRasterizer(QSpanData *data)
ProcessSpans getBrushFunc(const QRect &rect, const QSpanData *data) const
bool canUseImageBlitting(QPainter::CompositionMode mode, const QImage &image, const QPointF &pt, const QRectF &sr) const
bool canUseFastImageBlending(QPainter::CompositionMode mode, const QImage &image) const
void drawImage(const QPointF &pt, const QImage &img, SrcOverBlendFunc func, const QRect &clip, int alpha, const QRect &sr=QRect())
bool isUnclipped(const QRect &rect, int penWidth) const
QRasterPaintEnginePrivate()
void rasterizeLine_dashed(QLineF line, qreal width, int *dashIndex, qreal *dashOffset, bool *inDash)
QScopedPointer< QClipData > baseClip
void blitImage(const QPointF &pt, const QImage &img, const QRect &clip, const QRect &sr=QRect())
const QClipData * clip() const
void systemStateChanged() override
void updateMatrixData(QSpanData *spanData, const QBrush &brush, const QTransform &brushMatrix)
void rasterize(QT_FT_Outline *outline, ProcessSpans callback, QSpanData *spanData, QRasterBuffer *rasterBuffer)
QScopedPointer< QRasterBuffer > rasterBuffer
QRect deviceRectUnclipped
ProcessSpans getPenFunc(const QRectF &rect, const QSpanData *data) const
QScopedPointer< QRasterizer > rasterizer
~QRasterPaintEngineState()
QRasterPaintEngineState()
void setAntialiased(bool antialiased)
void initialize(ProcessSpans blend, void *data)
void rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap=false)
void setClipRect(const QRect &clipRect)
void rasterize(const QT_FT_Outline *outline, Qt::FillRule fillRule)
The QRectF class defines a finite rectangle in the plane using floating point precision.
constexpr bool isEmpty() const noexcept
constexpr qreal bottom() const noexcept
QRect toAlignedRect() const noexcept
constexpr qreal y() const noexcept
constexpr qreal height() const noexcept
constexpr qreal width() const noexcept
constexpr qreal x() const noexcept
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
constexpr QPointF bottomLeft() const noexcept
constexpr qreal left() const noexcept
bool intersects(const QRectF &r) const noexcept
QRectF normalized() const noexcept
constexpr QPointF topLeft() const noexcept
constexpr bool isValid() const noexcept
constexpr QPointF bottomRight() const noexcept
constexpr QSizeF size() const noexcept
constexpr QRect toRect() const noexcept
constexpr void translate(qreal dx, qreal dy) noexcept
constexpr qreal top() const noexcept
constexpr QPointF topRight() const noexcept
constexpr qreal right() const noexcept
The QRect class defines a rectangle in the plane using integer precision.
constexpr bool isEmpty() const noexcept
constexpr int height() const noexcept
constexpr bool isNull() const noexcept
QRect intersected(const QRect &other) const noexcept
constexpr int bottom() const noexcept
constexpr QPoint topLeft() const noexcept
constexpr int top() const noexcept
constexpr int left() const noexcept
constexpr void setRect(int x, int y, int w, int h) noexcept
constexpr int x() const noexcept
constexpr void setX(int x) noexcept
constexpr int width() const noexcept
constexpr QRect translated(int dx, int dy) const noexcept
constexpr int y() const noexcept
constexpr int right() const noexcept
void set(const QRectF &r)
QRectVectorPath(const QRect &r)
QRectVectorPath(const QRectF &r)
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
int rectCount() const noexcept
const_iterator begin() const noexcept
constexpr static QRgba64 fromArgb32(uint rgb)
constexpr quint16 red() const
constexpr quint16 alpha() const
constexpr quint16 green() const
constexpr quint16 blue() const
constexpr bool isTransparent() const
The QSharedPointer class holds a strong reference to a shared pointer.
static QSharedPointer create(Args &&...arguments)
The QSize class defines the size of a two-dimensional object using integer point precision.
QFixedPoint * glyphPositions
QFontEngine * fontEngine() const
void setFontEngine(QFontEngine *fe)
static QString fromLatin1(QByteArrayView ba)
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
QByteArray toLatin1() const
The QTextItem class provides all the information required to draw text in a custom paint engine.
constexpr size_type size() const noexcept
const T * constData() const
static uint polygonFlags(QPaintEngine::PolygonDrawMode mode)
QCache< int, Employee > cache
[0]
auto it unsigned count const
QTextStream & hex(QTextStream &stream)
QTextStream & bin(QTextStream &stream)
QTextStream & center(QTextStream &stream)
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld init[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
set set set set set set set macro pixldst1 op
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]
bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush &brush)
std::pair< T1, T2 > QPair
void qBlendTexture(int count, const QSpan *spans, void *userData)
DrawHelper qDrawHelper[QImage::NImageFormats]
void qBlendGradient(int count, const QSpan *spans, void *userData)
void(* SrcOverBlendFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int w, int h, int const_alpha)
QT_FT_SpanFunc ProcessSpans
#define GRADIENT_STOPTABLE_SIZE
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)
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)
QT_BEGIN_NAMESPACE bool done
bool qFuzzyIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
QT_BEGIN_INCLUDE_NAMESPACE typedef unsigned char uchar
QT_END_INCLUDE_NAMESPACE typedef double qreal
unsigned long long quint64
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
const QT_FT_Raster_Funcs qt_ft_grays_raster
#define MINIMUM_POOL_SIZE
int qt_depthForFormat(QImage::Format format)
QImage::Format qt_maybeAlphaVersionWithSameDepth(QImage::Format format)
constexpr float qDegreesToRadians(float degrees)
QRect qt_mapFillRect(const QRectF &rect, const QTransform &xf)
MemRotateFunc qMemRotateFunctions[QPixelLayout::BPPCount][3]
GLenum GLuint GLenum GLsizei length
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat x1
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum const void GLbitfield GLsizei numGlyphs
GLsizei GLenum const void GLuint GLsizei GLfloat * metrics
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLuint GLfloat GLfloat y0
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
GLuint GLenum GLenum transform
GLfixed GLfixed GLint GLint GLfixed points
GLfixed GLfixed GLfixed y2
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
GLuint GLuint64EXT address
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
GLenum GLenum GLsizei void GLsizei void void * span
GLfloat GLfloat GLfloat alpha
GLenum GLenum GLenum GLenum GLenum scale
constexpr QT_BEGIN_NAMESPACE int QT_RASTER_COORD_LIMIT
@ LineDrawIncludeLastPixel
Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert)
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
int q_gray_rendered_spans(QT_FT_Raster raster)
QRectF qt_mapRect_non_normalizing(const QRectF &r, const QTransform &t)
#define int_dim(pos, dim)
qreal qpen_widthf(const QPen &p)
Qt::BrushStyle qbrush_style(const QBrush &b)
Qt::PenStyle qpen_style(const QPen &p)
const QColor & qbrush_color(const QBrush &b)
const void * data_ptr(const QTransform &t)
Qt::PenCapStyle qpen_capStyle(const QPen &p)
Qt::PenJoinStyle qpen_joinStyle(const QPen &p)
QPixelLayout qPixelLayouts[QImage::NImageFormats]
#define QT_FT_RASTER_FLAG_CLIP
#define QT_FT_RASTER_FLAG_DIRECT
#define QT_FT_OUTLINE_NONE
#define QT_FT_RASTER_FLAG_AA
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr int qGreen(QRgb rgb)
constexpr QRgb qPremultiply(QRgb x)
constexpr QRgba64 qRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
QT_BEGIN_NAMESPACE QRgba64 combineAlpha256(QRgba64 rgba64, uint alpha256)
#define qt_fixed_to_real(fixed)
QT_BEGIN_NAMESPACE typedef qreal qfixed
Q_CHECK_PTR(a=new int[80])
std::uniform_real_distribution dist(1, 2.5)
[2]
QTextStream out(stdout)
[7]
socketLayer initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol)
Qt::ClipOperation operation
AlphaRGBBlitFunc alphaRGBBlit
AlphamapBlitFunc alphamapBlit
BitmapBlitFunc bitmapBlit
struct QConicalGradientData::@537 center
constexpr static QFixed fromReal(qreal r)
QRgb buffer32[GRADIENT_STOPTABLE_SIZE]
QRgba64 buffer64[GRADIENT_STOPTABLE_SIZE]
CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode)
QGradient::InterpolationMode interpolationMode
QRadialGradientData radial
const QRgb * colorTable32
QLinearGradientData linear
QConicalGradientData conical
struct QLinearGradientData::@534 end
struct QLinearGradientData::@533 origin
struct QRadialGradientData::@536 focal
struct QRadialGradientData::@535 center
void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode)
AlphaRGBBlitFunc alphaRGBBlit
QRasterBuffer * rasterBuffer
void initTexture(const QImage *image, int alpha, QTextureData::Type=QTextureData::Plain, const QRect &sourceRect=QRect())
BitmapBlitFunc bitmapBlit
ProcessSpans unclipped_blend
AlphamapBlitFunc alphamapBlit
QSharedPointer< const Pinnable > cachedGradient
void setupMatrix(const QTransform &matrix, int bilinear)
QT_FT_Raster_DoneFunc raster_done
QT_FT_Raster_ResetFunc raster_reset
QT_FT_Raster_RenderFunc raster_render
QT_FT_Raster_NewFunc raster_new
QT_FT_Raster_BitTest_Func bit_test
QT_FT_SpanFunc gray_spans
QT_FT_Raster_BitSet_Func bit_set
QT_FT_SpanFunc black_spans