4#include <QtCore/qglobal.h>
5#include <QtCore/qmutex.h>
7#define QT_FT_BEGIN_HEADER
8#define QT_FT_END_HEADER
10#include <private/qrasterdefs_p.h>
11#include <private/qgrayraster_p.h>
21#include <private/qtextengine_p.h>
22#include <private/qfontengine_p.h>
23#include <private/qpixmap_raster_p.h>
25#include <private/qimage_p.h>
26#include <private/qstatictext_p.h>
27#include <private/qcosmeticstroker_p.h>
28#include <private/qdrawhelper_p.h>
29#include <private/qmemrotate_p.h>
30#include <private/qpixellayout_p.h>
31#include <private/qrgba64_p.h>
42# include <private/qfontengine_p.h>
101#define qt_swap_int(x, y) { int tmp = (x); (x) = (y); (y) = tmp; }
102#define qt_swap_qreal(x, y) { qreal tmp = (x); (x) = (y); (y) = tmp; }
115#define int_dim(pos, dim) (int(pos+dim) - int(pos))
119static inline bool winClearTypeFontsEnabled()
122#if !defined(SPI_GETFONTSMOOTHINGTYPE)
123# define SPI_GETFONTSMOOTHINGTYPE 0x200A
124# define FE_FONTSMOOTHINGCLEARTYPE 0x002
126 SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &
result, 0);
127 return result == FE_FONTSMOOTHINGCLEARTYPE;
133bool QRasterPaintEngine::clearTypeFontsEnabled()
135 static const bool result = winClearTypeFontsEnabled();
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)
215#if !defined(QT_NO_DEBUG) && 0
218 const char *
names[] = {
225 fprintf(stderr,
"\nQPainterPath: elementCount=%d\n",
path.elementCount());
226 for (
int i=0;
i<
path.elementCount(); ++
i) {
229 fprintf(stderr,
" - %3d:: %s, (%.2f, %.2f)\n",
i,
names[e.
type], e.
x, e.
y);
288 d_func()->device =
device;
298 d_func()->device =
device;
302void QRasterPaintEngine::init()
321 d->outlinemapper_xform_dirty =
true;
327 d->baseClip.reset(
new QClipData(
d->device->height()));
328 d->baseClip->setClipRect(
QRect(0, 0,
d->device->width(),
d->device->height()));
330 d->image_filler.init(
d->rasterBuffer.data(),
this);
333 d->image_filler_xform.init(
d->rasterBuffer.data(),
this);
336 d->solid_color_filler.init(
d->rasterBuffer.data(),
this);
339 d->deviceDepth =
d->device->depth();
341 d->mono_surface =
false;
346 switch (
d->device->devType()) {
348 qWarning(
"QRasterPaintEngine: unsupported for pixmaps...");
351 format =
d->rasterBuffer->prepare(
static_cast<QImage *
>(
d->device));
354 qWarning(
"QRasterPaintEngine: unsupported target device %d\n",
d->device->devType());
362 d->mono_surface =
true;
404 d->systemStateChanged();
407 ensureOutlineMapper();
408 d->outlineMapper->setClipRect(
d->deviceRect);
409 d->rasterizer->setClipRect(
d->deviceRect);
411 s->penData.init(
d->rasterBuffer.data(),
this);
412 s->penData.setup(
s->pen.brush(),
s->intOpacity,
s->composition_mode,
s->flags.cosmetic_brush);
413 s->stroker = &
d->basicStroker;
414 d->basicStroker.setClipRect(
d->deviceRect);
416 s->brushData.init(
d->rasterBuffer.data(),
this);
417 s->brushData.setup(
s->brush,
s->intOpacity,
s->composition_mode,
s->flags.cosmetic_brush);
424 qDebug() <<
"QRasterPaintEngine::begin(" << (
void *)
device
425 <<
") devType:" <<
device->devType()
426 <<
"devRect:" <<
d->deviceRect;
428 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->baseClip);
435 else if (clearTypeFontsEnabled())
459 qDebug() <<
"QRasterPaintEngine::end devRect:" <<
d->deviceRect;
461 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->baseClip);
478 ensureOutlineMapper();
485 if (
flags.has_clip_ownership)
503 flags.fast_pen =
true;
504 flags.non_complex_pen =
false;
505 flags.antialiased =
false;
506 flags.bilinear =
false;
507 flags.fast_text =
true;
508 flags.tx_noshear =
true;
509 flags.fast_images =
true;
510 flags.cosmetic_brush =
true;
513 flags.has_clip_ownership =
false;
523 , strokeFlags(
s.strokeFlags)
524 , lastBrush(
s.lastBrush)
525 , brushData(
s.brushData)
526 , fillFlags(
s.fillFlags)
527 , pixmapFlags(
s.pixmapFlags)
528 , intOpacity(
s.intOpacity)
532 , flag_bits(
s.flag_bits)
536 flags.has_clip_ownership =
false;
561 if (
t->clip &&
t->clip->enabled !=
t->clipEnabled) {
563 t->clip->enabled =
t->clipEnabled;
565 d->rasterBuffer->compositionMode =
s->composition_mode;
600 qDebug() <<
"QRasterPaintEngine::updatePen():" <<
s->pen;
608 s->penData.clip =
d->clip();
610 s->composition_mode,
s->flags.cosmetic_brush);
614 d->updateMatrixData(&
s->penData, pen.
brush(),
s->matrix);
631 d->basicStroker.setStrokeWidth(1);
633 d->basicStroker.setStrokeWidth(penWidth);
636 s->stroker = &
d->basicStroker;
641 d->dashStroker->setClipRect(
d->deviceRect);
644 QRectF clipRect =
s->matrix.inverted().mapRect(
QRectF(
d->deviceRect));
645 d->dashStroker->setClipRect(clipRect);
649 s->stroker =
d->dashStroker.data();
651 s->stroker =
nullptr;
658 && ((cosmetic && penWidth <= 1)
659 || (!cosmetic && (
s->flags.tx_noshear || !
s->flags.antialiased) && penWidth *
s->txscale <= 1));
675 qDebug() <<
"QRasterPaintEngine::brushOriginChanged()" <<
s->brushOrigin;
689 qDebug() <<
"QRasterPaintEngine::brushChanged():" <<
s->brush;
703 qDebug() <<
"QRasterPaintEngine::updateBrush()" <<
brush;
708 s->brushData.clip =
d->clip();
709 s->brushData.setup(
brush,
s->intOpacity,
s->composition_mode,
s->flags.cosmetic_brush);
712 d_func()->updateMatrixData(&
s->brushData,
brush,
d->brushMatrix());
717void QRasterPaintEngine::updateOutlineMapper()
723void QRasterPaintEngine::updateRasterState()
733 &&
s->intOpacity == 256
737 s->penData.solidColor.alphaF() >= 1.0f)));
752 qDebug() <<
"QRasterPaintEngine::opacityChanged()" <<
s->opacity;
759 s->intOpacity = (int) (
s->opacity * 256);
771 qDebug() <<
"QRasterPaintEngine::compositionModeChanged()" <<
s->composition_mode;
778 d->rasterBuffer->compositionMode =
s->composition_mode;
780 d->recalculateFastImages();
791 qDebug() <<
"QRasterPaintEngine::renderHintsChanged()" <<
Qt::hex <<
s->renderHints;
794 bool was_aa =
s->flags.antialiased;
795 bool was_bilinear =
s->flags.bilinear;
796 bool was_cosmetic_brush =
s->flags.cosmetic_brush;
802 if (was_aa !=
s->flags.antialiased)
805 if (was_bilinear !=
s->flags.bilinear || was_cosmetic_brush !=
s->flags.cosmetic_brush) {
811 d->recalculateFastImages();
813 if (was_aa !=
s->flags.antialiased)
825 qDebug() <<
"QRasterPaintEngine::transformChanged()" <<
s->matrix;
834 d->recalculateFastImages();
845 qDebug() <<
"QRasterPaintEngine::clipEnabledChanged()" <<
s->clipEnabled;
849 s->clip->enabled =
s->clipEnabled;
874 int srcSize =
img.depth() >> 3;
875 int iw =
img.width();
876 int ih =
img.height();
882 srcBits += ((sr.y() * srcBPL) + sr.x() * srcSize);
891 srcBits += srcSize *
d;
896 int d =
x + iw - cx2;
908 srcBits += srcBPL *
d;
913 int d =
y + ih - cy2;
944 int srcSize =
img.depth() >> 3;
945 int iw =
img.width();
946 int ih =
img.height();
952 srcBits += ((sr.y() * srcBPL) + sr.x() * srcSize);
961 srcBits += srcSize *
d;
966 int d =
x + iw - cx2;
978 srcBits += srcBPL *
d;
983 int d =
y + ih - cy2;
996 for (
int y = 0;
y < ih; ++
y) {
1012 deviceRect = clippedDeviceRgn.boundingRect();
1038 bool bilinear =
q->state()->flags.bilinear;
1041 spanData->setupMatrix(
b.transform() *
m, bilinear);
1053 spanData->dx = -
m.dx();
1054 spanData->dy = -
m.dy();
1055 spanData->txop =
m.type();
1056 spanData->bilinear = bilinear;
1057 spanData->fast_matrix =
qAbs(
m.dx()) < 1e4 &&
qAbs(
m.dy()) < 1e4;
1058 spanData->adjustSpanMethods();
1060 spanData->setupMatrix(
m, bilinear);
1067#ifdef QT_CLIPPING_RATIOS
1074 if (
d->clip()->hasRectClip)
1076 if (
d->clip()->hasRegionClip)
1080 if ((totalClips % 5000) == 0) {
1081 printf(
"Clipping ratio: rectangular=%f%%, region=%f%%, complex=%f%%\n",
1082 rectClips * 100.0 / (
qreal) totalClips,
1083 regionClips * 100.0 / (
qreal) totalClips,
1084 (totalClips - rectClips - regionClips) * 100.0 / (
qreal) totalClips);
1095 if (
s->flags.has_clip_ownership)
1098 s->flags.has_clip_ownership =
false;
1107 d->solid_color_filler.clip =
d->clip();
1108 d->solid_color_filler.adjustSpanMethods();
1111 dumpClip(
d->rasterBuffer->width(),
d->rasterBuffer->height(), &*
d->clip());
1123 qDebug() <<
"QRasterPaintEngine::clip(): " <<
path << op;
1125 if (
path.elements()) {
1126 for (
int i=0;
i<
path.elementCount(); ++
i) {
1128 <<
'(' <<
path.points()[
i*2] <<
", " <<
path.points()[
i*2+1] <<
')';
1131 for (
int i=0;
i<
path.elementCount(); ++
i) {
1133 <<
'(' <<
path.points()[
i*2] <<
", " <<
path.points()[
i*2+1] <<
')';
1146 qDebug(
" --- optimizing vector clip to rect clip...");
1169 if (
base ==
nullptr)
1175 ensureOutlineMapper();
1180 if (
s->flags.has_clip_ownership)
1184 s->flags.has_clip_ownership =
true;
1197 qDebug() <<
"QRasterPaintEngine::clip(): " <<
rect << op;
1219 QRect clipRect =
r &
d->deviceRect;
1230 clip->setClipRect(clipRect);
1232 clip->setClipRegion(clipRegion & clipRect);
1234 if (
s->flags.has_clip_ownership)
1238 s->clip->enabled =
true;
1239 s->flags.has_clip_ownership =
true;
1245 if (
base->hasRectClip ||
base->hasRegionClip) {
1246 if (!
s->flags.has_clip_ownership) {
1247 s->clip =
new QClipData(
d->rasterBuffer->height());
1248 s->flags.has_clip_ownership =
true;
1250 if (
base->hasRectClip)
1251 s->clip->setClipRect(
base->clipRect & clipRect);
1253 s->clip->setClipRegion(
base->clipRegion & clipRect);
1254 s->clip->enabled =
true;
1273 qDebug() <<
"QRasterPaintEngine::clip(): " << region << op;
1285 const QClipData *baseClip =
d->baseClip.data();
1302 if (
s->flags.has_clip_ownership) {
1306 newClip =
new QClipData(
d->rasterBuffer->height());
1308 s->flags.has_clip_ownership =
true;
1312 if (curClip->hasRectClip)
1314 else if (curClip->hasRegionClip)
1334 qDebug() <<
" --- fillPath, bounds=" <<
path.boundingRect();
1337 if (!fillData->blend)
1342 const QRectF controlPointRect =
path.controlPointRect();
1352 if (!
s->flags.antialiased && !do_clip) {
1353 d->initializeRasterizer(fillData);
1354 d->rasterizer->rasterize(
path *
s->matrix,
path.fillRule());
1358 ensureOutlineMapper();
1359 d->rasterize(
d->outlineMapper->convertPath(
path), blend, fillData,
d->rasterBuffer.data());
1367 bool rectClipped =
true;
1374 rectClipped =
data->clip->hasRectClip;
1377 x1 =
qMax(
r.x(), pe->deviceRect.x());
1378 x2 =
qMin(
r.x() +
r.width(), pe->deviceRect.x() + pe->deviceRect.width());
1379 y1 =
qMax(
r.y(), pe->deviceRect.y());
1380 y2 =
qMin(
r.y() +
r.height(), pe->deviceRect.y() + pe->deviceRect.height());
1383 x2 =
qMin(
r.x() +
r.width(),
data->rasterBuffer->width());
1385 y2 =
qMin(
r.y() +
r.height(),
data->rasterBuffer->height());
1394 bool isUnclipped = rectClipped
1397 if (pe && isUnclipped) {
1403 data->solidColor.alphaF() >= 1.0f))))
1412 const int nspans = 512;
1428 blend(
n, spans,
data);
1439 qDebug(
" - QRasterPaintEngine::drawRect(), rectCount=%d", rectCount);
1442 ensureRasterState();
1447 if (
s->brushData.blend) {
1450 const QRect *lastRect = rects + rectCount;
1452 int offset_x = int(
s->matrix.dx());
1453 int offset_y = int(
s->matrix.dy());
1454 while (
r < lastRect) {
1462 for (
int i=0;
i<rectCount; ++
i) {
1470 if (
s->penData.blend) {
1472 if (
s->flags.fast_pen) {
1474 for (
int i = 0;
i < rectCount; ++
i) {
1479 for (
int i = 0;
i < rectCount; ++
i) {
1493 qDebug(
" - QRasterPaintEngine::drawRect(QRectF*), rectCount=%d", rectCount);
1497 ensureRasterState();
1501 if (
s->flags.tx_noshear) {
1503 if (
s->brushData.blend) {
1504 d->initializeRasterizer(&
s->brushData);
1505 for (
int i = 0;
i < rectCount; ++
i) {
1511 d->rasterizer->rasterizeLine(
a,
b,
rect.height() /
rect.width());
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) {
1548 if (!
s->penData.blend)
1551 if (
s->flags.fast_pen) {
1559 qreal dashOffset =
s->lastPen.dashOffset();
1561 qreal patternLength = 0;
1562 const QList<qreal>
pattern =
s->lastPen.dashPattern();
1566 if (patternLength > 0) {
1567 dashOffset = std::fmod(dashOffset, patternLength);
1569 dashOffset += patternLength;
1570 while (dashOffset >=
pattern.at(dashIndex)) {
1571 dashOffset -=
pattern.at(dashIndex);
1572 if (++dashIndex >=
pattern.size())
1579 d->initializeRasterizer(&
s->penData);
1580 int lineCount =
path.elementCount() / 2;
1583 for (
int i = 0;
i < lineCount; ++
i) {
1590 d->rasterizer->rasterizeLine(mappedline.p1(), mappedline.p2(),
1591 width / mappedline.length());
1597 d->rasterizer->rasterizeLine(
line.p1(),
line.p2(),
1602 int dIndex = dashIndex;
1603 qreal dOffset = dashOffset;
1605 d->rasterizeLine_dashed(
line,
width, &dIndex, &dOffset, &inD);
1637 qDebug() <<
"QRasterPaintEngine::fill(): "
1638 <<
"size=" <<
path.elementCount()
1647 if (!
s->brushData.blend)
1658 ensureRasterState();
1659 if (
s->flags.tx_noshear) {
1660 d->initializeRasterizer(&
s->brushData);
1665 const QPointF a =
s->matrix.map((
r.topLeft() +
r.bottomLeft()) * 0.5f);
1666 const QPointF b =
s->matrix.map((
r.topRight() +
r.bottomRight()) * 0.5f);
1667 d->rasterizer->rasterizeLine(
a,
b,
r.height() /
r.width());
1675 const QRectF pathDeviceRect =
s->matrix.mapRect(cpRect);
1677 if (!pathDeviceRect.intersects(
QRectF(
d->deviceRect)) || !pathDeviceRect.isValid())
1680 ProcessSpans blend =
d->getBrushFunc(pathDeviceRect, &
s->brushData);
1695 ensureOutlineMapper();
1696 d->rasterize(
d->outlineMapper->convertPath(
path), blend, &
s->brushData,
d->rasterBuffer.data());
1704 if (!
s->flags.antialiased) {
1705 uint txop =
s->matrix.type();
1710 const QRect rr = toNormalizedFillRect(
r.translated(
s->matrix.dx(),
s->matrix.dy()));
1714 const QRect rr = toNormalizedFillRect(
s->matrix.mapRect(
r));
1719 ensureRasterState();
1720 if (
s->flags.tx_noshear) {
1721 d->initializeRasterizer(
data);
1723 if (!nr.isEmpty()) {
1724 const QPointF a =
s->matrix.map((nr.topLeft() + nr.bottomLeft()) * 0.5f);
1725 const QPointF b =
s->matrix.map((nr.topRight() + nr.bottomRight()) * 0.5f);
1726 d->rasterizer->rasterizeLine(
a,
b, nr.height() / nr.width());
1733 ensureOutlineMapper();
1743 qDebug() <<
"QRasterPaintEngine::fillRecct(): " <<
r <<
brush;
1748 if (!
s->brushData.blend)
1760 c.getRgbF(&
r, &
g, &
b, &
a);
1761 a =
a *
alpha * (1.f / 256.f);
1773 qDebug() <<
"QRasterPaintEngine::fillRect(): " <<
r <<
color;
1780 if (
d->solid_color_filler.solidColor.alphaF() <= 0.0f
1784 d->solid_color_filler.clip =
d->clip();
1785 d->solid_color_filler.adjustSpanMethods();
1791 return a->y() <
b->y();
1801 QList<const QPointF *> sorted;
1802 sorted.reserve(pointCount);
1804 upper->reserve(pointCount * 3 / 4);
1805 lower->reserve(pointCount * 3 / 4);
1807 for (
int i = 0;
i < pointCount; ++
i)
1810 std::sort(sorted.begin(), sorted.end(),
isAbove);
1812 qreal splitY = sorted.at(sorted.size() / 2)->y();
1817 QList<QPointF> *bin[2] = { upper, lower };
1820 int side =
p->y() < splitY;
1821 int lastSide = last->
y() < splitY;
1823 if (side != lastSide) {
1825 bin[!side]->append(*
p);
1827 bin[side]->append(*last);
1830 QPointF intersection(
p->x() + delta.
x() * (splitY -
p->y()) / delta.
y(), splitY);
1832 bin[0]->append(intersection);
1833 bin[1]->append(intersection);
1837 bin[side]->append(*
p);
1843 return upper->size() < pointCount && lower->size() < pointCount;
1854 const int maxPoints = 0xffff;
1857 if (pointCount > maxPoints) {
1858 QList<QPointF> upper, lower;
1864 qWarning(
"Polygon too complex for filling.");
1871 ensureOutlineMapper();
1875 ProcessSpans brushBlend =
d->getBrushFunc(
d->outlineMapper->controlPointRect,
1877 d->rasterize(outline, brushBlend, &
s->brushData,
d->rasterBuffer.data());
1889 qDebug(
" - QRasterPaintEngine::drawPolygon(F), pointCount=%d", pointCount);
1890 for (
int i=0;
i<pointCount; ++
i)
1905 if (
s->brushData.blend)
1910 if (
s->penData.blend) {
1912 if (
s->flags.fast_pen) {
1930 qDebug(
" - QRasterPaintEngine::drawPolygon(I), pointCount=%d", pointCount);
1931 for (
int i=0;
i<pointCount; ++
i)
1949 if (
s->brushData.blend) {
1951 ensureOutlineMapper();
1953 d->outlineMapper->moveTo(*
points);
1957 d->outlineMapper->lineTo(*(++
p));
1959 d->outlineMapper->endOutline();
1962 ProcessSpans brushBlend =
d->getBrushFunc(
d->outlineMapper->controlPointRect,
1964 d->rasterize(
d->outlineMapper->outline(), brushBlend, &
s->brushData,
d->rasterBuffer.data());
1969 if (
s->penData.blend) {
1970 int count = pointCount * 2;
1971 QVarLengthArray<qreal> fpoints(
count);
1973 fpoints[
i] = ((
const int *)
points)[
i];
1976 if (
s->flags.fast_pen) {
1991 qDebug() <<
" - QRasterPaintEngine::drawPixmap(), pos=" <<
pos <<
" pixmap=" <<
pixmap.size() <<
"depth=" <<
pixmap.depth();
1997 if (
image.depth() == 1) {
2011 if (
pixmap.depth() == 1) {
2032 qDebug() <<
" - QRasterPaintEngine::drawPixmap(), r=" <<
r <<
" sr=" << sr <<
" pixmap=" <<
pixmap.size() <<
"depth=" <<
pixmap.depth();
2038 if (
image.depth() == 1) {
2042 &&
r.size() == sr.size()
2043 &&
r.size() ==
pixmap.size()) {
2045 drawBitmap(
r.topLeft() +
QPointF(
s->matrix.dx(),
s->matrix.dy()),
image, &
s->penData);
2057 if (
image.depth() == 1) {
2061 &&
r.size() == sr.size()
2062 &&
r.size() ==
pixmap.size()) {
2064 drawBitmap(
r.topLeft() +
QPointF(
s->matrix.dx(),
s->matrix.dy()),
image, &
s->penData);
2067 drawImage(
r,
d->rasterBuffer->colorizeBitmap(
image,
s->pen.color()), translatedSource);
2077 const int iv = int(
v);
2086 const int xmin = int(
rect.x());
2088 const int ymin = int(
rect.y());
2090 return QRect(xmin, ymin, xmax - xmin, ymax - ymin);
2099 qDebug() <<
" - QRasterPaintEngine::drawImage(), p=" <<
p <<
" image=" <<
img.size() <<
"depth=" <<
img.depth();
2113 QPointF pt(
p.x() +
s->matrix.dx(),
p.y() +
s->matrix.dy());
2115 if (
d->canUseImageBlitting(
d->rasterBuffer->compositionMode,
img, pt,
img.rect())) {
2117 d->blitImage(pt,
img,
d->deviceRect);
2119 }
else if (
clip->hasRectClip) {
2120 d->blitImage(pt,
img,
clip->clipRect);
2123 }
else if (
d->canUseFastImageBlending(
d->rasterBuffer->compositionMode,
img)) {
2127 d->drawImage(pt,
img,
func,
d->deviceRect,
s->intOpacity);
2129 }
else if (
clip->hasRectClip) {
2138 d->image_filler.clip =
clip;
2140 if (!
d->image_filler.blend)
2142 d->image_filler.dx = -pt.
x();
2143 d->image_filler.dy = -pt.
y();
2153 return QRectF(
r.topLeft() *
t,
r.bottomRight() *
t);
2186 inline bool isPixelAligned(
const QPointF &pt)
2190 inline bool isPixelAligned(
const QRectF &
rect)
2200 Qt::ImageConversionFlags)
2203 qDebug() <<
" - QRasterPaintEngine::drawImage(), r=" <<
r <<
" sr=" << sr <<
" image=" <<
img.size() <<
"depth=" <<
img.depth();
2212 int sr_l =
qFloor(sr.left());
2213 int sr_r =
qCeil(sr.right()) - 1;
2214 int sr_t =
qFloor(sr.top());
2215 int sr_b =
qCeil(sr.bottom()) - 1;
2217 if (
s->matrix.type() <=
QTransform::TxScale && !
s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) {
2224 switch (
img.format()) {
2244 d->solid_color_filler.clip =
d->clip();
2245 d->solid_color_filler.adjustSpanMethods();
2252 bool stretch_sr =
r.width() != sr.width() ||
r.height() != sr.height();
2259 &&
s->intOpacity == 256
2263 RotationType rotationType = qRotationType(
s->matrix);
2267 if (rotationType != NoRotation &&
qMemRotateFunctions[plBpp][rotationType] &&
img.rect().contains(sr.toAlignedRect())) {
2268 QRectF transformedTargetRect =
s->matrix.mapRect(
r);
2270 if (
d->canUseImageBlitting(
d->rasterBuffer->compositionMode,
img, transformedTargetRect.topRight(), sr)) {
2272 if (clippedTransformedTargetRect.isNull())
2275 QRectF clippedTargetRect =
s->matrix.inverted().mapRect(
QRectF(clippedTransformedTargetRect));
2277 QRect clippedSourceRect
2278 =
QRectF(sr.x() + clippedTargetRect.x() -
r.x(), sr.y() + clippedTargetRect.y() -
r.y(),
2279 clippedTargetRect.width(), clippedTargetRect.height()).
toRect();
2281 clippedSourceRect = clippedSourceRect.intersected(
img.rect());
2283 const qsizetype dbpl =
d->rasterBuffer->bytesPerLine();
2289 const uchar *srcBase =
img.bits() + clippedSourceRect.y() * sbpl + clippedSourceRect.x() * bpp;
2290 uchar *dstBase =
dst + clippedTransformedTargetRect.y() * dbpl + clippedTransformedTargetRect.x() * bpp;
2292 uint cw = clippedSourceRect.width();
2293 uint ch = clippedSourceRect.height();
2304 QRectF targetBounds =
s->matrix.mapRect(
r);
2305 bool exceedsPrecision =
r.
width() > 0x7fff
2306 ||
r.height() > 0x7fff
2307 || targetBounds.left() < -0x7fff
2308 || targetBounds.top() < -0x7fff
2309 || targetBounds.right() > 0x7fff
2310 || targetBounds.bottom() > 0x7fff
2311 || targetBounds.width() > 0x7fff
2312 || targetBounds.height() > 0x7fff
2313 ||
s->matrix.m11() >= 512
2314 ||
s->matrix.m22() >= 512;
2315 if (!exceedsPrecision &&
d->canUseFastImageBlending(
d->rasterBuffer->compositionMode,
img)) {
2320 if (
func && (!
clip ||
clip->hasRectClip) && !
s->flags.antialiased && targetBounds.width() >= 16 && targetBounds.height() >= 16) {
2321 func(
d->rasterBuffer->buffer(),
d->rasterBuffer->bytesPerLine(),
img.bits(),
2322 img.bytesPerLine(),
r, sr, !
clip ?
d->deviceRect :
clip->clipRect,
2323 s->matrix,
s->intOpacity);
2328 bool sourceRect2x =
r.width() * 2 == sr.width() &&
r.height() * 2 == sr.height();
2329 bool scale2x = (
s->matrix.m11() ==
qreal(2)) && (
s->matrix.m22() ==
qreal(2));
2333 QPointF pt(
r.x() * 2 +
s->matrix.dx(),
r.y() * 2 +
s->matrix.dy());
2335 d->drawImage(pt,
img,
func,
d->deviceRect,
s->intOpacity, sr.toRect());
2337 }
else if (
clip->hasRectClip) {
2338 d->drawImage(pt,
img,
func,
clip->clipRect,
s->intOpacity, sr.toRect());
2346 if (!
s->flags.antialiased) {
2352 func(
d->rasterBuffer->buffer(),
d->rasterBuffer->bytesPerLine(),
2353 img.bits(),
img.bytesPerLine(),
img.height(),
2363 copy.translate(
r.x(),
r.y());
2365 copy.scale(
r.width() / sr.width(),
r.height() / sr.height());
2366 copy.translate(-sr.x(), -sr.y());
2368 d->image_filler_xform.clip =
clip;
2370 if (!
d->image_filler_xform.blend)
2372 d->image_filler_xform.setupMatrix(
copy,
s->flags.bilinear);
2387 ensureRasterState();
2389 d->initializeRasterizer(&
d->image_filler_xform);
2390 d->rasterizer->setAntialiased(
s->flags.antialiased);
2396 if (
s->flags.tx_noshear)
2397 d->rasterizer->rasterizeLine(
a,
b,
rect.height() /
rect.width());
2399 d->rasterizer->rasterizeLine(
a,
b,
qAbs((
s->matrix.m22() *
rect.height()) / (
s->matrix.m11() *
rect.width())));
2407 m.m21(),
m.m22(),
m.m23(),
2408 m.m31(),
m.m32(),
m.m33());
2412 QPointF pt(
r.x() +
s->matrix.dx(),
r.y() +
s->matrix.dy());
2413 if (
d->canUseImageBlitting(
d->rasterBuffer->compositionMode,
img, pt, sr)) {
2415 d->blitImage(pt,
img,
d->deviceRect, sr.toRect());
2417 }
else if (
clip->hasRectClip) {
2418 d->blitImage(pt,
img,
clip->clipRect, sr.toRect());
2421 }
else if (
d->canUseFastImageBlending(
d->rasterBuffer->compositionMode,
img)) {
2425 d->drawImage(pt,
img,
func,
d->deviceRect,
s->intOpacity, sr.toRect());
2427 }
else if (
clip->hasRectClip) {
2428 d->drawImage(pt,
img,
func,
clip->clipRect,
s->intOpacity, sr.toRect());
2434 d->image_filler.clip =
clip;
2436 if (!
d->image_filler.blend)
2438 d->image_filler.dx = -(
r.x() +
s->matrix.dx()) + sr.x();
2439 d->image_filler.dy = -(
r.y() +
s->matrix.dy()) + sr.y();
2459 qDebug() <<
" - QRasterPaintEngine::drawTiledPixmap(), r=" <<
r <<
"pixmap=" <<
pixmap.size();
2474 if (
image.depth() == 1)
2475 image =
d->rasterBuffer->colorizeBitmap(
image,
s->pen.color());
2477 const qreal pixmapDevicePixelRatio =
pixmap.devicePixelRatio();
2480 copy.translate(
r.x(),
r.y());
2481 copy.translate(-sr.x(), -sr.y());
2482 const qreal inverseDpr =
qreal(1.0) / pixmapDevicePixelRatio;
2483 copy.scale(inverseDpr, inverseDpr);
2484 d->image_filler_xform.clip =
d->clip();
2486 if (!
d->image_filler_xform.blend)
2488 d->image_filler_xform.setupMatrix(
copy,
s->flags.bilinear);
2491 ensureRasterState();
2493 d->initializeRasterizer(&
d->image_filler_xform);
2494 d->rasterizer->setAntialiased(
s->flags.antialiased);
2499 if (
s->flags.tx_noshear)
2500 d->rasterizer->rasterizeLine(
a,
b,
rect.height() /
rect.width());
2502 d->rasterizer->rasterizeLine(
a,
b,
qAbs((
s->matrix.m22() *
rect.height()) / (
s->matrix.m11() *
rect.width())));
2510 d->image_filler.clip =
d->clip();
2513 if (!
d->image_filler.blend)
2515 d->image_filler.dx = -(
r.x() +
s->matrix.dx()) + sr.x();
2516 d->image_filler.dy = -(
r.y() +
s->matrix.dy()) + sr.y();
2528 return (
s[
x>>3] << (
x&7)) & 0x80;
2537 return d->rasterBuffer.data();
2548 if (!
s->penData.blend)
2553 useGammaCorrection =
false;
2557 bool unclipped =
false;
2563 if (
clip->hasRectClip) {
2564 unclipped =
rx >
clip->xmin
2586 ProcessSpans blend = unclipped ?
s->penData.unclipped_blend :
s->penData.blend;
2589 if (
s->flags.fast_text) {
2592 if (
s->penData.bitmapBlit) {
2593 s->penData.bitmapBlit(rb,
rx,
ry,
s->penData.solidColor.rgba64(),
2594 scanline,
w,
h, bpl);
2597 }
else if (
depth == 8) {
2598 if (
s->penData.alphamapBlit) {
2599 s->penData.alphamapBlit(rb,
rx,
ry,
s->penData.solidColor.rgba64(),
2600 scanline,
w,
h, bpl,
nullptr, useGammaCorrection);
2603 }
else if (
depth == 32) {
2605 if (
s->penData.alphaRGBBlit) {
2606 s->penData.alphaRGBBlit(rb,
rx,
ry,
s->penData.solidColor.rgba64(),
2607 (
const uint *) scanline,
w,
h, bpl / 4,
nullptr, useGammaCorrection);
2611 }
else if ((
depth == 8 &&
s->penData.alphamapBlit) || (
depth == 32 &&
s->penData.alphaRGBBlit)) {
2618 int xdiff =
nx -
rx;
2619 int ydiff =
ny -
ry;
2620 scanline += ydiff * bpl;
2621 scanline += xdiff * (
depth == 32 ? 4 : 1);
2626 if (
nx +
w >
d->rasterBuffer->width())
2627 w =
d->rasterBuffer->width() -
nx;
2628 if (
ny +
h >
d->rasterBuffer->height())
2629 h =
d->rasterBuffer->height() -
ny;
2635 s->penData.alphamapBlit(rb,
rx,
ry,
s->penData.solidColor.rgba64(),
2636 scanline,
w,
h, bpl,
clip, useGammaCorrection);
2637 else if (
depth == 32)
2638 s->penData.alphaRGBBlit(rb,
rx,
ry,
s->penData.solidColor.rgba64(),
2639 (
const uint *) scanline,
w,
h, bpl / 4,
clip, useGammaCorrection);
2653 scanline += bpl *
y0;
2660 if (
w <= 0 ||
h <= 0)
2663 const int NSPANS = 512;
2667 const int x1 =
x0 +
w;
2668 const int y1 =
y0 +
h;
2671 for (
int y =
y0;
y <
y1; ++
y) {
2672 for (
int x =
x0;
x <
x1; ) {
2678 if (current == NSPANS) {
2679 blend(current, spans, &
s->penData);
2682 spans[current].
x =
x +
rx;
2683 spans[current].
y =
y +
ry;
2692 spans[current].
len =
len;
2697 }
else if (
depth == 8) {
2698 for (
int y =
y0;
y <
y1; ++
y) {
2699 for (
int x =
x0;
x <
x1; ) {
2701 if (scanline[
x] == 0) {
2706 if (current == NSPANS) {
2707 blend(current, spans, &
s->penData);
2710 int coverage = scanline[
x];
2711 spans[current].
x =
x +
rx;
2712 spans[current].
y =
y +
ry;
2713 spans[current].
coverage = coverage;
2718 while (
x <
x1 && scanline[
x] == coverage) {
2722 spans[current].
len =
len;
2728 const uint *sl = (
const uint *) scanline;
2729 for (
int y =
y0;
y <
y1; ++
y) {
2730 for (
int x =
x0;
x <
x1; ) {
2732 if ((sl[
x] & 0x00ffffff) == 0) {
2737 if (current == NSPANS) {
2738 blend(current, spans, &
s->penData);
2741 uint rgbCoverage = sl[
x];
2742 int coverage =
qGreen(rgbCoverage);
2743 spans[current].
x =
x +
rx;
2744 spans[current].
y =
y +
ry;
2745 spans[current].
coverage = coverage;
2750 while (
x <
x1 && sl[
x] == rgbCoverage) {
2754 spans[current].
len =
len;
2757 sl += bpl /
sizeof(
uint);
2764 blend(current, spans, &
s->penData);
2785 if (d_func()->mono_surface)
2790 if (!verticalSubPixelPositions)
2799 switch (alphaMap->format) {
2802 bytesPerLine = ((alphaMap->width + 31) & ~31) >> 3;
2806 bytesPerLine = (alphaMap->width + 3) & ~3;
2810 bytesPerLine = alphaMap->width * 4;
2816 QFixed y = verticalSubPixelPositions
2823 alphaMap->width, alphaMap->height,
2838 cache->fillInPendingGlyphs();
2848 else if (
depth == 1)
2851 int margin = fontEngine->
glyphMargin(glyphFormat);
2855 if (!verticalSubPixelPositions)
2856 subPixelPosition.
y = 0;
2864 int y = (verticalSubPixelPositions
2867 y -=
c.baseLineY + margin;
2877 const uchar *glyphBits =
bits + ((
c.x << leftShift) >> rightShift) +
c.y * bpl;
2886 s->matrix = originalTransform;
2911 if (cl->hasRectClip) {
2917 const QRect &
r1 = cl->clipRect;
2921 return qt_region_strictContains(cl->clipRegion,
r);
2941 if (cl->hasRectClip && cl->clipRect ==
deviceRect)
2944 if (
s->flags.antialiased)
2948 r.
setX(
r.x() - penWidth);
2949 r.setY(
r.y() - penWidth);
2950 r.setWidth(
r.width() + 2 * penWidth);
2951 r.setHeight(
r.height() + 2 * penWidth);
2954 if (cl->hasRectClip) {
2956 const QRect &
r1 = cl->clipRect;
2960 return qt_region_strictContains(cl->clipRegion,
r);
2968 if (norm.left() <= INT_MIN || norm.top() <= INT_MIN
2969 || norm.right() > INT_MAX || norm.bottom() > INT_MAX
2970 || norm.width() > INT_MAX || norm.height() > INT_MAX)
2972 return isUnclipped(norm.toAlignedRect(), penWidth);
2998 const int penWidth =
s->flags.fast_pen ? 1 :
qCeil(
s->lastPen.widthF());
3023 if (left < clipRight && right > clipLeft && top < clipBottom && bottom > clipTop)
3028 while (last >
first) {
3034 if (left < clipRight && right > clipLeft && top < clipBottom && bottom > clipTop)
3038 return {
first, last + 1};
3046 if (textItem->numGlyphs == 0)
3050 ensureRasterState();
3056 drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
3065 textItem->fontEngine(), textItem->glyphs,
3066 textItem->glyphPositions, textItem->numGlyphs);
3086 fprintf(stderr,
" - QRasterPaintEngine::drawTextItem(), (%.2f,%.2f), string=%s ct=%d\n",
3088 d->glyphCacheFormat);
3091 if (ti.glyphs.numGlyphs == 0)
3094 ensureRasterState();
3101 QVarLengthArray<glyph_t> glyphs;
3104 ti.fontEngine->getGlyphPositions(ti.glyphs,
matrix, ti.flags, glyphs,
positions);
3108 && ti.fontEngine->supportsTransformation(
matrix)) {
3115 QVarLengthArray<glyph_t> glyphs;
3120 ti.fontEngine, glyphs.data(),
positions.data(),
3127 staticTextItem.
color =
s->pen.color();
3128 staticTextItem.font =
s->font;
3129 staticTextItem.setFontEngine(ti.fontEngine);
3130 staticTextItem.numGlyphs =
range.end -
range.begin;
3131 staticTextItem.glyphs = glyphs.data() +
range.begin;
3148 if (!
s->penData.blend)
3151 if (!
s->flags.fast_pen) {
3167 if (!
s->penData.blend)
3170 if (!
s->flags.fast_pen) {
3185 qDebug() <<
" - QRasterPaintEngine::drawLines(QLine*)" << lineCount;
3191 if (!
s->penData.blend)
3194 if (
s->flags.fast_pen) {
3196 for (
int i=0;
i<lineCount; ++
i) {
3197 const QLine &l = lines[
i];
3214 const QPen &pen =
s->lastPen;
3218 qreal patternLength = 0;
3222 if (patternLength <= 0)
3239 *dashOffset += dash /
width;
3243 *inDash = !(*inDash);
3244 if (++*dashIndex >=
pattern.size())
3262 qDebug() <<
" - QRasterPaintEngine::drawLines(QLineF *)" << lineCount;
3268 if (!
s->penData.blend)
3270 if (
s->flags.fast_pen) {
3272 for (
int i=0;
i<lineCount; ++
i) {
3293 && !
s->flags.antialiased
3307 &
s->penData, &
s->brushData);
3319void QRasterPaintEngine::setDC(HDC hdc) {
3327HDC QRasterPaintEngine::getDC()
const
3336void QRasterPaintEngine::releaseDC(HDC)
const
3393 const int spanCount = 512;
3402 int ymax =
qMin(py +
h,
d->rasterBuffer->height());
3403 int ymin =
qMax(py, 0);
3404 int xmax =
qMin(px +
w,
d->rasterBuffer->width());
3405 int xmin =
qMax(px, 0);
3407 int x_offset = xmin - px;
3410 for (
int y = ymin;
y < ymax; ++
y) {
3413 for (
int x = 0;
x < xmax - xmin; ++
x) {
3414 int src_x =
x + x_offset;
3420 if (pixel & (0x1 << (src_x & 7))) {
3421 spans[
n].
x = xmin +
x;
3425 while (src_x+1 <
w &&
src[(src_x+1) >> 3] & (0x1 << ((src_x+1) & 7))) {
3429 spans[
n].
len = ((
len + spans[
n].
x) > xmax) ? (xmax - spans[
n].
x) :
len;
3432 if (
n == spanCount) {
3439 for (
int x = 0;
x < xmax - xmin; ++
x) {
3440 int src_x =
x + x_offset;
3446 if (pixel & (0x80 >> (
x & 7))) {
3447 spans[
n].
x = xmin +
x;
3451 while (src_x+1 <
w &&
src[(src_x+1) >> 3] & (0x80 >> ((src_x+1) & 7))) {
3455 spans[
n].
len = ((
len + spans[
n].
x) > xmax) ? (xmax - spans[
n].
x) :
len;
3458 if (
n == spanCount) {
3506 return d->deviceRect;
3508 if (
clip->hasRectClip)
3528 QSize(
c->xmax -
c->xmin,
c->ymax -
c->ymin));
3530 blend =
data->blend;
3532 blend =
data->unclipped_blend;
3543 if (!callback || !outline)
3549 if (!
s->flags.antialiased) {
3576 if (!callback || !outline)
3582 if (!
s->flags.antialiased) {
3602 uchar *rasterPoolOnHeap =
nullptr;
3606 void *
data = userData;
3614 rasterParams.
target =
nullptr;
3615 rasterParams.source = outline;
3617 rasterParams.gray_spans =
nullptr;
3618 rasterParams.black_spans =
nullptr;
3619 rasterParams.bit_test =
nullptr;
3620 rasterParams.bit_set =
nullptr;
3621 rasterParams.user =
data;
3622 rasterParams.clip_box = clip_box;
3627 int rendered_spans = 0;
3632 rasterParams.gray_spans = callback;
3633 rasterParams.skip_spans = rendered_spans;
3638 rasterPoolSize *= 2;
3639 if (rasterPoolSize > 1024 * 1024) {
3640 qWarning(
"QPainter: Rasterization of primitive failed");
3646 free(rasterPoolOnHeap);
3647 rasterPoolOnHeap = (
uchar *)malloc(rasterPoolSize + 0xf);
3661 free(rasterPoolOnHeap);
3669 if (!
s->clipEnabled)
3690 return s->flags.fast_images
3693 && !
image.hasAlphaChannel()));
3702 && !
image.hasAlphaChannel())))
3708 if (
s->intOpacity != 256
3709 ||
image.depth() < 8
3711 && (!isPixelAligned(pt) || !isPixelAligned(sr))))
3719 return (dFormat == sFormat);
3728 if (sourceImage.isNull() || dest.
isNull())
3734 int height = sourceImage.height();
3735 int width = sourceImage.width();
3762 bytes_per_pixel =
image->depth()/8;
3763 bytes_per_line =
image->bytesPerLine();
3767 if (
image->depth() == 1 &&
image->colorTable().size() == 2) {
3769 const QList<QRgb> colorTable =
image->colorTable();
3815 const int maxSpans = (
ymax -
ymin) * numRects;
3821 int firstInBand = 0;
3822 while (firstInBand < numRects) {
3823 const int currMinY = rects[firstInBand].y();
3824 const int currMaxY = currMinY + rects[firstInBand].height();
3826 while (
y < currMinY) {
3832 int lastInBand = firstInBand;
3833 while (lastInBand + 1 < numRects && rects[lastInBand+1].
top() ==
y)
3836 while (
y < currMaxY) {
3841 for (
int r = firstInBand;
r <= lastInBand; ++
r) {
3842 const QRect &currRect = rects[
r];
3844 span->
x = currRect.x();
3845 span->len = currRect.width();
3847 span->coverage = 255;
3853 firstInBand = lastInBand + 1;
3884 span->coverage = 255;
3925 const int firstLeft =
m_spans[0].
x;
3933 if (
span.y !=
y + 1 &&
y != -1)
3941 const int spanLeft =
span.x;
3942 const int spanRight = spanLeft +
span.len;
3944 if (spanLeft <
xmin)
3947 if (spanRight >
xmax)
3950 if (spanLeft != firstLeft || spanRight != firstRight)
4030 while (available && spans <
end ) {
4031 if (clipSpans >= clipEnd) {
4035 if (clipSpans->y > spans->
y) {
4039 if (spans->
y != clipSpans->y) {
4049 int sx2 = sx1 + spans->
len;
4050 int cx1 = clipSpans->x;
4051 int cx2 = cx1 + clipSpans->len;
4053 if (cx1 < sx1 && cx2 < sx1) {
4056 }
else if (sx1 < cx1 && sx2 < cx1) {
4060 int x =
qMax(sx1, cx1);
4078 *currentClip = clipSpans - clip->
m_spans;
4087 Q_ASSERT(fillData->blend && fillData->unclipped_blend);
4089 const int NSPANS = 512;
4091 int currentClip = 0;
4093 while (spans <
end) {
4099 if (clipped - cspans)
4100 fillData->unclipped_blend(clipped - cspans, cspans, fillData);
4112 const int minx = clip.
left();
4113 const int miny = clip.
top();
4114 const int maxx = clip.
right();
4115 const int maxy = clip.
bottom();
4118 while (spans <
end) {
4119 if (spans->
y >= miny)
4128 if (
s->x > maxx ||
s->x +
s->len <= minx) {
4134 s->len =
qMin(
s->len - (minx -
s->x), maxx - minx + 1);
4137 s->len =
qMin(
s->len, (maxx -
s->x + 1));
4150 Q_ASSERT(fillData->blend && fillData->unclipped_blend);
4153 Q_ASSERT(!fillData->clip->clipRect.isEmpty());
4158 fillData->clip->clipRect);
4160 fillData->unclipped_blend(
count,
s, fillData);
4179 int currentClip = 0;
4181 while (spans <
end) {
4222 for (
int i = 0;
i < stops.
size() &&
i <= 2;
i++)
4223 hash_val += stops[
i].second.rgba64();
4232 const auto &cache_info =
it.value();
4233 if (cache_info->stops == stops && cache_info->opacity == opacity && cache_info->interpolationMode == gradient.
interpolationMode())
4247 int size,
int opacity)
const;
4256 cache_entry->buffer32[
i] = cache_entry->buffer64[
i].toArgb32();
4257 return cache.
insert(hash_val, std::move(cache_entry)).value();
4267 int stopCount = stops.
size();
4272 if (stopCount == 2) {
4279 if (second_stop < first_stop) {
4281 first_color = second_color;
4283 qSwap(first_stop, second_stop);
4286 if (colorInterpolation) {
4294 uint red_first =
uint(first_color.red()) << 16;
4295 uint green_first =
uint(first_color.green()) << 16;
4296 uint blue_first =
uint(first_color.blue()) << 16;
4297 uint alpha_first =
uint(first_color.alpha()) << 16;
4299 uint red_second =
uint(second_color.red()) << 16;
4300 uint green_second =
uint(second_color.green()) << 16;
4301 uint blue_second =
uint(second_color.blue()) << 16;
4302 uint alpha_second =
uint(second_color.alpha()) << 16;
4306 if (colorInterpolation)
4307 colorTable[
i] = first_color;
4312 if (
i < second_index) {
4313 qreal reciprocal =
qreal(1) / (second_index - first_index);
4315 int red_delta =
qRound((
qreal(red_second) - red_first) * reciprocal);
4316 int green_delta =
qRound((
qreal(green_second) - green_first) * reciprocal);
4317 int blue_delta =
qRound((
qreal(blue_second) - blue_first) * reciprocal);
4318 int alpha_delta =
qRound((
qreal(alpha_second) - alpha_first) * reciprocal);
4321 red_first += 1 << 15;
4322 green_first += 1 << 15;
4323 blue_first += 1 << 15;
4324 alpha_first += 1 << 15;
4327 red_first += red_delta;
4328 green_first += green_delta;
4329 blue_first += blue_delta;
4330 alpha_first += alpha_delta;
4332 const QRgba64 color =
qRgba64(red_first >> 16, green_first >> 16, blue_first >> 16, alpha_first >> 16);
4334 if (colorInterpolation)
4342 if (colorInterpolation)
4343 colorTable[
i] = second_color;
4352 if (stopCount == 1) {
4354 for (
int i = 0;
i <
size; ++
i)
4355 colorTable[
i] = current_color;
4367 qreal dpos = 1.5 * incr;
4371 while (dpos <= begin_pos) {
4372 colorTable[
pos] = colorTable[
pos - 1];
4377 int current_stop = 0;
4382 if (dpos < end_pos) {
4384 while (dpos > stops[current_stop+1].
first)
4387 if (current_stop != 0)
4388 current_color =
combineAlpha256(stops[current_stop].second.rgba64(), opacity);
4389 next_color =
combineAlpha256(stops[current_stop+1].second.rgba64(), opacity);
4391 if (colorInterpolation) {
4398 t = (dpos - stops[current_stop].
first) *
c;
4402 Q_ASSERT(current_stop < stopCount);
4405 int idist = 256 -
dist;
4407 if (colorInterpolation)
4415 if (dpos >= end_pos)
4421 while (dpos > stops[current_stop+skip+1].
first)
4425 current_stop += skip;
4427 current_color = next_color;
4429 current_color =
combineAlpha256(stops[current_stop].second.rgba64(), opacity);
4430 next_color =
combineAlpha256(stops[current_stop+1].second.rgba64(), opacity);
4432 if (colorInterpolation) {
4440 t = (dpos - stops[current_stop].
first) *
c;
4449 colorTable[
pos] = current_color;
4454 colorTable[
size - 1] = current_color;
4466 m11 = m22 = m33 = 1.;
4467 m12 = m13 = m21 = m23 = dx = dy = 0.0;
4468 clip = pe ? pe->d_func()->clip() :
nullptr;
4478 switch (brushStyle) {
4494 auto cacheInfo = qt_gradient_cache()->getBuffer(*
g,
alpha);
4496#if QT_CONFIG(raster_64bit) || QT_CONFIG(raster_fp)
4497 gradient.colorTable64 = cacheInfo->buffer64;
4505 linearData.
origin.x =
g->start().x();
4506 linearData.origin.y =
g->start().y();
4507 linearData.end.x =
g->finalStop().x();
4508 linearData.end.y =
g->finalStop().y();
4518 auto cacheInfo = qt_gradient_cache()->getBuffer(*
g,
alpha);
4520#if QT_CONFIG(raster_64bit) || QT_CONFIG(raster_fp)
4521 gradient.colorTable64 = cacheInfo->buffer64;
4530 radialData.center.x = center.x();
4531 radialData.center.y = center.y();
4532 radialData.center.radius =
g->centerRadius();
4534 radialData.focal.
x = focal.
x();
4535 radialData.focal.y = focal.
y();
4536 radialData.focal.radius =
g->focalRadius();
4546 auto cacheInfo = qt_gradient_cache()->getBuffer(*
g,
alpha);
4548#if QT_CONFIG(raster_64bit) || QT_CONFIG(raster_fp)
4549 gradient.colorTable64 = cacheInfo->buffer64;
4558 conicalData.center.x = center.x();
4559 conicalData.center.y = center.y();
4652 delta.
translate(1.0 / 65536, 1.0 / 65536);
4667 const bool affine = inv.isAffine();
4673 && f1 > (1.0 / 65536)
4674 && f2 > (1.0 / 65536)
4684 if (!
d ||
d->height == 0) {
4701 if (sourceRect.
isNull()) {
4713 texture.bytesPerLine =
d->bytes_per_line;
4740 const int midx =
rect.
x() + (
rect.width() + 1) / 2;
4741 const int midy =
rect.y() + (
rect.height() + 1) / 2;
4747 outline[0].
x = midx + (midx -
x) - (
length - 1) - (
rect.width() & 0x1);
4759 outline[2].
x = outline[0].
x;
4760 outline[2].
len = outline[0].
len;
4761 outline[2].
y = midy + (midy -
y) - (
rect.height() & 0x1);
4767 outline[3].
y = outline[2].
y;
4770 if (brush_func && outline[0].
x + outline[0].
len < outline[1].
x) {
4775 fill[0].
x = outline[0].
x + outline[0].
len - 1;
4777 fill[0].y = outline[1].
y;
4778 fill[0].coverage = 255;
4781 fill[1].x = outline[2].
x + outline[2].
len - 1;
4783 fill[1].y = outline[3].
y;
4784 fill[1].coverage = 255;
4786 int n = (
fill[0].y >=
fill[1].y ? 1 : 2);
4789 brush_func(
n,
fill, brush_data);
4792 int n = (outline[1].
y >= outline[2].
y ? 2 : 4);
4795 pen_func(
n, outline, pen_data);
4812 int y = (
rect.height() + 1) / 2;
4816 while (
a*
a*(2*
y - 1) > 2*
b*
b*(
x + 1)) {
4821 d +=
b*
b*(2*
x + 3) +
a*
a*(-2*
y + 2);
4823 pen_func, brush_func, pen_data, brush_data);
4829 pen_func, brush_func, pen_data, brush_data);
4832 d =
b*
b*(
x + 0.5)*(
x + 0.5) +
a*
a*((
y - 1)*(
y - 1) -
b*
b);
4833 const int miny =
rect.height() & 0x1;
4836 d +=
b*
b*(2*
x + 2) +
a*
a*(-2*
y + 3);
4839 d +=
a*
a*(-2*
y + 3);
4843 pen_func, brush_func, pen_data, brush_data);
4858 clipImg.fill(0xffff0000);
4867 for (
int i = 0;
i < clip->
count; ++
i) {
4869 for (
int j = 0;
j <
span->len; ++
j)
4870 clipImg.setPixel(
span->x +
j,
span->y, 0xffffff00);
IOBluetoothDevice * device
QTransform transform() const
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
void appendSpans(const QT_FT_Span *s, int num)
struct QClipData::ClipLine * m_clipLines
void setClipRegion(const QRegion ®ion)
void setClipRect(const QRect &rect)
TransferFunction transferFunction() const noexcept
Returns the predefined transfer function of the color space or TransferFunction::Custom if it doesn't...
The QColor class provides colors based on RGB, HSV or CMYK values.
float alphaF() const noexcept
Returns the alpha color component of this color.
static QColor fromRgbF(float r, float g, float b, float a=1.0)
Static convenience function that returns a QColor constructed from the RGB color values,...
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 * glyphData(glyph_t glyph, const QFixedPoint &subPixelPosition, GlyphFormat neededFormat, const QTransform &t)
virtual int glyphMargin(GlyphFormat format)
virtual bool supportsVerticalSubPixelPositions() const
virtual bool supportsTransformation(const QTransform &transform) const
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
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
void generateGradientColorTable(const QGradient &g, QRgba64 *colorTable, int size, int opacity) const
QGradientColorTableHash cache
std::shared_ptr< const CacheInfo > addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity)
std::shared_ptr< const CacheInfo > getBuffer(const QGradient &gradient, int opacity)
InterpolationMode interpolationMode() const
QGradientStops stops() const
Returns the stop points for this gradient.
static QPixelFormat toPixelFormat(QImage::Format format) noexcept
Converts format into a QPixelFormat.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
int width() const
Returns the width of the image.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
Format
The following image formats are available in Qt.
@ Format_ARGB6666_Premultiplied
@ Format_ARGB8555_Premultiplied
@ Format_RGBA8888_Premultiplied
@ Format_ARGB8565_Premultiplied
@ Format_A2BGR30_Premultiplied
@ Format_ARGB32_Premultiplied
@ Format_A2RGB30_Premultiplied
@ Format_ARGB4444_Premultiplied
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
constexpr QPointF p1() const
Returns the line's start point.
constexpr QPointF p2() const
Returns the line's end point.
void setLength(qreal len)
Sets the length of the line to the given finite length.
\inmodule QtCore\compares equality \compareswith equality QLineF \endcompareswith
constexpr QPoint p1() const
Returns the line's start point.
constexpr QPoint p2() const
Returns the line's end point.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
qsizetype size() const noexcept
friend class const_iterator
iterator erase(const_iterator it)
const_iterator constFind(const Key &key) const noexcept
virtual int devType() const
void replayClipOperations()
virtual void drawRects(const QRect *rects, int rectCount) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void stroke(const QVectorPath &path, const QPen &pen)
virtual void drawEllipse(const QRectF &r) override
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
virtual void drawLines(const QLine *lines, int lineCount) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
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
Draws the first pointCount points in the buffer points.
virtual void drawStaticTextItem(QStaticTextItem *)
QPaintEngine::DirtyFlags state() const
Returns a combination of flags identifying the set of properties that need to be updated when updatin...
void setActive(bool newState)
Sets the active state of the paint engine to state.
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem)
This function draws the text item textItem at position p.
PolygonDrawMode
\value OddEvenMode The polygon should be drawn using OddEven fill rule.
QPainter * painter() const
Returns the paint engine's painter.
void setDirty(DirtyFlags df)
PaintEngineFeatures gccaps
QRegion systemClip() const
QPaintDevice * device() const
Returns the paint device on which this painter is currently painting, or \nullptr if the painter is n...
@ NonCosmeticBrushPatterns
@ VerticalSubpixelPositioning
CompositionMode
Defines the modes supported for digital image compositing.
@ CompositionMode_SourceOver
void setStyle(Qt::PenStyle)
[0]
QList< qreal > dashPattern() const
Returns the dash pattern of this pen.
bool isCosmetic() const
Returns true if the pen is cosmetic; otherwise returns false.
Qt::PenCapStyle capStyle() const
Returns the pen's cap style.
qreal miterLimit() const
Returns the miter limit of the pen.
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
qreal dashOffset() const
Returns the dash offset for the pen.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
\threadsafe
bool monoDestinationWithClut
QImage::Format prepare(QImage *image)
QPainter::CompositionMode compositionMode
qsizetype bytesPerLine() const
QImage colorizeBitmap(const QImage &image, const QColor &color)
int bytesPerPixel() const
bool isUnclipped_normalized(const QRect &rect) const
Returns true if the rectangle is completely within the current clip state of the paint engine.
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()
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
\reimp
void fill(const QVectorPath &path, const QBrush &brush) override
~QRasterPaintEngine()
Destroys this paint engine.
void transformChanged() override
void setState(QPainterState *s) override
void drawEllipse(const QRectF &rect) override
\reimp
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
\reimp
QRasterPaintEngineState * state()
const QClipData * clipData() const
virtual void fillPath(const QPainterPath &path, QSpanData *fillData)
bool end() override
\reimp
void stroke(const QVectorPath &path, const QPen &pen) override
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
\reimp
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
\reimp
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
\reimp
void drawLines(const QLine *line, int lineCount) override
\reimp
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) override
\reimp
bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const override
Returns whether glyph caching is supported by the font engine fontEngine with the given transform m a...
void fillRect(const QRectF &rect, const QBrush &brush) override
\reimp
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
\reimp
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)
\inmodule QtCore\reentrant
constexpr qreal bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
QRectF normalized() const noexcept
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
constexpr void translate(qreal dx, qreal dy) noexcept
Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
void set(const QRectF &r)
QRectVectorPath(const QRect &r)
QRectVectorPath(const QRectF &r)
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
constexpr int height() const noexcept
Returns the height of the rectangle.
QRect normalized() const noexcept
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
QRect intersected(const QRect &other) const noexcept
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setRect(int x, int y, int w, int h) noexcept
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setX(int x) noexcept
Sets the left edge of the rectangle to the given x coordinate.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
Returns the bounding rectangle of this region.
int rectCount() const noexcept
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
const_iterator begin() const noexcept
static constexpr QRgba64 fromArgb32(uint rgb)
QByteArray toLatin1() const
Returns a Latin-1 representation of the string as a QByteArray.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qsizetype length() const noexcept
Returns the number of characters in this string.
static uint polygonFlags(QPaintEngine::PolygonDrawMode mode)
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
static jboolean copy(JNIEnv *, jobject)
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]
Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert)
bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush &brush)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError * error
DrawHelper qDrawHelper[QImage::NImageFormats]
void(* SrcOverBlendFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int w, int h, int const_alpha)
static constexpr int qt_div_255(int x)
QT_FT_SpanFunc ProcessSpans
static QRgba64 interpolate256(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2)
static QRgba64 multiplyAlpha256(QRgba64 rgba64, uint alpha256)
#define GRADIENT_STOPTABLE_SIZE
void qBlendGradient(int count, const QT_FT_Span *spans, void *userData)
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 qBlendTexture(int count, const QT_FT_Span *spans, void *userData)
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)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
int q_gray_rendered_spans(TRaster *raster)
const QT_FT_Raster_Funcs qt_ft_grays_raster
#define MINIMUM_POOL_SIZE
QImage::Format qt_maybeDataCompatibleOpaqueVersion(QImage::Format format)
int qt_depthForFormat(QImage::Format format)
constexpr float qDegreesToRadians(float degrees)
QRect qt_mapFillRect(const QRectF &rect, const QTransform &xf)
MemRotateFunc qMemRotateFunctions[QPixelLayout::BPPCount][3]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
static bool contains(const QJsonArray &haystack, unsigned needle)
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
GLenum GLuint GLenum GLsizei length
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
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 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
GLuint GLuint64EXT address
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
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
static const QRectF boundingRect(const QPointF *points, int pointCount)
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
QT_BEGIN_NAMESPACE constexpr int QT_RASTER_COORD_LIMIT
@ LineDrawIncludeLastPixel
static int fast_ceil_positive(const qreal &v)
static void qt_span_fill_clipRect(int count, const QT_FT_Span *spans, void *userData)
static void qt_ft_outline_line_to(qfixed x, qfixed y, void *data)
Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert)
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
static void qrasterpaintengine_dirty_clip(QRasterPaintEnginePrivate *d, QRasterPaintEngineState *s)
int q_gray_rendered_spans(QT_FT_Raster raster)
static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, ProcessSpans pen_func, ProcessSpans brush_func, QSpanData *pen_data, QSpanData *brush_data)
static void fillRect_normalized(const QRect &r, QSpanData *data, QRasterPaintEnginePrivate *pe)
static void qrasterpaintengine_state_setNoClip(QRasterPaintEngineState *s)
static const QT_FT_Span * qt_intersect_spans(const QClipData *clip, int *currentClip, const QT_FT_Span *spans, const QT_FT_Span *end, QT_FT_Span **outSpans, int available)
QRectF qt_mapRect_non_normalizing(const QRectF &r, const QTransform &t)
static void qt_span_clip(int count, const QT_FT_Span *spans, void *userData)
static void qt_ft_outline_move_to(qfixed x, qfixed y, void *data)
static VisibleGlyphRange visibleGlyphRange(const QRectF &clip, QFontEngine *fontEngine, glyph_t *glyphs, QFixedPoint *positions, int numGlyphs)
static bool monoVal(const uchar *s, int x)
static uchar * alignAddress(uchar *address, quintptr alignmentMask)
static bool splitPolygon(const QPointF *points, int pointCount, QList< QPointF > *upper, QList< QPointF > *lower)
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)
static void qt_span_fill_clipped(int count, const QT_FT_Span *spans, void *userData)
static QColor qPremultiplyWithExtraAlpha(const QColor &c, int alpha)
static void qt_ft_outline_cubic_to(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data)
#define int_dim(pos, dim)
static const QRect toAlignedRect_positive(const QRectF &rect)
static bool isAbove(const QPointF *a, const QPointF *b)
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[]
#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)
static const struct TessellationWindingOrderTab cw[]
#define qt_fixed_to_real(fixed)
QT_BEGIN_NAMESPACE typedef qreal qfixed
QT_BEGIN_NAMESPACE constexpr void qSwap(T &value1, T &value2) noexcept(std::is_nothrow_swappable_v< T >)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
unsigned long long quint64
QFuture< QSet< QChar > > set
[10]
Q_CHECK_PTR(a=new int[80])
std::uniform_real_distribution dist(1, 2.5)
[2]
QTextStream out(stdout)
[7]
Qt::ClipOperation operation
static constexpr 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::@211 origin
AlphaRGBBlitFunc alphaRGBBlit
QRasterBuffer * rasterBuffer
void initTexture(const QImage *image, int alpha, QTextureData::Type=QTextureData::Plain, const QRect &sourceRect=QRect())
void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode, bool isCosmetic)
BitmapBlitFunc bitmapBlit
std::shared_ptr< const void > cachedGradient
ProcessSpans unclipped_blend
AlphamapBlitFunc alphamapBlit
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