7#include <private/qtquickglobal_p.h>
8#include <private/qquickcontext2dtexture_p.h>
9#include <private/qquickitem_p.h>
10#if QT_CONFIG(quick_shadereffect)
11#include <QtQuick/private/qquickshadereffectsource_p.h>
15#include <QtQuick/private/qsgcontext_p.h>
16#include <private/qquicksvgparser_p.h>
17#if QT_CONFIG(quick_path)
18#include <private/qquickpath_p.h>
20#include <private/qquickimage_p_p.h>
25#include <private/qv4domerrors_p.h>
26#include <private/qv4engine_p.h>
27#include <private/qv4object_p.h>
28#include <private/qv4qobjectwrapper_p.h>
29#include <private/qquickwindow_p.h>
31#include <private/qv4value_p.h>
32#include <private/qv4functionobject_p.h>
33#include <private/qv4objectproto_p.h>
34#include <private/qv4scopedvalue_p.h>
35#include <private/qlocale_tools_p.h>
37#include <QtCore/qmath.h>
38#include <QtCore/qvector.h>
39#include <QtCore/private/qnumeric_p.h>
40#include <QtCore/QRunnable>
41#include <QtGui/qguiapplication.h>
42#include <private/qguiapplication_p.h>
43#include <qpa/qplatformintegration.h>
45#include <private/qsgdefaultrendercontext_p.h>
48#if defined(Q_OS_QNX) || defined(Q_OS_ANDROID)
92#define CHECK_CONTEXT(r) if (!r || !r->d()->context() || !r->d()->context()->bufferValid()) \
93 THROW_GENERIC_ERROR("Not a Context2D object");
95#define CHECK_CONTEXT_SETTER(r) if (!r || !r->d()->context() || !r->d()->context()->bufferValid()) \
96 THROW_GENERIC_ERROR("Not a Context2D object");
97#define qClamp(val, min, max) qMin(qMax(val, min), max)
98#define CHECK_RGBA(c) (c == '-' || c == '.' || (c >=0 && c <= 9))
106 if (!
p ||
len > 255 ||
len <= 7)
109 bool isRgb(
false), isHsl(
false),
hasAlpha(
false);
112 while (isspace(*
p))
p++;
113 if (strncmp(
p,
"rgb", 3) == 0)
115 else if (strncmp(
p,
"hsl", 3) == 0)
127 int rh, gs, bl,
alpha = 255;
130 while (isspace(*
p))
p++;
131 rh = strtol(
p, &
p, 10);
133 rh =
qRound(rh/100.0 * 255);
136 if (*
p++ !=
',')
return QColor();
139 while (isspace(*
p))
p++;
140 gs = strtol(
p, &
p, 10);
142 gs =
qRound(gs/100.0 * 255);
145 if (*
p++ !=
',')
return QColor();
148 while (isspace(*
p))
p++;
149 bl = strtol(
p, &
p, 10);
151 bl =
qRound(bl/100.0 * 255);
156 if (*
p++!=
',')
return QColor();
157 while (isspace(*
p))
p++;
162 if (*
p !=
')')
return QColor();
164 return QColor::fromRgba(
qRgba(
qClamp(rh, 0, 255),
qClamp(gs, 0, 255),
qClamp(bl, 0, 255),
qClamp(
alpha, 0, 255)));
166 return QColor::fromHsl(
qClamp(rh, 0, 359),
qClamp(gs, 0, 255),
qClamp(bl, 0, 255),
qClamp(
alpha, 0, 255));
178 qWarning().nospace() <<
"Context2D: A font size of " << fontSizeToken <<
" is invalid.";
207 qWarning().nospace() <<
"Context2D: Invalid font size unit in font string.";
224 if (
ch == u
'"' ||
ch == u
'\'') {
225 if (quoteIndex == -1) {
228 if (
ch == fontFamiliesString.
at(quoteIndex)) {
231 extractedFamilies.push_back(family);
232 currentFamily.
clear();
235 qWarning().nospace() <<
"Context2D: Mismatched quote in font string.";
239 }
else if (
ch == u
' ' && quoteIndex == -1) {
241 if (!currentFamily.
isEmpty()) {
243 extractedFamilies.push_back(currentFamily);
244 currentFamily.
clear();
250 if (!currentFamily.
isEmpty()) {
251 if (quoteIndex == -1) {
253 extractedFamilies.push_back(currentFamily);
255 qWarning().nospace() <<
"Context2D: Unclosed quote in font string.";
259 if (extractedFamilies.isEmpty()) {
260 qWarning().nospace() <<
"Context2D: Missing or misplaced font family in font string"
261 <<
" (it must come after the font size).";
263 return extractedFamilies;
277 for (
const QString &fontFamilyToken : fontFamilyTokens) {
287 }
else if (fontFamilyToken.compare(
QLatin1String(
"sans-serif")) == 0) {
289 }
else if (fontFamilyToken.compare(
QLatin1String(
"cursive")) == 0) {
291 }
else if (fontFamilyToken.compare(
QLatin1String(
"monospace")) == 0) {
293 }
else if (fontFamilyToken.compare(
QLatin1String(
"fantasy")) == 0) {
296 if (styleHint != -1) {
304 qWarning(
"Context2D: The font families specified are invalid: %s",
qPrintable(fontFamilyTokens.join(
QString()).trimmed()));
316#define Q_TRY_SET_TOKEN(token, value, setStatement) \
317if (!(usedTokens & token)) { \
318 usedTokens |= token; \
321 qWarning().nospace() << "Context2D: Duplicate token " << QLatin1String(value) << " found in font string."; \
322 return currentFont; \
332 qWarning().nospace() <<
"Context2D: Font string is empty.";
339 if (fontSizeEnd == -1)
341 if (fontSizeEnd == -1) {
342 qWarning().nospace() <<
"Context2D: Invalid font size unit in font string.";
346 int fontSizeStart = fontString.
lastIndexOf(u
' ', fontSizeEnd);
347 if (fontSizeStart == -1) {
364 QString remainingFontString = fontString;
365 remainingFontString.
remove(fontSizeStart, fontSizeEnd - fontSizeStart);
366 QStringView remainingFontStringRef(remainingFontString);
369 const QStringView fontFamiliesString = remainingFontStringRef.
mid(fontSizeStart);
370 remainingFontStringRef.
truncate(fontSizeStart);
372 if (fontFamilies.isEmpty()) {
380 if (trimmedTokensStr.
isEmpty()) {
403 qWarning().nospace() <<
"Context2D: Duplicate token \"normal\" found in font string.";
415 bool conversionOk =
false;
422 qWarning().nospace() <<
"Context2D: Invalid or misplaced token " <<
token
423 <<
" found in font string.";
474 void init() { Object::init(); }
509 Object::markObjects(that, markStack);
555#if QT_CONFIG(quick_path)
697 int filterDim = 2 * delta + 1;
702 int h =
src.height();
705 int srcStride =
src.bytesPerLine() / 4;
708 int dstStride =
dst.bytesPerLine() / 4;
710 for (
int y = 0;
y <
h; ++
y) {
711 for (
int x = 0;
x <
w; ++
x) {
725 for (
int cy = 0; cy < filterDim; ++cy) {
726 int scy = sy + cy - delta;
728 if (scy < 0 || scy >=
h)
731 const QRgb *sry = sr + scy * srcStride;
733 for (
int cx = 0; cx < filterDim; ++cx) {
734 int scx = sx + cx - delta;
736 if (scx < 0 || scx >=
w)
739 const QRgb col = sry[scx];
749 redF +=
qRed(col) * wt;
750 greenF +=
qGreen(col) * wt;
751 blueF +=
qBlue(col) * wt;
752 alphaF +=
qAlpha(col) * wt;
771 int passes = quality? 3: 1;
772 int filterSize = 2 * radius + 1;
773 for (
int i = 0;
i < passes; ++
i)
781 }
else if (compositeOperator ==
QLatin1String(
"source-out")) {
783 }
else if (compositeOperator ==
QLatin1String(
"source-in")) {
785 }
else if (compositeOperator ==
QLatin1String(
"source-atop")) {
787 }
else if (compositeOperator ==
QLatin1String(
"destination-atop")) {
789 }
else if (compositeOperator ==
QLatin1String(
"destination-in")) {
791 }
else if (compositeOperator ==
QLatin1String(
"destination-out")) {
793 }
else if (compositeOperator ==
QLatin1String(
"destination-over")) {
803 }
else if (compositeOperator ==
QLatin1String(
"qt-destination")) {
805 }
else if (compositeOperator ==
QLatin1String(
"qt-multiply")) {
807 }
else if (compositeOperator ==
QLatin1String(
"qt-screen")) {
809 }
else if (compositeOperator ==
QLatin1String(
"qt-overlay")) {
811 }
else if (compositeOperator ==
QLatin1String(
"qt-darken")) {
813 }
else if (compositeOperator ==
QLatin1String(
"qt-lighten")) {
815 }
else if (compositeOperator ==
QLatin1String(
"qt-color-dodge")) {
817 }
else if (compositeOperator ==
QLatin1String(
"qt-color-burn")) {
819 }
else if (compositeOperator ==
QLatin1String(
"qt-hard-light")) {
821 }
else if (compositeOperator ==
QLatin1String(
"qt-soft-light")) {
823 }
else if (compositeOperator ==
QLatin1String(
"qt-difference")) {
825 }
else if (compositeOperator ==
QLatin1String(
"qt-exclusion")) {
905 o->setArrayType(QV4::Heap::ArrayData::Custom);
941 pixelData->setPrototypeOf(
p);
943 if (
image.isNull()) {
945 pixelData->d()->image->fill(0x00000000);
986 r->d()->context()->popState();
1000 r->d()->context()->reset();
1041 r->d()->context()->pushState();
1071 r->d()->context()->rotate(argv[0].
toNumber());
1149 r->d()->context()->setTransform( argv[0].
toNumber()
1181 r->d()->context()->transform( argv[0].
toNumber()
1228 r->d()->context()->setTransform(1, 0, 0, 1, 0, 0);
1283 if (globalAlpha >= 0.0 && globalAlpha <= 1.0 && r->
d()->
context()->
state.globalAlpha != globalAlpha) {
1284 r->d()->context()->state.globalAlpha = globalAlpha;
1285 r->d()->context()->buffer()->setGlobalAlpha(
r->d()->context()->state.globalAlpha);
1391 if (cm !=
r->d()->context()->state.globalCompositeOperation) {
1392 r->d()->context()->state.globalCompositeOperation = cm;
1393 r->d()->context()->buffer()->setGlobalCompositeOperation(cm);
1428 const QColor color =
r->d()->context()->state.fillStyle.color().toRgb();
1429 if (
color.isValid()) {
1430 if (
color.alpha() == 255)
1434 alphaString.
chop(1);
1453 if (
color.isValid()) {
1454 r->d()->context()->state.fillStyle =
color;
1455 r->d()->context()->buffer()->setFillStyle(
color);
1456 r->d()->context()->m_fillStyle.set(scope.
engine,
value);
1459 if (style && *style->d()->brush !=
r->d()->context()->state.fillStyle) {
1460 r->d()->context()->state.fillStyle = *style->d()->brush;
1461 r->d()->context()->buffer()->setFillStyle(*style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
1462 r->d()->context()->m_fillStyle.set(scope.
engine,
value);
1463 r->d()->context()->state.fillPatternRepeatX = style->d()->patternRepeatX;
1464 r->d()->context()->state.fillPatternRepeatY = style->d()->patternRepeatY;
1467 }
else if (
value->isString()) {
1471 r->d()->context()->buffer()->setFillStyle(
r->d()->context()->state.fillStyle);
1472 r->d()->context()->m_fillStyle.set(scope.
engine,
value);
1516 r->d()->context()->m_path.setFillRule(
r->d()->context()->state.fillRule);
1538 const QColor color =
r->d()->context()->state.strokeStyle.color().toRgb();
1539 if (
color.isValid()) {
1540 if (
color.alpha() == 255)
1544 alphaString.
chop(1);
1563 if (
color.isValid()) {
1564 r->d()->context()->state.strokeStyle =
color;
1565 r->d()->context()->buffer()->setStrokeStyle(
color);
1566 r->d()->context()->m_strokeStyle.set(scope.
engine,
value);
1569 if (style && *style->d()->brush !=
r->d()->context()->state.strokeStyle) {
1570 r->d()->context()->state.strokeStyle = *style->d()->brush;
1571 r->d()->context()->buffer()->setStrokeStyle(*style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
1572 r->d()->context()->m_strokeStyle.set(scope.
engine,
value);
1573 r->d()->context()->state.strokePatternRepeatX = style->d()->patternRepeatX;
1574 r->d()->context()->state.strokePatternRepeatY = style->d()->patternRepeatY;
1575 }
else if (!style &&
r->d()->context()->state.strokeStyle !=
QBrush(
QColor())) {
1579 r->d()->context()->buffer()->setStrokeStyle(
r->d()->context()->state.strokeStyle);
1580 r->d()->context()->m_strokeStyle.set(scope.
engine,
value);
1583 }
else if (
value->isString()) {
1587 r->d()->context()->buffer()->setStrokeStyle(
r->d()->context()->state.strokeStyle);
1588 r->d()->context()->m_strokeStyle.set(scope.
engine,
value);
1633 gradient->setPrototypeOf(
p);
1681 if (r0 < 0 ||
r1 < 0)
1688 gradient->setPrototypeOf(
p);
1734 gradient->setPrototypeOf(
p);
1796 argv[0], QMetaType::fromType<QColor>()).
value<
QColor>();
1797 if (
color.isValid()) {
1798 int patternMode = argv[1].
toInt32();
1811 patternTexture = *pixelData->d()->image;
1817 if (!patternTexture.
isNull()) {
1818 pattern->d()->brush->setTextureImage(patternTexture);
1822 pattern->d()->patternRepeatX =
true;
1823 pattern->
d()->patternRepeatY =
true;
1825 pattern->d()->patternRepeatX =
true;
1826 pattern->d()->patternRepeatY =
false;
1828 pattern->d()->patternRepeatX =
false;
1829 pattern->d()->patternRepeatY =
true;
1831 pattern->d()->patternRepeatX =
false;
1832 pattern->d()->patternRepeatY =
false;
1871 switch (
r->d()->context()->state.lineCap) {
1903 if (
cap !=
r->d()->context()->state.lineCap) {
1904 r->d()->context()->state.lineCap =
cap;
1905 r->d()->context()->buffer()->setLineCap(
cap);
1932 switch (
r->d()->context()->state.lineJoin) {
1964 if (join !=
r->d()->context()->state.lineJoin) {
1965 r->d()->context()->state.lineJoin = join;
1966 r->d()->context()->buffer()->setLineJoin(join);
1993 r->d()->context()->state.lineWidth =
w;
1994 r->d()->context()->buffer()->setLineWidth(
w);
2021 if (ml > 0 &&
qt_is_finite(ml) && ml !=
r->d()->context()->state.miterLimit) {
2022 r->d()->context()->state.miterLimit = ml;
2023 r->d()->context()->buffer()->setMiterLimit(ml);
2095 const double number =
v->toNumber();
2102 if (dashes.
size() % 2 != 0) {
2106 r->d()->context()->state.lineDash = dashes;
2107 r->d()->context()->buffer()->setLineDash(dashes);
2139 r->d()->context()->state.lineDashOffset =
offset;
2140 r->d()->context()->buffer()->setLineDashOffset(
offset);
2168 if (blur > 0 &&
qt_is_finite(blur) && blur !=
r->d()->context()->state.shadowBlur) {
2169 r->d()->context()->state.shadowBlur = blur;
2170 r->d()->context()->buffer()->setShadowBlur(blur);
2198 if (
color.isValid() &&
color !=
r->d()->context()->state.shadowColor) {
2199 r->d()->context()->state.shadowColor =
color;
2200 r->d()->context()->buffer()->setShadowColor(
color);
2228 if (
qt_is_finite(offsetX) && offsetX !=
r->d()->context()->state.shadowOffsetX) {
2229 r->d()->context()->state.shadowOffsetX = offsetX;
2230 r->d()->context()->buffer()->setShadowOffsetX(offsetX);
2256 if (
qt_is_finite(offsetY) && offsetY !=
r->d()->context()->state.shadowOffsetY) {
2257 r->d()->context()->state.shadowOffsetY = offsetY;
2258 r->d()->context()->buffer()->setShadowOffsetY(offsetY);
2263#if QT_CONFIG(quick_path)
2280 r->d()->context()->beginPath();
2282 if (!!qobjectWrapper) {
2283 if (
QQuickPath *
path = qobject_cast<QQuickPath*>(qobjectWrapper->object()))
2284 r->d()->context()->m_path =
path->path();
2289 r->d()->context()->m_v4path.set(scope.engine,
value);
2309 r->d()->context()->clearRect(argv[0].
toNumber(),
2385 bool antiClockwise =
false;
2395 r->d()->context()->arc(argv[0].
toNumber(),
2442 r->d()->context()->arcTo(argv[0].
toNumber(),
2464 r->d()->context()->beginPath();
2509 r->d()->context()->bezierCurveTo(cp1x, cp1y, cp2x, cp2y,
x,
y);
2544 r->d()->context()->clip();
2561 r->d()->context()->closePath();
2580 r->d()->context()->fill();
2602 r->d()->context()->lineTo(
x,
y);
2625 r->d()->context()->moveTo(
x,
y);
2654 r->d()->context()->quadraticCurveTo(cpx, cpy,
x,
y);
2692 r->d()->context()->roundedRect(argv[0].
toNumber()
2765 r->d()->context()->stroke();
2783 bool pointInPath =
false;
2785 pointInPath =
r->d()->context()->isPointInPath(argv[0].
toNumber(), argv[1].
toNumber());
2849 if (
font !=
r->d()->context()->state.font) {
2850 r->d()->context()->state.font =
font;
2876 switch (
r->d()->context()->state.textAlign) {
2901 QString textAlign =
s->toQString();
2917 if (ta !=
r->d()->context()->state.textAlign)
2918 r->d()->context()->state.textAlign = ta;
2943 switch (
r->d()->context()->state.textBaseline) {
2967 QString textBaseline =
s->toQString();
2983 if (tb !=
r->d()->context()->state.textBaseline)
2984 r->d()->context()->state.textBaseline = tb;
3011 r->d()->context()->buffer()->fill(textPath);
3127 qreal sx, sy, sw, sh, dx, dy, dw, dh;
3133 if (!
r->d()->context()->state.invertibleCTM)
3139 if (
arg->isString()) {
3144 pixmap =
r->d()->context()->createPixmap(
url);
3145 }
else if (
arg->isObject()) {
3147 if (!!qobjectWrapper) {
3148 if (
QQuickImage *imageItem = qobject_cast<QQuickImage*>(qobjectWrapper->object())) {
3149 pixmap =
r->d()->context()->createPixmap(imageItem->source());
3150 }
else if (
QQuickCanvasItem *canvas = qobject_cast<QQuickCanvasItem*>(qobjectWrapper->object())) {
3169 pixmap =
r->d()->context()->createPixmap(
url);
3190 }
else if (argc >= 5) {
3199 }
else if (argc >= 3) {
3226 || sx + sw >
pixmap->width()
3227 || sy + sh >
pixmap->height()
3228 || sx + sw < 0 || sy + sh < 0) {
3232 r->d()->context()->buffer()->drawPixmap(
pixmap,
QRectF(sx, sy, sw, sh),
QRectF(dx, dy, dw, dh));
3268 int width =
r ?
r->d()->image->width() : 0;
3283 int height =
r ?
r->d()->image->height() : 0;
3322 if (!
r ||
r->d()->image->isNull())
3330 if (!
id.isArrayIndex())
3339 if (
index <
static_cast<quint32>(
r->d()->image->width() *
r->d()->image->height() * 4)) {
3342 const quint32 w =
r->d()->image->width();
3345 const QRgb* pixel =
reinterpret_cast<const QRgb*
>(
r->d()->image->constScanLine(
row));
3347 switch (
index % 4) {
3366 if (!
id.isArrayIndex())
3378 const int v =
value.toInt32();
3379 if (
r &&
index <
static_cast<quint32>(
r->d()->image->width() *
r->d()->image->height() * 4) &&
v >= 0 &&
v <= 255) {
3380 const quint32 w =
r->d()->image->width();
3384 QRgb* pixel =
reinterpret_cast<QRgb*
>(
r->d()->image->scanLine(
row));
3386 switch (
index % 4) {
3438 qreal w = pa->d()->image->width();
3439 qreal h = pa->d()->image->height();
3446 }
else if (argc == 2) {
3481 if (
w <= 0 ||
h <= 0)
3513 qreal w,
h, dirtyX, dirtyY, dirtyWidth, dirtyHeight;
3524 w = pixelArray->d()->image->width();
3525 h = pixelArray->d()->image->height();
3537 if (dirtyWidth < 0) {
3538 dirtyX = dirtyX+dirtyWidth;
3539 dirtyWidth = -dirtyWidth;
3542 if (dirtyHeight < 0) {
3543 dirtyY = dirtyY+dirtyHeight;
3544 dirtyHeight = -dirtyHeight;
3548 dirtyWidth = dirtyWidth+dirtyX;
3553 dirtyHeight = dirtyHeight+dirtyY;
3557 if (dirtyX+dirtyWidth >
w) {
3558 dirtyWidth =
w - dirtyX;
3561 if (dirtyY+dirtyHeight >
h) {
3562 dirtyHeight =
h - dirtyY;
3565 if (dirtyWidth <=0 || dirtyHeight <= 0)
3574 QImage image = pixelArray->d()->image->copy(dirtyX, dirtyY, dirtyWidth, dirtyHeight);
3575 r->d()->context()->buffer()->drawImage(
image,
QRectF(dirtyX, dirtyY, dirtyWidth, dirtyHeight),
QRectF(dx, dy, dirtyWidth, dirtyHeight));
3612 if (!style->d()->brush->gradient())
3613 THROW_GENERIC_ERROR(
"Not a valid CanvasGradient object, can't get the gradient information");
3614 QGradient gradient = *(style->d()->brush->gradient());
3618 if (argv[1].as<Object>()) {
3620 argv[1], QMetaType::fromType<QColor>()).
value<
QColor>();
3628 if (
color.isValid()) {
3633 *style->d()->brush = gradient;
3641 if (!
state.invertibleCTM)
3651 state.invertibleCTM =
false;
3655 state.matrix = newTransform;
3662 if (!
state.invertibleCTM)
3672 state.invertibleCTM =
false;
3676 state.matrix = newTransform;
3683 if (!
state.invertibleCTM)
3693 state.invertibleCTM =
false;
3697 state.matrix = newTransform;
3704 if (!
state.invertibleCTM)
3714 state.invertibleCTM =
false;
3718 state.matrix = newTransform;
3725 if (!
state.invertibleCTM)
3735 state.invertibleCTM =
false;
3738 state.matrix = newTransform;
3740 m_path =
transform.inverted().map(m_path);
3753 m_path = ctm.
map(m_path);
3754 state.invertibleCTM =
true;
3760 if (!
state.invertibleCTM)
3763 if (!m_path.elementCount())
3766 m_path.setFillRule(
state.fillRule);
3772 if (!
state.invertibleCTM)
3781 state.clipPath = clipPath;
3788 if (!
state.invertibleCTM)
3791 if (!m_path.elementCount())
3794 buffer()->stroke(m_path);
3799 if (!
state.invertibleCTM)
3810 if (!
state.invertibleCTM)
3821 if (!
state.invertibleCTM)
3832 if (!
state.invertibleCTM)
3840 buffer()->fill(textPath);
3842 buffer()->stroke(textPath);
3848 if (!m_path.elementCount())
3855 if (!m_path.elementCount())
3858 QRectF boundRect = m_path.boundingRect();
3860 m_path.closeSubpath();
3867 if (!
state.invertibleCTM)
3876 if (!
state.invertibleCTM)
3881 if (!m_path.elementCount())
3883 else if (m_path.currentPosition() != pt)
3890 if (!
state.invertibleCTM)
3893 if (!m_path.elementCount())
3894 m_path.moveTo(
QPointF(cpx, cpy));
3897 if (m_path.currentPosition() != pt)
3898 m_path.quadTo(
QPointF(cpx, cpy), pt);
3905 if (!
state.invertibleCTM)
3908 if (!m_path.elementCount())
3909 m_path.moveTo(
QPointF(cp1x, cp1y));
3912 if (m_path.currentPosition() != pt)
3918 QPointF p0(m_path.currentPosition());
3922 qreal p1p0_length = std::hypot(p1p0.
x(), p1p0.
y());
3923 qreal p1p2_length = std::hypot(p1p2.
x(), p1p2.
y());
3935 qreal tangent = radius / std::tan(std::acos(cos_phi) / 2);
3936 qreal factor_p1p0 = tangent / p1p0_length;
3937 QPointF t_p1p0((
p1.x() + factor_p1p0 * p1p0.
x()), (
p1.y() + factor_p1p0 * p1p0.
y()));
3940 qreal orth_p1p0_length = std::hypot(orth_p1p0.
x(), orth_p1p0.
y());
3941 qreal factor_ra = radius / orth_p1p0_length;
3945 if (cos_alpha < 0.f)
3946 orth_p1p0 =
QPointF(-orth_p1p0.
x(), -orth_p1p0.
y());
3948 QPointF p((t_p1p0.
x() + factor_ra * orth_p1p0.
x()), (t_p1p0.
y() + factor_ra * orth_p1p0.
y()));
3951 orth_p1p0 =
QPointF(-orth_p1p0.
x(), -orth_p1p0.
y());
3952 qreal sa = std::atan2(orth_p1p0.
y(), orth_p1p0.
x());
3955 bool anticlockwise =
false;
3957 qreal factor_p1p2 = tangent / p1p2_length;
3958 QPointF t_p1p2((
p1.x() + factor_p1p2 * p1p2.
x()), (
p1.y() + factor_p1p2 * p1p2.
y()));
3959 QPointF orth_p1p2((t_p1p2.
x() -
p.x()), (t_p1p2.
y() -
p.y()));
3960 qreal ea = std::atan2(orth_p1p2.
y(), orth_p1p2.
x());
3961 if ((sa > ea) && ((sa - ea) <
M_PI))
3962 anticlockwise =
true;
3963 if ((sa < ea) && ((ea - sa) >
M_PI))
3964 anticlockwise =
true;
3966 arc(
p.x(),
p.y(), radius, sa, ea, anticlockwise);
3973 if (!
state.invertibleCTM)
3982 if (!m_path.elementCount())
3984 else if (st == m_path.currentPosition() || st ==
end || !radius)
3987 addArcTo(st,
end, radius);
3992 if (!
state.invertibleCTM)
3998 m_path.moveTo(
x,
y);
4001 m_path.addRect(
x,
y,
w,
h);
4008 if (!
state.invertibleCTM)
4015 m_path.moveTo(
x,
y);
4024 if (!
state.invertibleCTM)
4031 m_path.moveTo(
x,
y);
4035 m_path.addEllipse(
x,
y,
w,
h);
4040 if (!
state.invertibleCTM)
4045 m_path.addPath(
path);
4050 if (!
state.invertibleCTM)
4067 antiClockWise = !antiClockWise;
4075 double xs = xc - radius;
4076 double ys = yc - radius;
4077 double width = radius*2;
4078 double height = radius*2;
4079 if ((!antiClockWise && (ea - sa >= 360)) || (antiClockWise && (sa - ea >= 360)))
4085 if (!antiClockWise && (ea < sa)) {
4087 }
else if (antiClockWise && (sa < ea)) {
4099 if (!m_path.elementCount())
4102 m_path.lineTo(xc, yc);
4151 m_grabbedImage = grab;
4157 return m_canvas->loadedPixmap(
url, sourceSize);
4181 return (
p >=
a &&
p <=
b) || (
p >=
b &&
p <=
a);
4186 if (!
state.invertibleCTM)
4189 if (!m_path.elementCount())
4212 for (
int i = 1;
i <
border.size(); ++
i) {
4339 qWarning() <<
"Pixel readback is not supported in Cooperative mode, please try Threaded or Immediate mode";
4373#if QT_CONFIG(quick_path)
4374 proto->defineAccessorProperty(
QStringLiteral(
"path"), QQuickJSContext2D::method_get_path, QQuickJSContext2D::method_set_path);
4489 wrapper->d()->setContext(
this);
4496#include "moc_qquickcontext2d_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
static QColor fromRgba(QRgb rgba) noexcept
Static convenience function that returns a QColor constructed from the given QRgb value rgba.
static QColor fromString(QAnyStringView name) noexcept
static QColor fromHsl(int h, int s, int l, int a=255)
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
Type
This enum type defines the valid event types in Qt.
static bool hasFamily(const QString &family)
\reentrant \inmodule QtGui
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
void setStyle(Style style)
Sets the style of the font to style.
void setPointSize(int)
Sets the point size to pointSize.
void setCapitalization(Capitalization)
void setFamily(const QString &)
Sets the family name of the font.
QString defaultFamily() const
Returns the family name that corresponds to the current style hint.
void setPixelSize(int)
Sets the font size to pixelSize pixels, with a maxiumum size of an unsigned 16-bit integer.
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
void setStyleHint(StyleHint, StyleStrategy=PreferDefault)
Sets the style hint and strategy to hint and strategy, respectively.
Weight
Qt uses a weighting scale from 1 to 1000 compatible with OpenType.
void setWeight(Weight weight)
Sets the weight of the font to weight, using the scale defined by \l QFont::Weight enumeration.
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
static QPlatformIntegration * platformIntegration()
Qt::LayoutDirection layoutDirection
the default layout direction for this application
bool isNull() const
Returns true if it is a null image, otherwise returns false.
qsizetype size() const noexcept
bool isEmpty() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
void unlock() noexcept
Unlocks the mutex.
void lock() noexcept
Locks the mutex.
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QThread * thread() const
Returns the thread in which the object lives.
void deleteLater()
\threadsafe
QPainterPath intersected(const QPainterPath &r) const
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
void addText(const QPointF &point, const QFont &f, const QString &text)
Adds the given text to this path as a set of closed subpaths created from the font supplied.
CompositionMode
Defines the modes supported for digital image compositing.
@ CompositionMode_Destination
@ CompositionMode_Lighten
@ CompositionMode_ColorDodge
@ CompositionMode_DestinationAtop
@ CompositionMode_SourceOver
@ CompositionMode_DestinationOut
@ CompositionMode_SourceAtop
@ CompositionMode_Overlay
@ CompositionMode_Multiply
@ CompositionMode_DestinationOver
@ CompositionMode_HardLight
@ CompositionMode_Exclusion
@ CompositionMode_ColorBurn
@ CompositionMode_Difference
@ CompositionMode_SoftLight
@ CompositionMode_DestinationIn
@ CompositionMode_SourceOut
@ CompositionMode_SourceIn
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
static constexpr qreal dotProduct(const QPointF &p1, const QPointF &p2)
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
The QPolygonF class provides a list of points using floating point precision.
RenderStrategy renderStrategy
RenderTarget renderTarget
void setShadowBlur(qreal b)
void updateMatrix(const QTransform &matrix)
void setGlobalCompositeOperation(QPainter::CompositionMode cm)
void setStrokeStyle(const QBrush &style, bool repeatX=false, bool repeatY=false)
void setShadowOffsetX(qreal x)
void setFillStyle(const QBrush &style, bool repeatX=false, bool repeatY=false)
void setLineCap(Qt::PenCapStyle cap)
void setLineDash(const QVector< qreal > &pattern)
void setMiterLimit(qreal limit)
void setLineWidth(qreal w)
void clip(bool enabled, const QPainterPath &path)
void setShadowOffsetY(qreal y)
void setShadowColor(const QColor &color)
void clearRect(const QRectF &r)
void setGlobalAlpha(qreal alpha)
void setLineJoin(Qt::PenJoinStyle join)
QV4::PersistentValue gradientProto
~QQuickContext2DEngineData()
QQuickContext2DEngineData(QV4::ExecutionEngine *engine)
QV4::PersistentValue contextPrototype
QV4::PersistentValue pixelArrayProto
static QQuickContext2DRenderThread * instance(QQmlEngine *engine)
void setItem(QQuickCanvasItem *item)
void setOnCustomThread(bool is)
bool setCanvasWindow(const QRect &canvasWindow)
void canvasChanged(const QSize &canvasSize, const QSize &tileSize, const QRect &canvasWindow, const QRect &dirtyRect, bool smooth, bool antialiasing)
virtual void grabImage(const QRectF ®ion=QRectF())=0
void paint(QQuickContext2DCommandBuffer *ccb)
bool setCanvasSize(const QSize &size)
bool setTileSize(const QSize &size)
void setSmooth(bool smooth)
void setAntialiasing(bool antialiasing)
QPainterPath createTextGlyphs(qreal x, qreal y, const QString &text)
bool isPointInPath(qreal x, qreal y) const
void arcTo(qreal x1, qreal y1, qreal x2, qreal y2, qreal radius)
void translate(qreal x, qreal y)
QQuickContext2DTexture * texture() const
QV4::ExecutionEngine * v4Engine() const override
void strokeRect(qreal x, qreal y, qreal w, qreal h)
void text(const QString &str, qreal x, qreal y)
void ellipse(qreal x, qreal y, qreal w, qreal h)
QV4::ExecutionEngine * m_v4engine
QV4::ReturnedValue v4value() const override
void setTransform(qreal a, qreal b, qreal c, qreal d, qreal e, qreal f)
QImage toImage(const QRectF &bounds) override
void arc(qreal x, qreal y, qreal radius, qreal startAngle, qreal endAngle, bool anticlockwise)
QStringList contextNames() const override
void setGrabbedImage(const QImage &grab)
void lineTo(qreal x, qreal y)
QQuickContext2D(QObject *parent=nullptr)
void init(QQuickCanvasItem *canvasItem, const QVariantMap &args) override
QQuickContext2DCommandBuffer * buffer() const
void scale(qreal x, qreal y)
void bezierCurveTo(qreal cp1x, qreal cp1y, qreal cp2x, qreal cp2y, qreal x, qreal y)
void prepare(const QSize &canvasSize, const QSize &tileSize, const QRect &canvasWindow, const QRect &dirtyRect, bool smooth, bool antialiasing) override
QQuickContext2DTexture * m_texture
QQuickCanvasItem * m_canvas
void quadraticCurveTo(qreal cpx, qreal cpy, qreal x, qreal y)
QQuickCanvasItem::RenderStrategy m_renderStrategy
void drawText(const QString &text, qreal x, qreal y, bool fill)
void roundedRect(qreal x, qreal y, qreal w, qreal h, qreal xr, qreal yr)
QQuickCanvasItem::RenderTarget m_renderTarget
QQmlRefPointer< QQuickCanvasPixmap > createPixmap(const QUrl &url, QSizeF sourceSize=QSizeF())
void setV4Engine(QV4::ExecutionEngine *eng) override
void shear(qreal h, qreal v)
QQuickContext2DCommandBuffer * m_buffer
void clearRect(qreal x, qreal y, qreal w, qreal h)
void addArcTo(const QPointF &p1, const QPointF &p2, qreal radius)
void transform(qreal a, qreal b, qreal c, qreal d, qreal e, qreal f)
QV4::PersistentValue m_v4value
void rect(qreal x, qreal y, qreal w, qreal h)
void moveTo(qreal x, qreal y)
void fillRect(qreal x, qreal y, qreal w, qreal h)
QStack< QQuickContext2D::State > m_stateStack
qreal width
This property holds the width of this item.
bool antialiasing
\qmlproperty bool QtQuick::Item::antialiasing
bool smooth
\qmlproperty bool QtQuick::Item::smooth
qreal height
This property holds the height of this item.
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
\inmodule QtCore\reentrant
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
T pop()
Removes the top item from the stack and returns it.
void push(const T &t)
Adds element t to the top of the stack.
constexpr void truncate(qsizetype n) noexcept
Truncates this string view to length length.
Q_CORE_EXPORT float toFloat(bool *ok=nullptr) const
Returns the string view converted to a float value.
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
constexpr qsizetype size() const noexcept
Returns the size of this string view, in UTF-16 code units (that is, surrogate pairs count as two for...
constexpr QStringView left(qsizetype n) const noexcept
Q_CORE_EXPORT QList< QStringView > split(QStringView sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the view into substring views wherever sep occurs, and returns the list of those string views.
QString toString() const
Returns a deep copy of this string view's data as a QString.
constexpr QStringView right(qsizetype n) const noexcept
constexpr QChar at(qsizetype n) const noexcept
Returns the character at position n in this string view.
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
QStringView trimmed() const noexcept
Strips leading and trailing whitespace and returns the result.
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
void chop(qsizetype n)
Removes n characters from the end of the string.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void clear()
Clears the contents of the string and makes it null.
qsizetype size() const
Returns the number of characters in this string.
void push_back(QChar c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QChar * data()
Returns a pointer to the data stored in the QString.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
QByteArray toUtf8() const &
static QThread * currentThread()
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
ObjectType::Data * allocate(Args &&... args)
ReturnedValue value() const
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
bool parsePathDataFast(const QString &dataStr, QPainterPath &path)
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
@ BlockingQueuedConnection
static int arrayLength(const QString &rawType)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
qfloat16 qSqrt(qfloat16 f)
int qRound(qfloat16 d) noexcept
constexpr float qRadiansToDegrees(float radians)
static QT_BEGIN_NAMESPACE const int tileSize
constexpr T qAbs(const T &t)
constexpr static Q_DECL_CONST_FUNCTION double qt_qnan() noexcept
static Q_DECL_CONST_FUNCTION bool qt_is_finite(double d)
#define Q_ARG(Type, data)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
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]
GLsizei const GLuint const GLfloat * weights
GLuint GLfloat GLfloat GLfloat x1
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLsizei GLenum const void GLuint GLsizei GLfloat * metrics
GLuint GLuint GLfloat weight
GLint GLint GLint yoffset
GLenum GLuint GLintptr offset
GLuint GLfloat GLfloat y0
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum GLenum transform
GLfixed GLfixed GLfixed y2
GLsizei const GLchar *const * path
GLenum GLenum GLsizei void * row
GLenum GLenum GLsizei void GLsizei void void * span
GLfloat GLfloat GLfloat alpha
static bool hasAlpha(const QImage &image)
QQmlEngine * qmlEngine(const QObject *obj)
static bool withinRange(qreal p, qreal a, qreal b)
#define qClamp(val, min, max)
static QPainter::CompositionMode qt_composite_mode_from_string(const QString &compositeOperator)
static QFont qt_font_from_string(const QString &fontString, const QFont ¤tFont)
QImage qt_image_convolute_filter(const QImage &src, const QVector< qreal > &weights, int radius=0)
static int textAlignOffset(QQuickContext2D::TextAlignType value, const QFontMetrics &metrics, const QString &text)
#define CHECK_CONTEXT(r)
\qmltype Context2D \instantiates QQuickContext2D \inqmlmodule QtQuick
#define Q_TRY_SET_TOKEN(token, value, setStatement)
int baseLineOffset(QQuickContext2D::TextBaseLineType value, const QFontMetrics &metrics)
static bool qSetFontFamilyFromTokens(QFont &font, const QStringList &fontFamilyTokens)
static bool areCollinear(const QPointF &a, const QPointF &b, const QPointF &c)
#define CHECK_CONTEXT_SETTER(r)
static bool qSetFontSizeFromToken(QFont &font, QStringView fontSizeToken)
Q_QUICK_PRIVATE_EXPORT QColor qt_color_from_string(const QV4::Value &name)
static int qParseFontSizeFromToken(QStringView fontSizeToken, bool &ok)
void qt_image_boxblur(QImage &image, int radius, bool quality)
static QString qt_composite_mode_to_string(QPainter::CompositionMode op)
static QStringList qExtractFontFamiliesFromString(QStringView fontFamiliesString)
static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionEngine *v4, const QImage &image)
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr int qRed(QRgb rgb)
constexpr int qGreen(QRgb rgb)
constexpr QRgb qRgba(int r, int g, int b, int a)
constexpr int qBlue(QRgb rgb)
constexpr int qAlpha(QRgb rgb)
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
#define DOMEXCEPTION_NOT_SUPPORTED_ERR
#define DOMEXCEPTION_SYNTAX_ERR
#define DOMEXCEPTION_INDEX_SIZE_ERR
#define THROW_DOM(error, string)
#define DOMEXCEPTION_TYPE_MISMATCH_ERR
#define V4_DEFINE_EXTENSION(dataclass, datafunction)
#define THROW_TYPE_ERROR()
#define RETURN_UNDEFINED()
#define THROW_GENERIC_ERROR(str)
#define DEFINE_OBJECT_VTABLE(classname)
#define V4_OBJECT2(DataClass, superClass)
QUrl url("example.com")
[constructor-url-reference]
\inmodule QtCore \reentrant
static V4_NEEDS_DESTROY QV4::ReturnedValue gradient_proto_addColorStop(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmltype CanvasGradient \inqmlmodule QtQuick
Qt::PenJoinStyle lineJoin
QPainter::CompositionMode globalCompositeOperation
QVector< qreal > lineDash
static QV4::ReturnedValue method_get_data(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty object QtQuick::CanvasImageData::data Holds the one-dimensional array containing the dat...
static QV4::ReturnedValue method_get_height(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty int QtQuick::CanvasImageData::height Holds the actual height dimension of the data in th...
static QV4::ReturnedValue method_get_width(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmltype CanvasImageData \inqmlmodule QtQuick
static QV4::ReturnedValue proto_get_length(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmltype CanvasPixelArray \inqmlmodule QtQuick
static QV4::ReturnedValue method_isPointInPath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::isPointInPath(real x, real y)
static QV4::ReturnedValue method_measureText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::measureText(text)
static QV4::ReturnedValue method_moveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::moveTo(real x, real y)
static QV4::ReturnedValue method_bezierCurveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::bezierCurveTo(real cp1x, real cp1y, real cp2x,...
static QV4::ReturnedValue method_getImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod CanvasImageData QtQuick::Context2D::getImageData(real x, real y, real w,...
static QV4::ReturnedValue method_setLineDash(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod QtQuick::Context2D::setLineDash(array pattern)
static QV4::ReturnedValue method_quadraticCurveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::quadraticCurveTo(real cpx, real cpy, real x,...
static QV4::ReturnedValue method_drawImage(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod QtQuick::Context2D::drawImage(variant image, real dx, real dy) Draws the given image on th...
static QV4::ReturnedValue method_scale(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::scale(real x, real y)
static QV4::ReturnedValue method_stroke(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::stroke()
static QV4::ReturnedValue method_closePath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::closePath() Closes the current subpath by drawing a line to the...
static QV4::ReturnedValue method_strokeRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::strokeRect(real x, real y, real w, real h)
static QV4::ReturnedValue method_transform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::transform(real a, real b, real c, real d, real e,...
static QV4::ReturnedValue method_translate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::translate(real x, real y)
static QV4::ReturnedValue method_ellipse(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::ellipse(real x, real y, real w, real h)
static QV4::ReturnedValue method_resetTransform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::resetTransform()
static QV4::ReturnedValue method_createRadialGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::createRadialGradient(real x0, real y0, real r0,...
static QV4::ReturnedValue method_get_canvas(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty QtQuick::Canvas QtQuick::Context2D::canvas Holds the canvas item that the context paints...
static QV4::ReturnedValue method_clip(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::clip()
static QV4::ReturnedValue method_createLinearGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::createLinearGradient(real x0, real y0, real x1,...
static QV4::ReturnedValue method_reset(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::reset() Resets the context state and properties to the default ...
static QV4::ReturnedValue method_fillText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::fillText(text, x, y)
static QV4::ReturnedValue method_arc(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::arc(real x, real y, real radius, real startAngle,...
static QV4::ReturnedValue method_save(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::save() Pushes the current state onto the state stack.
static QV4::ReturnedValue method_drawFocusRing(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_shear(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::shear(real sh, real sv)
static QV4::ReturnedValue method_lineTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::lineTo(real x, real y)
static QV4::Heap::QQuickJSContext2DPrototype * create(QV4::ExecutionEngine *engine)
static QV4::ReturnedValue method_setTransform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::setTransform(real a, real b, real c, real d,...
static QV4::ReturnedValue method_createConicalGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::createConicalGradient(real x, real y, real angle)
static QV4::ReturnedValue method_strokeText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::strokeText(text, x, y)
static QV4::ReturnedValue method_restore(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::restore() Pops the top state on the stack, restoring the contex...
static QV4::ReturnedValue method_rect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::rect(real x, real y, real w, real h)
static QV4::ReturnedValue method_beginPath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::beginPath()
static QV4::ReturnedValue method_rotate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::rotate(real angle) Rotate the canvas around the current origin ...
static QV4::ReturnedValue method_fillRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::fillRect(real x, real y, real w, real h)
static QV4::ReturnedValue method_getLineDash(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod array QtQuick::Context2D::getLineDash()
static QV4::ReturnedValue method_arcTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::arcTo(real x1, real y1, real x2, real y2,...
static QV4::ReturnedValue method_fill(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::fill()
static QV4::ReturnedValue method_setCaretSelectionRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_createImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod CanvasImageData QtQuick::Context2D::createImageData(real sw, real sh)
static QV4::ReturnedValue method_createPattern(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod variant QtQuick::Context2D::createPattern(color color, enumeration patternMode) This is an...
static QV4::ReturnedValue method_roundedRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::roundedRect(real x, real y, real w, real h, real xRadius,...
static QV4::ReturnedValue method_caretBlinkRate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_putImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::putImageData(CanvasImageData imageData, real dx,...
static QV4::ReturnedValue method_text(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::text(string text, real x, real y)
static QV4::ReturnedValue method_clearRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlmethod object QtQuick::Context2D::clearRect(real x, real y, real w, real h)
static QV4::ReturnedValue method_set_miterLimit(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_fillRule(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_lineCap(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_textAlign(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_lineJoin(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty string QtQuick::Context2D::lineJoin Holds the current line join style.
static QV4::ReturnedValue method_get_globalCompositeOperation(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty string QtQuick::Context2D::globalCompositeOperation Holds the current the current compos...
static QV4::ReturnedValue method_set_shadowOffsetX(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_fillRule(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty enumeration QtQuick::Context2D::fillRule Holds the current fill rule used for filling sh...
static QV4::ReturnedValue method_set_strokeStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_lineCap(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty string QtQuick::Context2D::lineCap Holds the current line cap style.
static QV4::ReturnedValue method_set_font(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_lineDashOffset(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty real QtQuick::Context2D::lineDashOffset
static QV4::ReturnedValue method_get_textAlign(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty string QtQuick::Context2D::textAlign
static QV4::ReturnedValue method_set_globalAlpha(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_textBaseline(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_lineWidth(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty real QtQuick::Context2D::lineWidth Holds the current line width.
static QV4::ReturnedValue method_set_fillStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_shadowOffsetY(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_font(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty string QtQuick::Context2D::font Holds the current font settings.
static QV4::ReturnedValue method_get_fillStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty variant QtQuick::Context2D::fillStyle Holds the current style used for filling shapes.
static QV4::ReturnedValue method_get_shadowBlur(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty real QtQuick::Context2D::shadowBlur Holds the current level of blur applied to shadows
static QV4::ReturnedValue method_get_shadowOffsetY(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty qreal QtQuick::Context2D::shadowOffsetY Holds the current shadow offset in the positive ...
static QV4::ReturnedValue method_get_miterLimit(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty real QtQuick::Context2D::miterLimit Holds the current miter limit ratio.
static QV4::ReturnedValue method_set_globalCompositeOperation(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_lineDashOffset(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static V4_NEEDS_DESTROY QV4::ReturnedValue method_get_globalAlpha(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty real QtQuick::Context2D::globalAlpha
static QV4::ReturnedValue method_get_shadowColor(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty string QtQuick::Context2D::shadowColor Holds the current shadow color.
static QV4::ReturnedValue method_set_lineWidth(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_shadowColor(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_set_lineJoin(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_strokeStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty variant QtQuick::Context2D::strokeStyle Holds the current color or style to use for the ...
static QV4::ReturnedValue method_set_shadowBlur(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
static QV4::ReturnedValue method_get_textBaseline(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty string QtQuick::Context2D::textBaseline
static QV4::ReturnedValue method_get_shadowOffsetX(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\qmlproperty qreal QtQuick::Context2D::shadowOffsetX Holds the current shadow offset in the positive ...
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
MemoryManager * memoryManager
Heap::String * newString(const QString &s=QString())
String * id_length() const
QV4::ReturnedValue fromVariant(const QVariant &)
Heap::Object * newObject()
Heap::String * newIdentifier(const QString &text)
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
Heap::ArrayObject * newArrayObject(int count=0)
static void markObjects(QV4::Heap::Base *that, QV4::MarkStack *markStack)
QQuickContext2D * context()
void setContext(QQuickContext2D *context)
Heap::InternalClass * internalClass() const
ExecutionEngine * engine() const
bool hasProperty(PropertyKey id) const
static ReturnedValue wrap(ExecutionEngine *engine, QObject *object)
bool hasException() const
QML_NEARLY_ALWAYS_INLINE ReturnedValue asReturnedValue() const
constexpr ReturnedValue asReturnedValue() const
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 value() const
static constexpr VTable::Get virtualGet
static constexpr VTable::Put virtualPut
void mark(MarkStack *markStack)
static constexpr Value fromBoolean(bool b)
static constexpr Value undefinedValue()
static Value fromDouble(double d)
QString toQString() const
QString toQStringNoThrow() const
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent