| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/context2d/qquickcontext2d.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||||||||||||||
| 19 | __attribute__((visibility("default"))) double qstrtod(const char *s00, char const **se, bool *ok); | - | ||||||||||||||||||||||||||||||||||||
| 20 | __attribute__((visibility("default"))) QColor qt_color_from_string(const QV4::Value &name) | - | ||||||||||||||||||||||||||||||||||||
| 21 | { | - | ||||||||||||||||||||||||||||||||||||
| 22 | QByteArray str = name.toQString().toUtf8(); | - | ||||||||||||||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||||||||||||||
| 24 | char *p = str.data(); | - | ||||||||||||||||||||||||||||||||||||
| 25 | int len = str.length(); | - | ||||||||||||||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||||||||||||||
| 27 | if (!p
| 0 | ||||||||||||||||||||||||||||||||||||
| 28 | return never executed: QColor(p);return QColor(p);never executed: return QColor(p); | 0 | ||||||||||||||||||||||||||||||||||||
| 29 | else { | - | ||||||||||||||||||||||||||||||||||||
| 30 | bool isRgb(false), isHsl(false), hasAlpha(false); | - | ||||||||||||||||||||||||||||||||||||
| 31 | (void)isHsl; | - | ||||||||||||||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||||||||||||||
| 33 | while (isspace(*p)
never executed: p++; | 0 | ||||||||||||||||||||||||||||||||||||
| 34 | if (strncmp(p, "rgb", 3) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 35 | isRgb = true; never executed: isRgb = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 36 | else if (strncmp(p, "hsl", 3) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 37 | isHsl = true; never executed: isHsl = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 38 | else | - | ||||||||||||||||||||||||||||||||||||
| 39 | return never executed: QColor(p);return QColor(p);never executed: return QColor(p); | 0 | ||||||||||||||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||||||||||||||
| 41 | p+=3; | - | ||||||||||||||||||||||||||||||||||||
| 42 | hasAlpha = (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||||||||||||||
| 44 | ++p; | - | ||||||||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||||||||
| 46 | if (hasAlpha
never executed: p;++p;never executed: ++p; | 0 | ||||||||||||||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||||||||||||||
| 48 | int rh, gs, bl, alpha = 255; | - | ||||||||||||||||||||||||||||||||||||
| 49 | - | |||||||||||||||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||||||||||||||
| 51 | while (isspace(*p)
never executed: p++; | 0 | ||||||||||||||||||||||||||||||||||||
| 52 | rh = strtol(p, &p, 10); | - | ||||||||||||||||||||||||||||||||||||
| 53 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 54 | rh = qRound(rh/100.0 * 255); | - | ||||||||||||||||||||||||||||||||||||
| 55 | ++p; | - | ||||||||||||||||||||||||||||||||||||
| 56 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 57 | if (*
never executed: QColor();return QColor();never executed: return QColor(); | 0 | ||||||||||||||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||||||||||||||
| 60 | while (isspace(*p)
never executed: p++; | 0 | ||||||||||||||||||||||||||||||||||||
| 61 | gs = strtol(p, &p, 10); | - | ||||||||||||||||||||||||||||||||||||
| 62 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 63 | gs = qRound(gs/100.0 * 255); | - | ||||||||||||||||||||||||||||||||||||
| 64 | ++p; | - | ||||||||||||||||||||||||||||||||||||
| 65 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 66 | if (*
never executed: QColor();return QColor();never executed: return QColor(); | 0 | ||||||||||||||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||||||||||||||
| 68 | - | |||||||||||||||||||||||||||||||||||||
| 69 | while (isspace(*p)
never executed: p++; | 0 | ||||||||||||||||||||||||||||||||||||
| 70 | bl = strtol(p, &p, 10); | - | ||||||||||||||||||||||||||||||||||||
| 71 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 72 | bl = qRound(bl/100.0 * 255); | - | ||||||||||||||||||||||||||||||||||||
| 73 | ++p; | - | ||||||||||||||||||||||||||||||||||||
| 74 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||||||||||||||
| 76 | if (hasAlpha
| 0 | ||||||||||||||||||||||||||||||||||||
| 77 | if (*
never executed: QColor();return QColor();never executed: return QColor(); | 0 | ||||||||||||||||||||||||||||||||||||
| 78 | while (isspace(*p)
never executed: p++; | 0 | ||||||||||||||||||||||||||||||||||||
| 79 | bool ok = false; | - | ||||||||||||||||||||||||||||||||||||
| 80 | alpha = qRound(qstrtod(p, const_cast<const char **>(&p), &ok) * 255); | - | ||||||||||||||||||||||||||||||||||||
| 81 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||||||||||||||
| 83 | if (*
never executed: QColor();return QColor();never executed: return QColor(); | 0 | ||||||||||||||||||||||||||||||||||||
| 84 | if (isRgb
| 0 | ||||||||||||||||||||||||||||||||||||
| 85 | return never executed: QColor::fromRgba(qRgba(qMin(qMax(rh, 0), 255), qMin(qMax(gs, 0), 255), qMin(qMax(bl, 0), 255), qMin(qMax(alpha, 0), 255)));return QColor::fromRgba(qRgba(qMin(qMax(rh, 0), 255), qMin(qMax(gs, 0), 255), qMin(qMax(bl, 0), 255), qMin(qMax(alpha, 0), 255)));never executed: return QColor::fromRgba(qRgba(qMin(qMax(rh, 0), 255), qMin(qMax(gs, 0), 255), qMin(qMax(bl, 0), 255), qMin(qMax(alpha, 0), 255))); | 0 | ||||||||||||||||||||||||||||||||||||
| 86 | else if (isHsl
| 0 | ||||||||||||||||||||||||||||||||||||
| 87 | return never executed: QColor::fromHsl(qMin(qMax(rh, 0), 359), qMin(qMax(gs, 0), 255), qMin(qMax(bl, 0), 255), qMin(qMax(alpha, 0), 255));return QColor::fromHsl(qMin(qMax(rh, 0), 359), qMin(qMax(gs, 0), 255), qMin(qMax(bl, 0), 255), qMin(qMax(alpha, 0), 255));never executed: return QColor::fromHsl(qMin(qMax(rh, 0), 359), qMin(qMax(gs, 0), 255), qMin(qMax(bl, 0), 255), qMin(qMax(alpha, 0), 255)); | 0 | ||||||||||||||||||||||||||||||||||||
| 88 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 89 | return never executed: QColor();return QColor();never executed: return QColor(); | 0 | ||||||||||||||||||||||||||||||||||||
| 90 | } | - | ||||||||||||||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||||||||||||||
| 92 | static int qParseFontSizeFromToken(const QStringRef &fontSizeToken, bool &ok) | - | ||||||||||||||||||||||||||||||||||||
| 93 | { | - | ||||||||||||||||||||||||||||||||||||
| 94 | ok = false; | - | ||||||||||||||||||||||||||||||||||||
| 95 | float size = fontSizeToken.trimmed().toFloat(&ok); | - | ||||||||||||||||||||||||||||||||||||
| 96 | if (ok
| 0 | ||||||||||||||||||||||||||||||||||||
| 97 | return never executed: int(size);return int(size);never executed: return int(size); | 0 | ||||||||||||||||||||||||||||||||||||
| 98 | } | - | ||||||||||||||||||||||||||||||||||||
| 99 | QMessageLogger(__FILE__, 219, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: A font size of " << fontSizeToken << " is invalid."; | - | ||||||||||||||||||||||||||||||||||||
| 100 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 101 | } | - | ||||||||||||||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||||||||||||||
| 108 | static bool qSetFontSizeFromToken(QFont &font, const QStringRef &fontSizeToken) | - | ||||||||||||||||||||||||||||||||||||
| 109 | { | - | ||||||||||||||||||||||||||||||||||||
| 110 | const QStringRef trimmedToken = fontSizeToken.trimmed(); | - | ||||||||||||||||||||||||||||||||||||
| 111 | const QStringRef unitStr = trimmedToken.right(2); | - | ||||||||||||||||||||||||||||||||||||
| 112 | const QStringRef value = trimmedToken.left(trimmedToken.size() - 2); | - | ||||||||||||||||||||||||||||||||||||
| 113 | bool ok = false; | - | ||||||||||||||||||||||||||||||||||||
| 114 | int size = 0; | - | ||||||||||||||||||||||||||||||||||||
| 115 | if (unitStr == QLatin1String("px")
| 0 | ||||||||||||||||||||||||||||||||||||
| 116 | size = qParseFontSizeFromToken(value, ok); | - | ||||||||||||||||||||||||||||||||||||
| 117 | if (ok
| 0 | ||||||||||||||||||||||||||||||||||||
| 118 | font.setPixelSize(size); | - | ||||||||||||||||||||||||||||||||||||
| 119 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 120 | } | - | ||||||||||||||||||||||||||||||||||||
| 121 | } never executed: else if (unitStr == QLatin1String("pt")end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 122 | size = qParseFontSizeFromToken(value, ok); | - | ||||||||||||||||||||||||||||||||||||
| 123 | if (ok
| 0 | ||||||||||||||||||||||||||||||||||||
| 124 | font.setPointSize(size); | - | ||||||||||||||||||||||||||||||||||||
| 125 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 126 | } | - | ||||||||||||||||||||||||||||||||||||
| 127 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 128 | QMessageLogger(__FILE__, 248, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Invalid font size unit in font string."; | - | ||||||||||||||||||||||||||||||||||||
| 129 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 130 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 131 | } | - | ||||||||||||||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||||||||||||||
| 136 | - | |||||||||||||||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||||||||||||||
| 138 | static QStringList qExtractFontFamiliesFromString(const QStringRef &fontFamiliesString) | - | ||||||||||||||||||||||||||||||||||||
| 139 | { | - | ||||||||||||||||||||||||||||||||||||
| 140 | QStringList extractedFamilies; | - | ||||||||||||||||||||||||||||||||||||
| 141 | int quoteIndex = -1; | - | ||||||||||||||||||||||||||||||||||||
| 142 | QString currentFamily; | - | ||||||||||||||||||||||||||||||||||||
| 143 | for (int index = 0; index < fontFamiliesString.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 144 | const QChar ch = fontFamiliesString.at(index); | - | ||||||||||||||||||||||||||||||||||||
| 145 | if (ch == '"'
| 0 | ||||||||||||||||||||||||||||||||||||
| 146 | if (quoteIndex == -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 147 | quoteIndex = index; | - | ||||||||||||||||||||||||||||||||||||
| 148 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 149 | if (ch == fontFamiliesString.at(quoteIndex)
| 0 | ||||||||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||||||||
| 151 | const QString family = fontFamiliesString.mid(quoteIndex + 1, index - quoteIndex - 1).toString(); | - | ||||||||||||||||||||||||||||||||||||
| 152 | extractedFamilies.push_back(family); | - | ||||||||||||||||||||||||||||||||||||
| 153 | currentFamily.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 154 | quoteIndex = -1; | - | ||||||||||||||||||||||||||||||||||||
| 155 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 156 | QMessageLogger(__FILE__, 276, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Mismatched quote in font string."; | - | ||||||||||||||||||||||||||||||||||||
| 157 | return never executed: QStringList();return QStringList();never executed: return QStringList(); | 0 | ||||||||||||||||||||||||||||||||||||
| 158 | } | - | ||||||||||||||||||||||||||||||||||||
| 159 | } | - | ||||||||||||||||||||||||||||||||||||
| 160 | } else if (ch == ' '
| 0 | ||||||||||||||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||||||||||||||
| 162 | if (!currentFamily.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||||||||||||||
| 164 | extractedFamilies.push_back(currentFamily); | - | ||||||||||||||||||||||||||||||||||||
| 165 | currentFamily.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 166 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 167 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 168 | currentFamily.push_back(ch); | - | ||||||||||||||||||||||||||||||||||||
| 169 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 170 | } | - | ||||||||||||||||||||||||||||||||||||
| 171 | if (!currentFamily.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 172 | if (quoteIndex == -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||||||||
| 174 | extractedFamilies.push_back(currentFamily); | - | ||||||||||||||||||||||||||||||||||||
| 175 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 176 | QMessageLogger(__FILE__, 296, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Unclosed quote in font string."; | - | ||||||||||||||||||||||||||||||||||||
| 177 | return never executed: QStringList();return QStringList();never executed: return QStringList(); | 0 | ||||||||||||||||||||||||||||||||||||
| 178 | } | - | ||||||||||||||||||||||||||||||||||||
| 179 | } | - | ||||||||||||||||||||||||||||||||||||
| 180 | if (extractedFamilies.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 181 | QMessageLogger(__FILE__, 301, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Missing or misplaced font family in font string" | - | ||||||||||||||||||||||||||||||||||||
| 182 | << " (it must come after the font size)."; | - | ||||||||||||||||||||||||||||||||||||
| 183 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 184 | return never executed: extractedFamilies;return extractedFamilies;never executed: return extractedFamilies; | 0 | ||||||||||||||||||||||||||||||||||||
| 185 | } | - | ||||||||||||||||||||||||||||||||||||
| 186 | static bool qSetFontFamilyFromTokens(QFont &font, const QStringList &fontFamilyTokens) | - | ||||||||||||||||||||||||||||||||||||
| 187 | { | - | ||||||||||||||||||||||||||||||||||||
| 188 | for (const QString &fontFamilyToken : fontFamilyTokens) { | - | ||||||||||||||||||||||||||||||||||||
| 189 | QFontDatabase fontDatabase; | - | ||||||||||||||||||||||||||||||||||||
| 190 | if (fontDatabase.hasFamily(fontFamilyToken)
| 0 | ||||||||||||||||||||||||||||||||||||
| 191 | font.setFamily(fontFamilyToken); | - | ||||||||||||||||||||||||||||||||||||
| 192 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 193 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||||||||||||||
| 196 | int styleHint = -1; | - | ||||||||||||||||||||||||||||||||||||
| 197 | if (fontFamilyToken.compare(QLatin1String("serif")) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 198 | styleHint = QFont::Serif; | - | ||||||||||||||||||||||||||||||||||||
| 199 | } never executed: else if (fontFamilyToken.compare(QLatin1String("sans-serif")) == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 200 | styleHint = QFont::SansSerif; | - | ||||||||||||||||||||||||||||||||||||
| 201 | } never executed: else if (fontFamilyToken.compare(QLatin1String("cursive")) == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 202 | styleHint = QFont::Cursive; | - | ||||||||||||||||||||||||||||||||||||
| 203 | } never executed: else if (fontFamilyToken.compare(QLatin1String("monospace")) == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 204 | styleHint = QFont::Monospace; | - | ||||||||||||||||||||||||||||||||||||
| 205 | } never executed: else if (fontFamilyToken.compare(QLatin1String("fantasy")) == 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 206 | styleHint = QFont::Fantasy; | - | ||||||||||||||||||||||||||||||||||||
| 207 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 208 | if (styleHint != -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 209 | QFont tmp; | - | ||||||||||||||||||||||||||||||||||||
| 210 | tmp.setStyleHint(static_cast<QFont::StyleHint>(styleHint)); | - | ||||||||||||||||||||||||||||||||||||
| 211 | font.setFamily(tmp.defaultFamily()); | - | ||||||||||||||||||||||||||||||||||||
| 212 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 213 | } | - | ||||||||||||||||||||||||||||||||||||
| 214 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 215 | } | - | ||||||||||||||||||||||||||||||||||||
| 216 | QMessageLogger(__FILE__, 346, __PRETTY_FUNCTION__).warning("Context2D: The font families specified are invalid: %s", QtPrivate::asString(fontFamilyTokens.join(QString()).trimmed()).toLocal8Bit().constData()); | - | ||||||||||||||||||||||||||||||||||||
| 217 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 218 | } | - | ||||||||||||||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||||||||||||||
| 220 | enum FontToken | - | ||||||||||||||||||||||||||||||||||||
| 221 | { | - | ||||||||||||||||||||||||||||||||||||
| 222 | NoTokens = 0x00, | - | ||||||||||||||||||||||||||||||||||||
| 223 | FontStyle = 0x01, | - | ||||||||||||||||||||||||||||||||||||
| 224 | FontVariant = 0x02, | - | ||||||||||||||||||||||||||||||||||||
| 225 | FontWeight = 0x04 | - | ||||||||||||||||||||||||||||||||||||
| 226 | }; | - | ||||||||||||||||||||||||||||||||||||
| 227 | static QFont qt_font_from_string(const QString& fontString, const QFont ¤tFont) { | - | ||||||||||||||||||||||||||||||||||||
| 228 | if (fontString.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 229 | QMessageLogger(__FILE__, 374, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Font string is empty."; | - | ||||||||||||||||||||||||||||||||||||
| 230 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 231 | } | - | ||||||||||||||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||||||||||||||
| 235 | int fontSizeEnd = fontString.indexOf(QLatin1String("px")); | - | ||||||||||||||||||||||||||||||||||||
| 236 | if (fontSizeEnd == -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 237 | fontSizeEnd = fontString.indexOf(QLatin1String("pt")); never executed: fontSizeEnd = fontString.indexOf(QLatin1String("pt")); | 0 | ||||||||||||||||||||||||||||||||||||
| 238 | if (fontSizeEnd == -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 239 | QMessageLogger(__FILE__, 384, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Invalid font size unit in font string."; | - | ||||||||||||||||||||||||||||||||||||
| 240 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 241 | } | - | ||||||||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||||||||
| 243 | int fontSizeStart = fontString.lastIndexOf(' ', fontSizeEnd); | - | ||||||||||||||||||||||||||||||||||||
| 244 | if (fontSizeStart == -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||||||||||||||
| 246 | - | |||||||||||||||||||||||||||||||||||||
| 247 | fontSizeStart = 0; | - | ||||||||||||||||||||||||||||||||||||
| 248 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||||||||||||||
| 250 | ++fontSizeStart; | - | ||||||||||||||||||||||||||||||||||||
| 251 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||||||||||||||
| 253 | - | |||||||||||||||||||||||||||||||||||||
| 254 | fontSizeEnd += 3; | - | ||||||||||||||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||||||||||||||
| 256 | QFont newFont; | - | ||||||||||||||||||||||||||||||||||||
| 257 | if (!qSetFontSizeFromToken(newFont, fontString.midRef(fontSizeStart, fontSizeEnd - fontSizeStart))
| 0 | ||||||||||||||||||||||||||||||||||||
| 258 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||||||||||||||
| 261 | QString remainingFontString = fontString; | - | ||||||||||||||||||||||||||||||||||||
| 262 | remainingFontString.remove(fontSizeStart, fontSizeEnd - fontSizeStart); | - | ||||||||||||||||||||||||||||||||||||
| 263 | QStringRef remainingFontStringRef(&remainingFontString); | - | ||||||||||||||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||||||||||||||
| 266 | const QStringRef fontFamiliesString = remainingFontStringRef.mid(fontSizeStart); | - | ||||||||||||||||||||||||||||||||||||
| 267 | remainingFontStringRef.truncate(fontSizeStart); | - | ||||||||||||||||||||||||||||||||||||
| 268 | QStringList fontFamilies = qExtractFontFamiliesFromString(fontFamiliesString); | - | ||||||||||||||||||||||||||||||||||||
| 269 | if (fontFamilies.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 270 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 271 | } | - | ||||||||||||||||||||||||||||||||||||
| 272 | if (!qSetFontFamilyFromTokens(newFont, fontFamilies)
| 0 | ||||||||||||||||||||||||||||||||||||
| 273 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||||||||||||||
| 276 | const QStringRef trimmedTokensStr = remainingFontStringRef.trimmed(); | - | ||||||||||||||||||||||||||||||||||||
| 277 | if (trimmedTokensStr.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||||||||||||||
| 279 | return never executed: newFont;return newFont;never executed: return newFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 280 | } | - | ||||||||||||||||||||||||||||||||||||
| 281 | const auto tokens = trimmedTokensStr.split(QLatin1Char(' ')); | - | ||||||||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||||||||
| 283 | int usedTokens = NoTokens; | - | ||||||||||||||||||||||||||||||||||||
| 284 | - | |||||||||||||||||||||||||||||||||||||
| 285 | for (const QStringRef &token : tokens) { | - | ||||||||||||||||||||||||||||||||||||
| 286 | if (token.compare(QLatin1String("normal")) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 287 | if (!(usedTokens & FontStyle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||||||||||||||
| 289 | if (!(usedTokens & FontStyle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||||||||||||||
| 291 | usedTokens = usedTokens | FontStyle; | - | ||||||||||||||||||||||||||||||||||||
| 292 | } never executed: else if (!(usedTokens & FontVariant)end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||||||||||||||
| 294 | usedTokens |= FontVariant; | - | ||||||||||||||||||||||||||||||||||||
| 295 | } never executed: else if (!(usedTokens & FontWeight)end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||||||||||||||
| 297 | usedTokens |= FontWeight; | - | ||||||||||||||||||||||||||||||||||||
| 298 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 299 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 300 | QMessageLogger(__FILE__, 445, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Duplicate token \"normal\" found in font string."; | - | ||||||||||||||||||||||||||||||||||||
| 301 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 302 | } | - | ||||||||||||||||||||||||||||||||||||
| 303 | } else if (token.compare(QLatin1String("bold")) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 304 | if (!(usedTokens & FontWeight)
never executed: else { QMessageLogger(__FILE__, 449, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Duplicate token " << QLatin1String("bold") << " found in font string."; returnend of blocknever executed: currentFont;return currentFont;never executed: }return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 305 | } else if (token.compare(QLatin1String("italic")) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 306 | if (!(usedTokens & FontStyle)
never executed: else { QMessageLogger(__FILE__, 451, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Duplicate token " << QLatin1String("italic") << " found in font string."; returnend of blocknever executed: currentFont;return currentFont;never executed: }return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 307 | } else if (token.compare(QLatin1String("oblique")) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 308 | if (!(usedTokens & FontStyle)
never executed: else { QMessageLogger(__FILE__, 453, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Duplicate token " << QLatin1String("oblique") << " found in font string."; returnend of blocknever executed: currentFont;return currentFont;never executed: }return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 309 | } else if (token.compare(QLatin1String("small-caps")) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 310 | if (!(usedTokens & FontVariant)
never executed: else { QMessageLogger(__FILE__, 455, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Duplicate token " << QLatin1String("small-caps") << " found in font string."; returnend of blocknever executed: currentFont;return currentFont;never executed: }return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 311 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 312 | bool conversionOk = false; | - | ||||||||||||||||||||||||||||||||||||
| 313 | int weight = token.toInt(&conversionOk); | - | ||||||||||||||||||||||||||||||||||||
| 314 | if (conversionOk
| 0 | ||||||||||||||||||||||||||||||||||||
| 315 | if (weight >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 316 | if (!(usedTokens & FontWeight)
never executed: else { QMessageLogger(__FILE__, 461, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Duplicate token " << QLatin1String("<font-weight>") << " found in font string."; returnend of blocknever executed: currentFont;return currentFont;never executed: }return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 317 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 318 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 319 | QMessageLogger(__FILE__, 464, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Invalid font weight " << weight << " found in font string; " | - | ||||||||||||||||||||||||||||||||||||
| 320 | << "must be between 0 and 99, inclusive."; | - | ||||||||||||||||||||||||||||||||||||
| 321 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 322 | } | - | ||||||||||||||||||||||||||||||||||||
| 323 | } | - | ||||||||||||||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||||||||||||||
| 325 | QMessageLogger(__FILE__, 470, __PRETTY_FUNCTION__).warning().nospace() << "Context2D: Invalid or misplaced token " << token << " found in font string."; | - | ||||||||||||||||||||||||||||||||||||
| 326 | return never executed: currentFont;return currentFont;never executed: return currentFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 327 | } | - | ||||||||||||||||||||||||||||||||||||
| 328 | } | - | ||||||||||||||||||||||||||||||||||||
| 329 | return never executed: newFont;return newFont;never executed: return newFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 330 | } | - | ||||||||||||||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||||||||||||||
| 332 | class QQuickContext2DEngineData : public QV8Engine::Deletable | - | ||||||||||||||||||||||||||||||||||||
| 333 | { | - | ||||||||||||||||||||||||||||||||||||
| 334 | public: | - | ||||||||||||||||||||||||||||||||||||
| 335 | QQuickContext2DEngineData(QV4::ExecutionEngine *engine); | - | ||||||||||||||||||||||||||||||||||||
| 336 | ~QQuickContext2DEngineData(); | - | ||||||||||||||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||||||||||||||
| 338 | QV4::PersistentValue contextPrototype; | - | ||||||||||||||||||||||||||||||||||||
| 339 | QV4::PersistentValue gradientProto; | - | ||||||||||||||||||||||||||||||||||||
| 340 | QV4::PersistentValue pixelArrayProto; | - | ||||||||||||||||||||||||||||||||||||
| 341 | }; | - | ||||||||||||||||||||||||||||||||||||
| 342 | - | |||||||||||||||||||||||||||||||||||||
| 343 | static inline QQuickContext2DEngineData *engineData(QV4::ExecutionEngine *engine) { static int extensionId = -1; if (extensionId == -1
never executed: QV8Engine::registrationMutex()->unlock(); }extensionId = QV8Engine::registerExtension();never executed: QQuickContext2DEngineData *rv = (QQuickContext2DEngineData *)engine->v8Engine->extensionData(extensionId); if (!rvend of block
never executed: returnend of blocknever executed: rv;return rv;never executed: }return rv; | 0 | ||||||||||||||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||||||||||||||
| 345 | namespace QV4 { | - | ||||||||||||||||||||||||||||||||||||
| 346 | namespace Heap { | - | ||||||||||||||||||||||||||||||||||||
| 347 | - | |||||||||||||||||||||||||||||||||||||
| 348 | struct QQuickJSContext2D : Object { | - | ||||||||||||||||||||||||||||||||||||
| 349 | void init() { Object::init(); } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 350 | QQuickContext2D* context; | - | ||||||||||||||||||||||||||||||||||||
| 351 | }; | - | ||||||||||||||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||||||||||||||
| 353 | struct QQuickJSContext2DPrototype : Object { | - | ||||||||||||||||||||||||||||||||||||
| 354 | void init() { Object::init(); } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 355 | }; | - | ||||||||||||||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||||||||||||||
| 357 | struct QQuickContext2DStyle : Object { | - | ||||||||||||||||||||||||||||||||||||
| 358 | void init() | - | ||||||||||||||||||||||||||||||||||||
| 359 | { | - | ||||||||||||||||||||||||||||||||||||
| 360 | brush = new QBrush; | - | ||||||||||||||||||||||||||||||||||||
| 361 | patternRepeatX = false; | - | ||||||||||||||||||||||||||||||||||||
| 362 | patternRepeatY = false; | - | ||||||||||||||||||||||||||||||||||||
| 363 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 364 | void destroy() { | - | ||||||||||||||||||||||||||||||||||||
| 365 | delete brush; | - | ||||||||||||||||||||||||||||||||||||
| 366 | Object::destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 367 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||||||||||||||
| 369 | QBrush *brush; | - | ||||||||||||||||||||||||||||||||||||
| 370 | bool patternRepeatX:1; | - | ||||||||||||||||||||||||||||||||||||
| 371 | bool patternRepeatY:1; | - | ||||||||||||||||||||||||||||||||||||
| 372 | }; | - | ||||||||||||||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||||||||||||||
| 374 | struct QQuickJSContext2DPixelData : Object { | - | ||||||||||||||||||||||||||||||||||||
| 375 | void init(); | - | ||||||||||||||||||||||||||||||||||||
| 376 | void destroy() { | - | ||||||||||||||||||||||||||||||||||||
| 377 | delete image; | - | ||||||||||||||||||||||||||||||||||||
| 378 | Object::destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 379 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||||||||||||||
| 381 | QImage *image; | - | ||||||||||||||||||||||||||||||||||||
| 382 | }; | - | ||||||||||||||||||||||||||||||||||||
| 383 | - | |||||||||||||||||||||||||||||||||||||
| 384 | struct QQuickJSContext2DImageData : Object { | - | ||||||||||||||||||||||||||||||||||||
| 385 | void init(); | - | ||||||||||||||||||||||||||||||||||||
| 386 | - | |||||||||||||||||||||||||||||||||||||
| 387 | static void markObjects(QV4::Heap::Base *that, QV4::MarkStack *markStack) { | - | ||||||||||||||||||||||||||||||||||||
| 388 | static_cast<QQuickJSContext2DImageData *>(that)->pixelData.mark(markStack); | - | ||||||||||||||||||||||||||||||||||||
| 389 | Object::markObjects(that, markStack); | - | ||||||||||||||||||||||||||||||||||||
| 390 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||||||||||||||
| 392 | QV4::Value pixelData; | - | ||||||||||||||||||||||||||||||||||||
| 393 | }; | - | ||||||||||||||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||||||||||||||
| 395 | } | - | ||||||||||||||||||||||||||||||||||||
| 396 | } | - | ||||||||||||||||||||||||||||||||||||
| 397 | - | |||||||||||||||||||||||||||||||||||||
| 398 | struct QQuickJSContext2D : public QV4::Object | - | ||||||||||||||||||||||||||||||||||||
| 399 | { | - | ||||||||||||||||||||||||||||||||||||
| 400 | private: QQuickJSContext2D() = delete; QQuickJSContext2D(const QQuickJSContext2D &) = delete; QQuickJSContext2D &operator=(const QQuickJSContext2D &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::QQuickJSContext2D Data; typedef QV4::Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blocknever executed: &static_vtbl;return &static_vtbl;never executed: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;never executed: QV4::Heap::QQuickJSContext2D *d_unchecked() const { returnend of blocknever executed: static_cast<QV4::Heap::QQuickJSContext2D *>(m());return static_cast<QV4::Heap::QQuickJSContext2D *>(m());never executed: } QV4::Heap::QQuickJSContext2D *d() const { QV4::Heap::QQuickJSContext2D *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::QQuickJSContext2D *>(m());never executed: dptr;return dptr;never executed: } static_assert(bool(std::is_trivial< QV4::Heap::QQuickJSContext2D >::value), "std::is_trivial< QV4::Heap::QQuickJSContext2D >::value");return dptr; | 0 | ||||||||||||||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||||||||||||||
| 402 | static QV4::ReturnedValue method_get_globalAlpha(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 403 | static QV4::ReturnedValue method_set_globalAlpha(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 404 | static QV4::ReturnedValue method_get_globalCompositeOperation(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 405 | static QV4::ReturnedValue method_set_globalCompositeOperation(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 406 | static QV4::ReturnedValue method_get_fillStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 407 | static QV4::ReturnedValue method_set_fillStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 408 | static QV4::ReturnedValue method_get_fillRule(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 409 | static QV4::ReturnedValue method_set_fillRule(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 410 | static QV4::ReturnedValue method_get_strokeStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 411 | static QV4::ReturnedValue method_set_strokeStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 412 | - | |||||||||||||||||||||||||||||||||||||
| 413 | static QV4::ReturnedValue method_get_lineCap(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 414 | static QV4::ReturnedValue method_set_lineCap(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 415 | static QV4::ReturnedValue method_get_lineJoin(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 416 | static QV4::ReturnedValue method_set_lineJoin(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 417 | static QV4::ReturnedValue method_get_lineWidth(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 418 | static QV4::ReturnedValue method_set_lineWidth(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 419 | static QV4::ReturnedValue method_get_miterLimit(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 420 | static QV4::ReturnedValue method_set_miterLimit(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||||||||||||||
| 422 | static QV4::ReturnedValue method_get_shadowBlur(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 423 | static QV4::ReturnedValue method_set_shadowBlur(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 424 | static QV4::ReturnedValue method_get_shadowColor(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 425 | static QV4::ReturnedValue method_set_shadowColor(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 426 | static QV4::ReturnedValue method_get_shadowOffsetX(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 427 | static QV4::ReturnedValue method_set_shadowOffsetX(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 428 | static QV4::ReturnedValue method_get_shadowOffsetY(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 429 | static QV4::ReturnedValue method_set_shadowOffsetY(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 430 | - | |||||||||||||||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||||||||||||||
| 433 | static QV4::ReturnedValue method_get_path(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 434 | static QV4::ReturnedValue method_set_path(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||||||||||||||
| 436 | static QV4::ReturnedValue method_get_font(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 437 | static QV4::ReturnedValue method_set_font(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 438 | static QV4::ReturnedValue method_get_textAlign(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 439 | static QV4::ReturnedValue method_set_textAlign(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 440 | static QV4::ReturnedValue method_get_textBaseline(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 441 | static QV4::ReturnedValue method_set_textBaseline(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 442 | }; | - | ||||||||||||||||||||||||||||||||||||
| 443 | - | |||||||||||||||||||||||||||||||||||||
| 444 | const QV4::VTable QQuickJSContext2D::static_vtbl = { (std::is_same<QQuickJSContext2D::SuperClass, Object>::value) ? nullptr : &QQuickJSContext2D::SuperClass::static_vtbl, (sizeof(QQuickJSContext2D::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQuickJSContext2D::Data) + (QQuickJSContext2D::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQuickJSContext2D::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQuickJSContext2D::IsExecutionContext, QQuickJSContext2D::IsString, QQuickJSContext2D::IsObject, QQuickJSContext2D::IsFunctionObject, QQuickJSContext2D::IsErrorObject, QQuickJSContext2D::IsArrayData, QQuickJSContext2D::IsStringOrSymbol, QQuickJSContext2D::MyType, { 0, 0, 0, 0 }, "QQuickJSContext2D", QQuickJSContext2D::virtualDestroy, QQuickJSContext2D::Data::markObjects, QQuickJSContext2D::virtualIsEqualTo, QQuickJSContext2D::virtualGet, QQuickJSContext2D::virtualPut, QQuickJSContext2D::virtualDeleteProperty, QQuickJSContext2D::virtualHasProperty, QQuickJSContext2D::virtualGetOwnProperty, QQuickJSContext2D::virtualDefineOwnProperty, QQuickJSContext2D::virtualIsExtensible, QQuickJSContext2D::virtualPreventExtensions, QQuickJSContext2D::virtualGetPrototypeOf, QQuickJSContext2D::virtualSetPrototypeOf, QQuickJSContext2D::virtualGetLength, QQuickJSContext2D::virtualAdvanceIterator, QQuickJSContext2D::virtualInstanceOf, QQuickJSContext2D::virtualCall, QQuickJSContext2D::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||||||||||||||
| 447 | struct QQuickJSContext2DPrototype : public QV4::Object | - | ||||||||||||||||||||||||||||||||||||
| 448 | { | - | ||||||||||||||||||||||||||||||||||||
| 449 | private: QQuickJSContext2DPrototype() = delete; QQuickJSContext2DPrototype(const QQuickJSContext2DPrototype &) = delete; QQuickJSContext2DPrototype &operator=(const QQuickJSContext2DPrototype &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::QQuickJSContext2DPrototype Data; typedef QV4::Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blocknever executed: &static_vtbl;return &static_vtbl;never executed: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;never executed: QV4::Heap::QQuickJSContext2DPrototype *d_unchecked() const { returnend of blocknever executed: static_cast<QV4::Heap::QQuickJSContext2DPrototype *>(m());return static_cast<QV4::Heap::QQuickJSContext2DPrototype *>(m());never executed: } QV4::Heap::QQuickJSContext2DPrototype *d() const { QV4::Heap::QQuickJSContext2DPrototype *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::QQuickJSContext2DPrototype *>(m());never executed: dptr;return dptr;never executed: } static_assert(bool(std::is_trivial< QV4::Heap::QQuickJSContext2DPrototype >::value), "std::is_trivial< QV4::Heap::QQuickJSContext2DPrototype >::value");return dptr; | 0 | ||||||||||||||||||||||||||||||||||||
| 450 | public: | - | ||||||||||||||||||||||||||||||||||||
| 451 | static QV4::Heap::QQuickJSContext2DPrototype *create(QV4::ExecutionEngine *engine) | - | ||||||||||||||||||||||||||||||||||||
| 452 | { | - | ||||||||||||||||||||||||||||||||||||
| 453 | QV4::Scope scope(engine); | - | ||||||||||||||||||||||||||||||||||||
| 454 | QV4::Scoped<QQuickJSContext2DPrototype> o(scope, engine->memoryManager->allocate<QQuickJSContext2DPrototype>()); | - | ||||||||||||||||||||||||||||||||||||
| 455 | - | |||||||||||||||||||||||||||||||||||||
| 456 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "quadraticCurveTo")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "quadraticCurveTo" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_quadraticCurveTo, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 457 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "restore")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "restore" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_restore, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 458 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "moveTo")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "moveTo" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_moveTo, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 459 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "lineTo")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "lineTo" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_lineTo, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 460 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "caretBlinkRate")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "caretBlinkRate" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_caretBlinkRate, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 461 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "clip")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "clip" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_clip, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 462 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setTransform")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setTransform" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_setTransform, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 463 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "text")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "text" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_text, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 464 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "roundedRect")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "roundedRect" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_roundedRect, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 465 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "createPattern")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createPattern" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_createPattern, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 466 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "stroke")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "stroke" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_stroke, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 467 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "arc")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arc" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_arc, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 468 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "createImageData")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createImageData" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_createImageData, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 469 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "measureText")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "measureText" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_measureText, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 470 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "ellipse")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ellipse" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_ellipse, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 471 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fill")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fill" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_fill, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 472 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "save")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "save" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_save, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 473 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "scale")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "scale" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_scale, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 474 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawImage")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawImage" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_drawImage, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 475 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "transform")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "transform" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_transform, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 476 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fillText")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fillText" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_fillText, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 477 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "strokeText")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "strokeText" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_strokeText, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 478 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "translate")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "translate" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_translate, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 479 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "createRadialGradient")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createRadialGradient" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_createRadialGradient, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 480 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "shear")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "shear" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_shear, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 481 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "isPointInPath")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "isPointInPath" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_isPointInPath, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 482 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "bezierCurveTo")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bezierCurveTo" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_bezierCurveTo, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 483 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "resetTransform")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "resetTransform" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_resetTransform, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 484 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "arcTo")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arcTo" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_arcTo, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 485 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fillRect")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fillRect" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_fillRect, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 486 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "createConicalGradient")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createConicalGradient" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_createConicalGradient, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 487 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawFocusRing")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawFocusRing" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_drawFocusRing, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 488 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "beginPath")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "beginPath" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_beginPath, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 489 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "clearRect")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "clearRect" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_clearRect, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 490 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "rect")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "rect" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_rect, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 491 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "reset")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "reset" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_reset, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 492 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "rotate")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "rotate" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_rotate, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 493 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setCaretSelectionRect")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setCaretSelectionRect" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_setCaretSelectionRect, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 494 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "putImageData")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "putImageData" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_putImageData, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 495 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getImageData")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getImageData" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_getImageData, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 496 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "createLinearGradient")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createLinearGradient" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_createLinearGradient, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 497 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "strokeRect")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "strokeRect" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_strokeRect, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 498 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "closePath")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "closePath" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), method_closePath, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 499 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "canvas")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "canvas" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2DPrototype::method_get_canvas, nullptr);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||||||||||||||
| 501 | return never executed: o->d();return o->d();never executed: return o->d(); | 0 | ||||||||||||||||||||||||||||||||||||
| 502 | } | - | ||||||||||||||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||||||||||||||
| 504 | static QV4::ReturnedValue method_get_canvas(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 505 | static QV4::ReturnedValue method_restore(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 506 | static QV4::ReturnedValue method_reset(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 507 | static QV4::ReturnedValue method_save(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 508 | static QV4::ReturnedValue method_rotate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 509 | static QV4::ReturnedValue method_scale(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 510 | static QV4::ReturnedValue method_translate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 511 | static QV4::ReturnedValue method_setTransform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 512 | static QV4::ReturnedValue method_transform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 513 | static QV4::ReturnedValue method_resetTransform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 514 | static QV4::ReturnedValue method_shear(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 515 | static QV4::ReturnedValue method_createLinearGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 516 | static QV4::ReturnedValue method_createRadialGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 517 | static QV4::ReturnedValue method_createConicalGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 518 | static QV4::ReturnedValue method_createPattern(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 519 | static QV4::ReturnedValue method_clearRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 520 | static QV4::ReturnedValue method_fillRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 521 | static QV4::ReturnedValue method_strokeRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 522 | static QV4::ReturnedValue method_arc(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 523 | static QV4::ReturnedValue method_arcTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 524 | static QV4::ReturnedValue method_beginPath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 525 | static QV4::ReturnedValue method_bezierCurveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 526 | static QV4::ReturnedValue method_clip(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 527 | static QV4::ReturnedValue method_closePath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 528 | static QV4::ReturnedValue method_fill(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 529 | static QV4::ReturnedValue method_lineTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 530 | static QV4::ReturnedValue method_moveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 531 | static QV4::ReturnedValue method_quadraticCurveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 532 | static QV4::ReturnedValue method_rect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 533 | static QV4::ReturnedValue method_roundedRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 534 | static QV4::ReturnedValue method_ellipse(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 535 | static QV4::ReturnedValue method_text(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 536 | static QV4::ReturnedValue method_stroke(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 537 | static QV4::ReturnedValue method_isPointInPath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 538 | static QV4::ReturnedValue method_drawFocusRing(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 539 | static QV4::ReturnedValue method_setCaretSelectionRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 540 | static QV4::ReturnedValue method_caretBlinkRate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 541 | static QV4::ReturnedValue method_fillText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 542 | static QV4::ReturnedValue method_strokeText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 543 | static QV4::ReturnedValue method_measureText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 544 | static QV4::ReturnedValue method_drawImage(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 545 | static QV4::ReturnedValue method_createImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 546 | static QV4::ReturnedValue method_getImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 547 | static QV4::ReturnedValue method_putImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 548 | - | |||||||||||||||||||||||||||||||||||||
| 549 | }; | - | ||||||||||||||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||||||||||||||
| 551 | const QV4::VTable QQuickJSContext2DPrototype::static_vtbl = { (std::is_same<QQuickJSContext2DPrototype::SuperClass, Object>::value) ? nullptr : &QQuickJSContext2DPrototype::SuperClass::static_vtbl, (sizeof(QQuickJSContext2DPrototype::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQuickJSContext2DPrototype::Data) + (QQuickJSContext2DPrototype::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQuickJSContext2DPrototype::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQuickJSContext2DPrototype::IsExecutionContext, QQuickJSContext2DPrototype::IsString, QQuickJSContext2DPrototype::IsObject, QQuickJSContext2DPrototype::IsFunctionObject, QQuickJSContext2DPrototype::IsErrorObject, QQuickJSContext2DPrototype::IsArrayData, QQuickJSContext2DPrototype::IsStringOrSymbol, QQuickJSContext2DPrototype::MyType, { 0, 0, 0, 0 }, "QQuickJSContext2DPrototype", QQuickJSContext2DPrototype::virtualDestroy, QQuickJSContext2DPrototype::Data::markObjects, QQuickJSContext2DPrototype::virtualIsEqualTo, QQuickJSContext2DPrototype::virtualGet, QQuickJSContext2DPrototype::virtualPut, QQuickJSContext2DPrototype::virtualDeleteProperty, QQuickJSContext2DPrototype::virtualHasProperty, QQuickJSContext2DPrototype::virtualGetOwnProperty, QQuickJSContext2DPrototype::virtualDefineOwnProperty, QQuickJSContext2DPrototype::virtualIsExtensible, QQuickJSContext2DPrototype::virtualPreventExtensions, QQuickJSContext2DPrototype::virtualGetPrototypeOf, QQuickJSContext2DPrototype::virtualSetPrototypeOf, QQuickJSContext2DPrototype::virtualGetLength, QQuickJSContext2DPrototype::virtualAdvanceIterator, QQuickJSContext2DPrototype::virtualInstanceOf, QQuickJSContext2DPrototype::virtualCall, QQuickJSContext2DPrototype::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||||||||||||||
| 552 | - | |||||||||||||||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||||||||||||||
| 554 | struct QQuickContext2DStyle : public QV4::Object | - | ||||||||||||||||||||||||||||||||||||
| 555 | { | - | ||||||||||||||||||||||||||||||||||||
| 556 | private: QQuickContext2DStyle() = delete; QQuickContext2DStyle(const QQuickContext2DStyle &) = delete; QQuickContext2DStyle &operator=(const QQuickContext2DStyle &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::QQuickContext2DStyle Data; typedef QV4::Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blocknever executed: &static_vtbl;return &static_vtbl;never executed: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;never executed: QV4::Heap::QQuickContext2DStyle *d_unchecked() const { returnend of blocknever executed: static_cast<QV4::Heap::QQuickContext2DStyle *>(m());return static_cast<QV4::Heap::QQuickContext2DStyle *>(m());never executed: } QV4::Heap::QQuickContext2DStyle *d() const { QV4::Heap::QQuickContext2DStyle *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::QQuickContext2DStyle *>(m());never executed: dptr;return dptr;never executed: } static_assert(bool(std::is_trivial< QV4::Heap::QQuickContext2DStyle >::value), "std::is_trivial< QV4::Heap::QQuickContext2DStyle >::value");return dptr; | 0 | ||||||||||||||||||||||||||||||||||||
| 557 | static void virtualDestroy(QV4::Heap::Base *b) { static_cast<Data *>(b)->destroy(); } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||||||||||||||
| 559 | static QV4::ReturnedValue gradient_proto_addColorStop(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 560 | }; | - | ||||||||||||||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||||||||||||||
| 562 | - | |||||||||||||||||||||||||||||||||||||
| 563 | - | |||||||||||||||||||||||||||||||||||||
| 564 | const QV4::VTable QQuickContext2DStyle::static_vtbl = { (std::is_same<QQuickContext2DStyle::SuperClass, Object>::value) ? nullptr : &QQuickContext2DStyle::SuperClass::static_vtbl, (sizeof(QQuickContext2DStyle::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQuickContext2DStyle::Data) + (QQuickContext2DStyle::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQuickContext2DStyle::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQuickContext2DStyle::IsExecutionContext, QQuickContext2DStyle::IsString, QQuickContext2DStyle::IsObject, QQuickContext2DStyle::IsFunctionObject, QQuickContext2DStyle::IsErrorObject, QQuickContext2DStyle::IsArrayData, QQuickContext2DStyle::IsStringOrSymbol, QQuickContext2DStyle::MyType, { 0, 0, 0, 0 }, "QQuickContext2DStyle", QQuickContext2DStyle::virtualDestroy, QQuickContext2DStyle::Data::markObjects, QQuickContext2DStyle::virtualIsEqualTo, QQuickContext2DStyle::virtualGet, QQuickContext2DStyle::virtualPut, QQuickContext2DStyle::virtualDeleteProperty, QQuickContext2DStyle::virtualHasProperty, QQuickContext2DStyle::virtualGetOwnProperty, QQuickContext2DStyle::virtualDefineOwnProperty, QQuickContext2DStyle::virtualIsExtensible, QQuickContext2DStyle::virtualPreventExtensions, QQuickContext2DStyle::virtualGetPrototypeOf, QQuickContext2DStyle::virtualSetPrototypeOf, QQuickContext2DStyle::virtualGetLength, QQuickContext2DStyle::virtualAdvanceIterator, QQuickContext2DStyle::virtualInstanceOf, QQuickContext2DStyle::virtualCall, QQuickContext2DStyle::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||||||||||||||
| 565 | - | |||||||||||||||||||||||||||||||||||||
| 566 | QImage qt_image_convolute_filter(const QImage& src, const QVector<qreal>& weights, int radius = 0) | - | ||||||||||||||||||||||||||||||||||||
| 567 | { | - | ||||||||||||||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||||||||||||||
| 569 | int delta = radius
| 0 | ||||||||||||||||||||||||||||||||||||
| 570 | int filterDim = 2 * delta + 1; | - | ||||||||||||||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||||||||||||||
| 572 | QImage dst = QImage(src.size(), src.format()); | - | ||||||||||||||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||||||||||||||
| 574 | int w = src.width(); | - | ||||||||||||||||||||||||||||||||||||
| 575 | int h = src.height(); | - | ||||||||||||||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||||||||||||||
| 577 | const QRgb *sr = (const QRgb *)(src.constBits()); | - | ||||||||||||||||||||||||||||||||||||
| 578 | int srcStride = src.bytesPerLine() / 4; | - | ||||||||||||||||||||||||||||||||||||
| 579 | - | |||||||||||||||||||||||||||||||||||||
| 580 | QRgb *dr = (QRgb*)dst.bits(); | - | ||||||||||||||||||||||||||||||||||||
| 581 | int dstStride = dst.bytesPerLine() / 4; | - | ||||||||||||||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||||||||||||||
| 583 | for (int y = 0; y < h
| 0 | ||||||||||||||||||||||||||||||||||||
| 584 | for (int x = 0; x < w
| 0 | ||||||||||||||||||||||||||||||||||||
| 585 | int red = 0; | - | ||||||||||||||||||||||||||||||||||||
| 586 | int green = 0; | - | ||||||||||||||||||||||||||||||||||||
| 587 | int blue = 0; | - | ||||||||||||||||||||||||||||||||||||
| 588 | int alpha = 0; | - | ||||||||||||||||||||||||||||||||||||
| 589 | - | |||||||||||||||||||||||||||||||||||||
| 590 | qreal redF = 0; | - | ||||||||||||||||||||||||||||||||||||
| 591 | qreal greenF = 0; | - | ||||||||||||||||||||||||||||||||||||
| 592 | qreal blueF = 0; | - | ||||||||||||||||||||||||||||||||||||
| 593 | qreal alphaF = 0; | - | ||||||||||||||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||||||||||||||
| 595 | int sy = y; | - | ||||||||||||||||||||||||||||||||||||
| 596 | int sx = x; | - | ||||||||||||||||||||||||||||||||||||
| 597 | - | |||||||||||||||||||||||||||||||||||||
| 598 | for (int cy = 0; cy < filterDim
| 0 | ||||||||||||||||||||||||||||||||||||
| 599 | int scy = sy + cy - delta; | - | ||||||||||||||||||||||||||||||||||||
| 600 | - | |||||||||||||||||||||||||||||||||||||
| 601 | if (scy < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 602 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||||||||||||||
| 604 | const QRgb *sry = sr + scy * srcStride; | - | ||||||||||||||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||||||||||||||
| 606 | for (int cx = 0; cx < filterDim
| 0 | ||||||||||||||||||||||||||||||||||||
| 607 | int scx = sx + cx - delta; | - | ||||||||||||||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||||||||||||||
| 609 | if (scx < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 610 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 611 | - | |||||||||||||||||||||||||||||||||||||
| 612 | const QRgb col = sry[scx]; | - | ||||||||||||||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||||||||||||||
| 614 | if (radius
| 0 | ||||||||||||||||||||||||||||||||||||
| 615 | red += qRed(col); | - | ||||||||||||||||||||||||||||||||||||
| 616 | green += qGreen(col); | - | ||||||||||||||||||||||||||||||||||||
| 617 | blue += qBlue(col); | - | ||||||||||||||||||||||||||||||||||||
| 618 | alpha += qAlpha(col); | - | ||||||||||||||||||||||||||||||||||||
| 619 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 620 | qreal wt = weights[cy * filterDim + cx]; | - | ||||||||||||||||||||||||||||||||||||
| 621 | - | |||||||||||||||||||||||||||||||||||||
| 622 | redF += qRed(col) * wt; | - | ||||||||||||||||||||||||||||||||||||
| 623 | greenF += qGreen(col) * wt; | - | ||||||||||||||||||||||||||||||||||||
| 624 | blueF += qBlue(col) * wt; | - | ||||||||||||||||||||||||||||||||||||
| 625 | alphaF += qAlpha(col) * wt; | - | ||||||||||||||||||||||||||||||||||||
| 626 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 627 | } | - | ||||||||||||||||||||||||||||||||||||
| 628 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 629 | - | |||||||||||||||||||||||||||||||||||||
| 630 | if (radius
| 0 | ||||||||||||||||||||||||||||||||||||
| 631 | dr[x] = qRgba(qRound(red * weights[0]), qRound(green * weights[0]), qRound(blue * weights[0]), qRound(alpha * weights[0])); never executed: dr[x] = qRgba(qRound(red * weights[0]), qRound(green * weights[0]), qRound(blue * weights[0]), qRound(alpha * weights[0])); | 0 | ||||||||||||||||||||||||||||||||||||
| 632 | else | - | ||||||||||||||||||||||||||||||||||||
| 633 | dr[x] = qRgba(qRound(redF), qRound(greenF), qRound(blueF), qRound(alphaF)); never executed: dr[x] = qRgba(qRound(redF), qRound(greenF), qRound(blueF), qRound(alphaF)); | 0 | ||||||||||||||||||||||||||||||||||||
| 634 | } | - | ||||||||||||||||||||||||||||||||||||
| 635 | - | |||||||||||||||||||||||||||||||||||||
| 636 | dr += dstStride; | - | ||||||||||||||||||||||||||||||||||||
| 637 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||||||||||||||
| 639 | return never executed: dst;return dst;never executed: return dst; | 0 | ||||||||||||||||||||||||||||||||||||
| 640 | } | - | ||||||||||||||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||||||||||||||
| 642 | void qt_image_boxblur(QImage& image, int radius, bool quality) | - | ||||||||||||||||||||||||||||||||||||
| 643 | { | - | ||||||||||||||||||||||||||||||||||||
| 644 | int passes = quality
| 0 | ||||||||||||||||||||||||||||||||||||
| 645 | int filterSize = 2 * radius + 1; | - | ||||||||||||||||||||||||||||||||||||
| 646 | for (int i = 0; i < passes
| 0 | ||||||||||||||||||||||||||||||||||||
| 647 | image = qt_image_convolute_filter(image, QVector<qreal>() << 1.0 / (filterSize * filterSize), radius); never executed: image = qt_image_convolute_filter(image, QVector<qreal>() << 1.0 / (filterSize * filterSize), radius); | 0 | ||||||||||||||||||||||||||||||||||||
| 648 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 649 | - | |||||||||||||||||||||||||||||||||||||
| 650 | static QPainter::CompositionMode qt_composite_mode_from_string(const QString &compositeOperator) | - | ||||||||||||||||||||||||||||||||||||
| 651 | { | - | ||||||||||||||||||||||||||||||||||||
| 652 | if (compositeOperator == QLatin1String("source-over")
| 0 | ||||||||||||||||||||||||||||||||||||
| 653 | return never executed: QPainter::CompositionMode_SourceOver;return QPainter::CompositionMode_SourceOver;never executed: return QPainter::CompositionMode_SourceOver; | 0 | ||||||||||||||||||||||||||||||||||||
| 654 | } else if (compositeOperator == QLatin1String("source-out")
| 0 | ||||||||||||||||||||||||||||||||||||
| 655 | return never executed: QPainter::CompositionMode_SourceOut;return QPainter::CompositionMode_SourceOut;never executed: return QPainter::CompositionMode_SourceOut; | 0 | ||||||||||||||||||||||||||||||||||||
| 656 | } else if (compositeOperator == QLatin1String("source-in")
| 0 | ||||||||||||||||||||||||||||||||||||
| 657 | return never executed: QPainter::CompositionMode_SourceIn;return QPainter::CompositionMode_SourceIn;never executed: return QPainter::CompositionMode_SourceIn; | 0 | ||||||||||||||||||||||||||||||||||||
| 658 | } else if (compositeOperator == QLatin1String("source-atop")
| 0 | ||||||||||||||||||||||||||||||||||||
| 659 | return never executed: QPainter::CompositionMode_SourceAtop;return QPainter::CompositionMode_SourceAtop;never executed: return QPainter::CompositionMode_SourceAtop; | 0 | ||||||||||||||||||||||||||||||||||||
| 660 | } else if (compositeOperator == QLatin1String("destination-atop")
| 0 | ||||||||||||||||||||||||||||||||||||
| 661 | return never executed: QPainter::CompositionMode_DestinationAtop;return QPainter::CompositionMode_DestinationAtop;never executed: return QPainter::CompositionMode_DestinationAtop; | 0 | ||||||||||||||||||||||||||||||||||||
| 662 | } else if (compositeOperator == QLatin1String("destination-in")
| 0 | ||||||||||||||||||||||||||||||||||||
| 663 | return never executed: QPainter::CompositionMode_DestinationIn;return QPainter::CompositionMode_DestinationIn;never executed: return QPainter::CompositionMode_DestinationIn; | 0 | ||||||||||||||||||||||||||||||||||||
| 664 | } else if (compositeOperator == QLatin1String("destination-out")
| 0 | ||||||||||||||||||||||||||||||||||||
| 665 | return never executed: QPainter::CompositionMode_DestinationOut;return QPainter::CompositionMode_DestinationOut;never executed: return QPainter::CompositionMode_DestinationOut; | 0 | ||||||||||||||||||||||||||||||||||||
| 666 | } else if (compositeOperator == QLatin1String("destination-over")
| 0 | ||||||||||||||||||||||||||||||||||||
| 667 | return never executed: QPainter::CompositionMode_DestinationOver;return QPainter::CompositionMode_DestinationOver;never executed: return QPainter::CompositionMode_DestinationOver; | 0 | ||||||||||||||||||||||||||||||||||||
| 668 | } else if (compositeOperator == QLatin1String("lighter")
| 0 | ||||||||||||||||||||||||||||||||||||
| 669 | return never executed: QPainter::CompositionMode_Plus;return QPainter::CompositionMode_Plus;never executed: return QPainter::CompositionMode_Plus; | 0 | ||||||||||||||||||||||||||||||||||||
| 670 | } else if (compositeOperator == QLatin1String("copy")
| 0 | ||||||||||||||||||||||||||||||||||||
| 671 | return never executed: QPainter::CompositionMode_Source;return QPainter::CompositionMode_Source;never executed: return QPainter::CompositionMode_Source; | 0 | ||||||||||||||||||||||||||||||||||||
| 672 | } else if (compositeOperator == QLatin1String("xor")
| 0 | ||||||||||||||||||||||||||||||||||||
| 673 | return never executed: QPainter::CompositionMode_Xor;return QPainter::CompositionMode_Xor;never executed: return QPainter::CompositionMode_Xor; | 0 | ||||||||||||||||||||||||||||||||||||
| 674 | } else if (compositeOperator == QLatin1String("qt-clear")
| 0 | ||||||||||||||||||||||||||||||||||||
| 675 | return never executed: QPainter::CompositionMode_Clear;return QPainter::CompositionMode_Clear;never executed: return QPainter::CompositionMode_Clear; | 0 | ||||||||||||||||||||||||||||||||||||
| 676 | } else if (compositeOperator == QLatin1String("qt-destination")
| 0 | ||||||||||||||||||||||||||||||||||||
| 677 | return never executed: QPainter::CompositionMode_Destination;return QPainter::CompositionMode_Destination;never executed: return QPainter::CompositionMode_Destination; | 0 | ||||||||||||||||||||||||||||||||||||
| 678 | } else if (compositeOperator == QLatin1String("qt-multiply")
| 0 | ||||||||||||||||||||||||||||||||||||
| 679 | return never executed: QPainter::CompositionMode_Multiply;return QPainter::CompositionMode_Multiply;never executed: return QPainter::CompositionMode_Multiply; | 0 | ||||||||||||||||||||||||||||||||||||
| 680 | } else if (compositeOperator == QLatin1String("qt-screen")
| 0 | ||||||||||||||||||||||||||||||||||||
| 681 | return never executed: QPainter::CompositionMode_Screen;return QPainter::CompositionMode_Screen;never executed: return QPainter::CompositionMode_Screen; | 0 | ||||||||||||||||||||||||||||||||||||
| 682 | } else if (compositeOperator == QLatin1String("qt-overlay")
| 0 | ||||||||||||||||||||||||||||||||||||
| 683 | return never executed: QPainter::CompositionMode_Overlay;return QPainter::CompositionMode_Overlay;never executed: return QPainter::CompositionMode_Overlay; | 0 | ||||||||||||||||||||||||||||||||||||
| 684 | } else if (compositeOperator == QLatin1String("qt-darken")
| 0 | ||||||||||||||||||||||||||||||||||||
| 685 | return never executed: QPainter::CompositionMode_Darken;return QPainter::CompositionMode_Darken;never executed: return QPainter::CompositionMode_Darken; | 0 | ||||||||||||||||||||||||||||||||||||
| 686 | } else if (compositeOperator == QLatin1String("qt-lighten")
| 0 | ||||||||||||||||||||||||||||||||||||
| 687 | return never executed: QPainter::CompositionMode_Lighten;return QPainter::CompositionMode_Lighten;never executed: return QPainter::CompositionMode_Lighten; | 0 | ||||||||||||||||||||||||||||||||||||
| 688 | } else if (compositeOperator == QLatin1String("qt-color-dodge")
| 0 | ||||||||||||||||||||||||||||||||||||
| 689 | return never executed: QPainter::CompositionMode_ColorDodge;return QPainter::CompositionMode_ColorDodge;never executed: return QPainter::CompositionMode_ColorDodge; | 0 | ||||||||||||||||||||||||||||||||||||
| 690 | } else if (compositeOperator == QLatin1String("qt-color-burn")
| 0 | ||||||||||||||||||||||||||||||||||||
| 691 | return never executed: QPainter::CompositionMode_ColorBurn;return QPainter::CompositionMode_ColorBurn;never executed: return QPainter::CompositionMode_ColorBurn; | 0 | ||||||||||||||||||||||||||||||||||||
| 692 | } else if (compositeOperator == QLatin1String("qt-hard-light")
| 0 | ||||||||||||||||||||||||||||||||||||
| 693 | return never executed: QPainter::CompositionMode_HardLight;return QPainter::CompositionMode_HardLight;never executed: return QPainter::CompositionMode_HardLight; | 0 | ||||||||||||||||||||||||||||||||||||
| 694 | } else if (compositeOperator == QLatin1String("qt-soft-light")
| 0 | ||||||||||||||||||||||||||||||||||||
| 695 | return never executed: QPainter::CompositionMode_SoftLight;return QPainter::CompositionMode_SoftLight;never executed: return QPainter::CompositionMode_SoftLight; | 0 | ||||||||||||||||||||||||||||||||||||
| 696 | } else if (compositeOperator == QLatin1String("qt-difference")
| 0 | ||||||||||||||||||||||||||||||||||||
| 697 | return never executed: QPainter::CompositionMode_Difference;return QPainter::CompositionMode_Difference;never executed: return QPainter::CompositionMode_Difference; | 0 | ||||||||||||||||||||||||||||||||||||
| 698 | } else if (compositeOperator == QLatin1String("qt-exclusion")
| 0 | ||||||||||||||||||||||||||||||||||||
| 699 | return never executed: QPainter::CompositionMode_Exclusion;return QPainter::CompositionMode_Exclusion;never executed: return QPainter::CompositionMode_Exclusion; | 0 | ||||||||||||||||||||||||||||||||||||
| 700 | } | - | ||||||||||||||||||||||||||||||||||||
| 701 | return never executed: QPainter::CompositionMode_SourceOver;return QPainter::CompositionMode_SourceOver;never executed: return QPainter::CompositionMode_SourceOver; | 0 | ||||||||||||||||||||||||||||||||||||
| 702 | } | - | ||||||||||||||||||||||||||||||||||||
| 703 | - | |||||||||||||||||||||||||||||||||||||
| 704 | static QString qt_composite_mode_to_string(QPainter::CompositionMode op) | - | ||||||||||||||||||||||||||||||||||||
| 705 | { | - | ||||||||||||||||||||||||||||||||||||
| 706 | switch (op) { | - | ||||||||||||||||||||||||||||||||||||
| 707 | case never executed: QPainter::CompositionMode_SourceOver:case QPainter::CompositionMode_SourceOver:never executed: case QPainter::CompositionMode_SourceOver: | 0 | ||||||||||||||||||||||||||||||||||||
| 708 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "source-over")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "source-over" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 709 | case never executed: QPainter::CompositionMode_DestinationOver:case QPainter::CompositionMode_DestinationOver:never executed: case QPainter::CompositionMode_DestinationOver:code before this statement never executed: case QPainter::CompositionMode_DestinationOver: | 0 | ||||||||||||||||||||||||||||||||||||
| 710 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "destination-over")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "destination-over" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 711 | case never executed: QPainter::CompositionMode_Clear:case QPainter::CompositionMode_Clear:never executed: case QPainter::CompositionMode_Clear:code before this statement never executed: case QPainter::CompositionMode_Clear: | 0 | ||||||||||||||||||||||||||||||||||||
| 712 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-clear")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-clear" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 713 | case never executed: QPainter::CompositionMode_Source:case QPainter::CompositionMode_Source:never executed: case QPainter::CompositionMode_Source:code before this statement never executed: case QPainter::CompositionMode_Source: | 0 | ||||||||||||||||||||||||||||||||||||
| 714 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "copy")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "copy" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 715 | case never executed: QPainter::CompositionMode_Destination:case QPainter::CompositionMode_Destination:never executed: case QPainter::CompositionMode_Destination:code before this statement never executed: case QPainter::CompositionMode_Destination: | 0 | ||||||||||||||||||||||||||||||||||||
| 716 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-destination")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-destination" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 717 | case never executed: QPainter::CompositionMode_SourceIn:case QPainter::CompositionMode_SourceIn:never executed: case QPainter::CompositionMode_SourceIn:code before this statement never executed: case QPainter::CompositionMode_SourceIn: | 0 | ||||||||||||||||||||||||||||||||||||
| 718 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "source-in")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "source-in" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 719 | case never executed: QPainter::CompositionMode_DestinationIn:case QPainter::CompositionMode_DestinationIn:never executed: case QPainter::CompositionMode_DestinationIn:code before this statement never executed: case QPainter::CompositionMode_DestinationIn: | 0 | ||||||||||||||||||||||||||||||||||||
| 720 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "destination-in")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "destination-in" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 721 | case never executed: QPainter::CompositionMode_SourceOut:case QPainter::CompositionMode_SourceOut:never executed: case QPainter::CompositionMode_SourceOut:code before this statement never executed: case QPainter::CompositionMode_SourceOut: | 0 | ||||||||||||||||||||||||||||||||||||
| 722 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "source-out")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "source-out" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 723 | case never executed: QPainter::CompositionMode_DestinationOut:case QPainter::CompositionMode_DestinationOut:never executed: case QPainter::CompositionMode_DestinationOut:code before this statement never executed: case QPainter::CompositionMode_DestinationOut: | 0 | ||||||||||||||||||||||||||||||||||||
| 724 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "destination-out")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "destination-out" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 725 | case never executed: QPainter::CompositionMode_SourceAtop:case QPainter::CompositionMode_SourceAtop:never executed: case QPainter::CompositionMode_SourceAtop:code before this statement never executed: case QPainter::CompositionMode_SourceAtop: | 0 | ||||||||||||||||||||||||||||||||||||
| 726 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "source-atop")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "source-atop" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 727 | case never executed: QPainter::CompositionMode_DestinationAtop:case QPainter::CompositionMode_DestinationAtop:never executed: case QPainter::CompositionMode_DestinationAtop:code before this statement never executed: case QPainter::CompositionMode_DestinationAtop: | 0 | ||||||||||||||||||||||||||||||||||||
| 728 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "destination-atop")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "destination-atop" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 729 | case never executed: QPainter::CompositionMode_Xor:case QPainter::CompositionMode_Xor:never executed: case QPainter::CompositionMode_Xor:code before this statement never executed: case QPainter::CompositionMode_Xor: | 0 | ||||||||||||||||||||||||||||||||||||
| 730 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "xor")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "xor" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 731 | case never executed: QPainter::CompositionMode_Plus:case QPainter::CompositionMode_Plus:never executed: case QPainter::CompositionMode_Plus:code before this statement never executed: case QPainter::CompositionMode_Plus: | 0 | ||||||||||||||||||||||||||||||||||||
| 732 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "lighter")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "lighter" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 733 | case never executed: QPainter::CompositionMode_Multiply:case QPainter::CompositionMode_Multiply:never executed: case QPainter::CompositionMode_Multiply:code before this statement never executed: case QPainter::CompositionMode_Multiply: | 0 | ||||||||||||||||||||||||||||||||||||
| 734 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-multiply")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-multiply" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 735 | case never executed: QPainter::CompositionMode_Screen:case QPainter::CompositionMode_Screen:never executed: case QPainter::CompositionMode_Screen:code before this statement never executed: case QPainter::CompositionMode_Screen: | 0 | ||||||||||||||||||||||||||||||||||||
| 736 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-screen")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-screen" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 737 | case never executed: QPainter::CompositionMode_Overlay:case QPainter::CompositionMode_Overlay:never executed: case QPainter::CompositionMode_Overlay:code before this statement never executed: case QPainter::CompositionMode_Overlay: | 0 | ||||||||||||||||||||||||||||||||||||
| 738 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-overlay")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-overlay" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 739 | case never executed: QPainter::CompositionMode_Darken:case QPainter::CompositionMode_Darken:never executed: case QPainter::CompositionMode_Darken:code before this statement never executed: case QPainter::CompositionMode_Darken: | 0 | ||||||||||||||||||||||||||||||||||||
| 740 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-darken")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-darken" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 741 | case never executed: QPainter::CompositionMode_Lighten:case QPainter::CompositionMode_Lighten:never executed: case QPainter::CompositionMode_Lighten:code before this statement never executed: case QPainter::CompositionMode_Lighten: | 0 | ||||||||||||||||||||||||||||||||||||
| 742 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "lighter")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "lighter" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 743 | case never executed: QPainter::CompositionMode_ColorDodge:case QPainter::CompositionMode_ColorDodge:never executed: case QPainter::CompositionMode_ColorDodge:code before this statement never executed: case QPainter::CompositionMode_ColorDodge: | 0 | ||||||||||||||||||||||||||||||||||||
| 744 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-color-dodge")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-color-dodge" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 745 | case never executed: QPainter::CompositionMode_ColorBurn:case QPainter::CompositionMode_ColorBurn:never executed: case QPainter::CompositionMode_ColorBurn:code before this statement never executed: case QPainter::CompositionMode_ColorBurn: | 0 | ||||||||||||||||||||||||||||||||||||
| 746 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-color-burn")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-color-burn" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 747 | case never executed: QPainter::CompositionMode_HardLight:case QPainter::CompositionMode_HardLight:never executed: case QPainter::CompositionMode_HardLight:code before this statement never executed: case QPainter::CompositionMode_HardLight: | 0 | ||||||||||||||||||||||||||||||||||||
| 748 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-hard-light")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-hard-light" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 749 | case never executed: QPainter::CompositionMode_SoftLight:case QPainter::CompositionMode_SoftLight:never executed: case QPainter::CompositionMode_SoftLight:code before this statement never executed: case QPainter::CompositionMode_SoftLight: | 0 | ||||||||||||||||||||||||||||||||||||
| 750 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-soft-light")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-soft-light" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 751 | case never executed: QPainter::CompositionMode_Difference:case QPainter::CompositionMode_Difference:never executed: case QPainter::CompositionMode_Difference:code before this statement never executed: case QPainter::CompositionMode_Difference: | 0 | ||||||||||||||||||||||||||||||||||||
| 752 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-difference")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-difference" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 753 | case never executed: QPainter::CompositionMode_Exclusion:case QPainter::CompositionMode_Exclusion:never executed: case QPainter::CompositionMode_Exclusion:code before this statement never executed: case QPainter::CompositionMode_Exclusion: | 0 | ||||||||||||||||||||||||||||||||||||
| 754 | return ([]() noexcept -> QString { enum { Size = sizeof(u"" "qt-exclusion")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "qt-exclusion" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||||||||||||||
| 755 | default never executed: :default:never executed: default:code before this statement never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 756 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 757 | } | - | ||||||||||||||||||||||||||||||||||||
| 758 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 759 | } | - | ||||||||||||||||||||||||||||||||||||
| 760 | - | |||||||||||||||||||||||||||||||||||||
| 761 | struct QQuickJSContext2DPixelData : public QV4::Object | - | ||||||||||||||||||||||||||||||||||||
| 762 | { | - | ||||||||||||||||||||||||||||||||||||
| 763 | private: QQuickJSContext2DPixelData() = delete; QQuickJSContext2DPixelData(const QQuickJSContext2DPixelData &) = delete; QQuickJSContext2DPixelData &operator=(const QQuickJSContext2DPixelData &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::QQuickJSContext2DPixelData Data; typedef QV4::Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blocknever executed: &static_vtbl;return &static_vtbl;never executed: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;never executed: QV4::Heap::QQuickJSContext2DPixelData *d_unchecked() const { returnend of blocknever executed: static_cast<QV4::Heap::QQuickJSContext2DPixelData *>(m());return static_cast<QV4::Heap::QQuickJSContext2DPixelData *>(m());never executed: } QV4::Heap::QQuickJSContext2DPixelData *d() const { QV4::Heap::QQuickJSContext2DPixelData *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::QQuickJSContext2DPixelData *>(m());never executed: dptr;return dptr;never executed: } static_assert(bool(std::is_trivial< QV4::Heap::QQuickJSContext2DPixelData >::value), "std::is_trivial< QV4::Heap::QQuickJSContext2DPixelData >::value");return dptr; | 0 | ||||||||||||||||||||||||||||||||||||
| 764 | static void virtualDestroy(QV4::Heap::Base *b) { static_cast<Data *>(b)->destroy(); } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||||||||||||||
| 766 | static QV4::ReturnedValue virtualGet(const QV4::Managed *m, QV4::PropertyKey id, const QV4::Value *receiver, bool *hasProperty); | - | ||||||||||||||||||||||||||||||||||||
| 767 | static bool virtualPut(QV4::Managed *m, QV4::PropertyKey id, const QV4::Value &value, Value *receiver); | - | ||||||||||||||||||||||||||||||||||||
| 768 | - | |||||||||||||||||||||||||||||||||||||
| 769 | static QV4::ReturnedValue proto_get_length(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 770 | }; | - | ||||||||||||||||||||||||||||||||||||
| 771 | - | |||||||||||||||||||||||||||||||||||||
| 772 | void QV4::Heap::QQuickJSContext2DPixelData::init() | - | ||||||||||||||||||||||||||||||||||||
| 773 | { | - | ||||||||||||||||||||||||||||||||||||
| 774 | Object::init(); | - | ||||||||||||||||||||||||||||||||||||
| 775 | image = new QImage; | - | ||||||||||||||||||||||||||||||||||||
| 776 | QV4::Scope scope(internalClass->engine); | - | ||||||||||||||||||||||||||||||||||||
| 777 | QV4::ScopedObject o(scope, this); | - | ||||||||||||||||||||||||||||||||||||
| 778 | o->setArrayType(QV4::Heap::ArrayData::Custom); | - | ||||||||||||||||||||||||||||||||||||
| 779 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 780 | - | |||||||||||||||||||||||||||||||||||||
| 781 | const QV4::VTable QQuickJSContext2DPixelData::static_vtbl = { (std::is_same<QQuickJSContext2DPixelData::SuperClass, Object>::value) ? nullptr : &QQuickJSContext2DPixelData::SuperClass::static_vtbl, (sizeof(QQuickJSContext2DPixelData::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQuickJSContext2DPixelData::Data) + (QQuickJSContext2DPixelData::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQuickJSContext2DPixelData::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQuickJSContext2DPixelData::IsExecutionContext, QQuickJSContext2DPixelData::IsString, QQuickJSContext2DPixelData::IsObject, QQuickJSContext2DPixelData::IsFunctionObject, QQuickJSContext2DPixelData::IsErrorObject, QQuickJSContext2DPixelData::IsArrayData, QQuickJSContext2DPixelData::IsStringOrSymbol, QQuickJSContext2DPixelData::MyType, { 0, 0, 0, 0 }, "QQuickJSContext2DPixelData", QQuickJSContext2DPixelData::virtualDestroy, QQuickJSContext2DPixelData::Data::markObjects, QQuickJSContext2DPixelData::virtualIsEqualTo, QQuickJSContext2DPixelData::virtualGet, QQuickJSContext2DPixelData::virtualPut, QQuickJSContext2DPixelData::virtualDeleteProperty, QQuickJSContext2DPixelData::virtualHasProperty, QQuickJSContext2DPixelData::virtualGetOwnProperty, QQuickJSContext2DPixelData::virtualDefineOwnProperty, QQuickJSContext2DPixelData::virtualIsExtensible, QQuickJSContext2DPixelData::virtualPreventExtensions, QQuickJSContext2DPixelData::virtualGetPrototypeOf, QQuickJSContext2DPixelData::virtualSetPrototypeOf, QQuickJSContext2DPixelData::virtualGetLength, QQuickJSContext2DPixelData::virtualAdvanceIterator, QQuickJSContext2DPixelData::virtualInstanceOf, QQuickJSContext2DPixelData::virtualCall, QQuickJSContext2DPixelData::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||||||||||||||
| 782 | - | |||||||||||||||||||||||||||||||||||||
| 783 | struct QQuickJSContext2DImageData : public QV4::Object | - | ||||||||||||||||||||||||||||||||||||
| 784 | { | - | ||||||||||||||||||||||||||||||||||||
| 785 | private: QQuickJSContext2DImageData() = delete; QQuickJSContext2DImageData(const QQuickJSContext2DImageData &) = delete; QQuickJSContext2DImageData &operator=(const QQuickJSContext2DImageData &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::QQuickJSContext2DImageData Data; typedef QV4::Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blocknever executed: &static_vtbl;return &static_vtbl;never executed: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;never executed: QV4::Heap::QQuickJSContext2DImageData *d_unchecked() const { returnend of blocknever executed: static_cast<QV4::Heap::QQuickJSContext2DImageData *>(m());return static_cast<QV4::Heap::QQuickJSContext2DImageData *>(m());never executed: } QV4::Heap::QQuickJSContext2DImageData *d() const { QV4::Heap::QQuickJSContext2DImageData *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::QQuickJSContext2DImageData *>(m());never executed: dptr;return dptr;never executed: } static_assert(bool(std::is_trivial< QV4::Heap::QQuickJSContext2DImageData >::value), "std::is_trivial< QV4::Heap::QQuickJSContext2DImageData >::value");return dptr; | 0 | ||||||||||||||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||||||||||||||
| 787 | static QV4::ReturnedValue method_get_width(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 788 | static QV4::ReturnedValue method_get_height(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 789 | static QV4::ReturnedValue method_get_data(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc); | - | ||||||||||||||||||||||||||||||||||||
| 790 | - | |||||||||||||||||||||||||||||||||||||
| 791 | }; | - | ||||||||||||||||||||||||||||||||||||
| 792 | - | |||||||||||||||||||||||||||||||||||||
| 793 | void QV4::Heap::QQuickJSContext2DImageData::init() | - | ||||||||||||||||||||||||||||||||||||
| 794 | { | - | ||||||||||||||||||||||||||||||||||||
| 795 | Object::init(); | - | ||||||||||||||||||||||||||||||||||||
| 796 | pixelData = QV4::Primitive::undefinedValue(); | - | ||||||||||||||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||||||||||||||
| 798 | QV4::Scope scope(internalClass->engine); | - | ||||||||||||||||||||||||||||||||||||
| 799 | QV4::ScopedObject o(scope, this); | - | ||||||||||||||||||||||||||||||||||||
| 800 | - | |||||||||||||||||||||||||||||||||||||
| 801 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "width")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "width" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), ::QQuickJSContext2DImageData::method_get_width, nullptr);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 802 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "height")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "height" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), ::QQuickJSContext2DImageData::method_get_height, nullptr);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 803 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "data")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "data" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), ::QQuickJSContext2DImageData::method_get_data, nullptr);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 804 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||||||||||||||
| 806 | const QV4::VTable QQuickJSContext2DImageData::static_vtbl = { (std::is_same<QQuickJSContext2DImageData::SuperClass, Object>::value) ? nullptr : &QQuickJSContext2DImageData::SuperClass::static_vtbl, (sizeof(QQuickJSContext2DImageData::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQuickJSContext2DImageData::Data) + (QQuickJSContext2DImageData::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQuickJSContext2DImageData::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQuickJSContext2DImageData::IsExecutionContext, QQuickJSContext2DImageData::IsString, QQuickJSContext2DImageData::IsObject, QQuickJSContext2DImageData::IsFunctionObject, QQuickJSContext2DImageData::IsErrorObject, QQuickJSContext2DImageData::IsArrayData, QQuickJSContext2DImageData::IsStringOrSymbol, QQuickJSContext2DImageData::MyType, { 0, 0, 0, 0 }, "QQuickJSContext2DImageData", QQuickJSContext2DImageData::virtualDestroy, QQuickJSContext2DImageData::Data::markObjects, QQuickJSContext2DImageData::virtualIsEqualTo, QQuickJSContext2DImageData::virtualGet, QQuickJSContext2DImageData::virtualPut, QQuickJSContext2DImageData::virtualDeleteProperty, QQuickJSContext2DImageData::virtualHasProperty, QQuickJSContext2DImageData::virtualGetOwnProperty, QQuickJSContext2DImageData::virtualDefineOwnProperty, QQuickJSContext2DImageData::virtualIsExtensible, QQuickJSContext2DImageData::virtualPreventExtensions, QQuickJSContext2DImageData::virtualGetPrototypeOf, QQuickJSContext2DImageData::virtualSetPrototypeOf, QQuickJSContext2DImageData::virtualGetLength, QQuickJSContext2DImageData::virtualAdvanceIterator, QQuickJSContext2DImageData::virtualInstanceOf, QQuickJSContext2DImageData::virtualCall, QQuickJSContext2DImageData::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||||||||||||||
| 807 | - | |||||||||||||||||||||||||||||||||||||
| 808 | static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionEngine *v4, const QImage& image) | - | ||||||||||||||||||||||||||||||||||||
| 809 | { | - | ||||||||||||||||||||||||||||||||||||
| 810 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||||||||||||||
| 811 | QQuickContext2DEngineData *ed = engineData(scope.engine); | - | ||||||||||||||||||||||||||||||||||||
| 812 | QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, scope.engine->memoryManager->allocate<QQuickJSContext2DPixelData>()); | - | ||||||||||||||||||||||||||||||||||||
| 813 | QV4::ScopedObject p(scope, ed->pixelArrayProto.value()); | - | ||||||||||||||||||||||||||||||||||||
| 814 | pixelData->setPrototypeOf(p); | - | ||||||||||||||||||||||||||||||||||||
| 815 | - | |||||||||||||||||||||||||||||||||||||
| 816 | if (image.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 817 | *pixelData->d()->image = QImage(w, h, QImage::Format_ARGB32); | - | ||||||||||||||||||||||||||||||||||||
| 818 | pixelData->d()->image->fill(0x00000000); | - | ||||||||||||||||||||||||||||||||||||
| 819 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 820 | ((image.width()== qRound(w * image.devicePixelRatio()) && image.height() == qRound(h * image.devicePixelRatio())) ? static_cast<void>(0) : qt_assert("image.width()== qRound(w * image.devicePixelRatio()) && image.height() == qRound(h * image.devicePixelRatio())", __FILE__, 965)); | - | ||||||||||||||||||||||||||||||||||||
| 821 | *pixelData->d()->image = image.format() == QImage::Format_ARGB32
| 0 | ||||||||||||||||||||||||||||||||||||
| 822 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||||||||||||||
| 824 | QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, scope.engine->memoryManager->allocate<QQuickJSContext2DImageData>()); | - | ||||||||||||||||||||||||||||||||||||
| 825 | imageData->d()->pixelData = pixelData.asReturnedValue(); | - | ||||||||||||||||||||||||||||||||||||
| 826 | return never executed: imageData.asReturnedValue();return imageData.asReturnedValue();never executed: return imageData.asReturnedValue(); | 0 | ||||||||||||||||||||||||||||||||||||
| 827 | } | - | ||||||||||||||||||||||||||||||||||||
| 828 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_get_canvas(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 829 | { | - | ||||||||||||||||||||||||||||||||||||
| 830 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 831 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 832 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||||||||||||||
| 834 | return never executed: QV4::Encode(QV4::QObjectWrapper::wrap(scope.engine, r->d()->context->canvas()));return QV4::Encode(QV4::QObjectWrapper::wrap(scope.engine, r->d()->context->canvas()));never executed: return QV4::Encode(QV4::QObjectWrapper::wrap(scope.engine, r->d()->context->canvas())); | 0 | ||||||||||||||||||||||||||||||||||||
| 835 | } | - | ||||||||||||||||||||||||||||||||||||
| 836 | - | |||||||||||||||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||||||||||||||
| 838 | - | |||||||||||||||||||||||||||||||||||||
| 839 | - | |||||||||||||||||||||||||||||||||||||
| 840 | - | |||||||||||||||||||||||||||||||||||||
| 841 | - | |||||||||||||||||||||||||||||||||||||
| 842 | - | |||||||||||||||||||||||||||||||||||||
| 843 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_restore(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 844 | { | - | ||||||||||||||||||||||||||||||||||||
| 845 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 846 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 847 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 848 | - | |||||||||||||||||||||||||||||||||||||
| 849 | r->d()->context->popState(); | - | ||||||||||||||||||||||||||||||||||||
| 850 | return never executed: QV4::Encode(thisObject->asReturnedValue());return QV4::Encode(thisObject->asReturnedValue());never executed: return QV4::Encode(thisObject->asReturnedValue()); | 0 | ||||||||||||||||||||||||||||||||||||
| 851 | } | - | ||||||||||||||||||||||||||||||||||||
| 852 | - | |||||||||||||||||||||||||||||||||||||
| 853 | - | |||||||||||||||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||||||||||||||
| 856 | - | |||||||||||||||||||||||||||||||||||||
| 857 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_reset(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 858 | { | - | ||||||||||||||||||||||||||||||||||||
| 859 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 860 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 861 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 862 | - | |||||||||||||||||||||||||||||||||||||
| 863 | r->d()->context->reset(); | - | ||||||||||||||||||||||||||||||||||||
| 864 | - | |||||||||||||||||||||||||||||||||||||
| 865 | return never executed: QV4::Encode(thisObject->asReturnedValue());return QV4::Encode(thisObject->asReturnedValue());never executed: return QV4::Encode(thisObject->asReturnedValue()); | 0 | ||||||||||||||||||||||||||||||||||||
| 866 | } | - | ||||||||||||||||||||||||||||||||||||
| 867 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_save(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 868 | { | - | ||||||||||||||||||||||||||||||||||||
| 869 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 870 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 871 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||||||||||||||
| 873 | r->d()->context->pushState(); | - | ||||||||||||||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||||||||||||||
| 875 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 876 | } | - | ||||||||||||||||||||||||||||||||||||
| 877 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_rotate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 878 | { | - | ||||||||||||||||||||||||||||||||||||
| 879 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 880 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 881 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 882 | - | |||||||||||||||||||||||||||||||||||||
| 883 | if (argc >= 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 884 | r->d()->context->rotate(argv[0].toNumber()); never executed: r->d()->context->rotate(argv[0].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 885 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 886 | } | - | ||||||||||||||||||||||||||||||||||||
| 887 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_scale(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 888 | { | - | ||||||||||||||||||||||||||||||||||||
| 889 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 890 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 891 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 892 | - | |||||||||||||||||||||||||||||||||||||
| 893 | - | |||||||||||||||||||||||||||||||||||||
| 894 | if (argc >= 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 895 | r->d()->context->scale(argv[0].toNumber(), argv[1].toNumber()); never executed: r->d()->context->scale(argv[0].toNumber(), argv[1].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 896 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 897 | - | |||||||||||||||||||||||||||||||||||||
| 898 | } | - | ||||||||||||||||||||||||||||||||||||
| 899 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_setTransform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 900 | { | - | ||||||||||||||||||||||||||||||||||||
| 901 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 902 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 903 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 904 | - | |||||||||||||||||||||||||||||||||||||
| 905 | - | |||||||||||||||||||||||||||||||||||||
| 906 | if (argc >= 6
| 0 | ||||||||||||||||||||||||||||||||||||
| 907 | r->d()->context->setTransform( argv[0].toNumber() never executed: r->d()->context->setTransform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 908 | , argv[1].toNumber() never executed: r->d()->context->setTransform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 909 | , argv[2].toNumber() never executed: r->d()->context->setTransform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 910 | , argv[3].toNumber() never executed: r->d()->context->setTransform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 911 | , argv[4].toNumber() never executed: r->d()->context->setTransform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 912 | , argv[5].toNumber()); never executed: r->d()->context->setTransform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 913 | - | |||||||||||||||||||||||||||||||||||||
| 914 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||||||||||||||
| 916 | } | - | ||||||||||||||||||||||||||||||||||||
| 917 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_transform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 918 | { | - | ||||||||||||||||||||||||||||||||||||
| 919 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 920 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 921 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||||||||||||||
| 923 | if (argc >= 6
| 0 | ||||||||||||||||||||||||||||||||||||
| 924 | r->d()->context->transform( argv[0].toNumber() never executed: r->d()->context->transform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 925 | , argv[1].toNumber() never executed: r->d()->context->transform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 926 | , argv[2].toNumber() never executed: r->d()->context->transform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 927 | , argv[3].toNumber() never executed: r->d()->context->transform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 928 | , argv[4].toNumber() never executed: r->d()->context->transform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 929 | , argv[5].toNumber()); never executed: r->d()->context->transform( argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 930 | - | |||||||||||||||||||||||||||||||||||||
| 931 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 932 | - | |||||||||||||||||||||||||||||||||||||
| 933 | } | - | ||||||||||||||||||||||||||||||||||||
| 934 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_translate(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 935 | { | - | ||||||||||||||||||||||||||||||||||||
| 936 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 937 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 938 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||||||||||||||
| 940 | if (argc >= 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 941 | r->d()->context->translate(argv[0].toNumber(), argv[1].toNumber()); never executed: r->d()->context->translate(argv[0].toNumber(), argv[1].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 942 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 943 | - | |||||||||||||||||||||||||||||||||||||
| 944 | } | - | ||||||||||||||||||||||||||||||||||||
| 945 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_resetTransform(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 946 | { | - | ||||||||||||||||||||||||||||||||||||
| 947 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 948 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 949 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 950 | - | |||||||||||||||||||||||||||||||||||||
| 951 | r->d()->context->setTransform(1, 0, 0, 1, 0, 0); | - | ||||||||||||||||||||||||||||||||||||
| 952 | - | |||||||||||||||||||||||||||||||||||||
| 953 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 954 | - | |||||||||||||||||||||||||||||||||||||
| 955 | } | - | ||||||||||||||||||||||||||||||||||||
| 956 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_shear(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 957 | { | - | ||||||||||||||||||||||||||||||||||||
| 958 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 959 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 960 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 961 | - | |||||||||||||||||||||||||||||||||||||
| 962 | if (argc >= 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 963 | r->d()->context->shear(argv[0].toNumber(), argv[1].toNumber()); never executed: r->d()->context->shear(argv[0].toNumber(), argv[1].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 964 | - | |||||||||||||||||||||||||||||||||||||
| 965 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||||||||||||||
| 967 | } | - | ||||||||||||||||||||||||||||||||||||
| 968 | QV4::ReturnedValue QQuickJSContext2D::method_get_globalAlpha(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 969 | { | - | ||||||||||||||||||||||||||||||||||||
| 970 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 971 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 972 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 973 | - | |||||||||||||||||||||||||||||||||||||
| 974 | return never executed: QV4::Encode(QV4::Encode(r->d()->context->state.globalAlpha));return QV4::Encode(QV4::Encode(r->d()->context->state.globalAlpha));never executed: return QV4::Encode(QV4::Encode(r->d()->context->state.globalAlpha)); | 0 | ||||||||||||||||||||||||||||||||||||
| 975 | } | - | ||||||||||||||||||||||||||||||||||||
| 976 | - | |||||||||||||||||||||||||||||||||||||
| 977 | QV4::ReturnedValue QQuickJSContext2D::method_set_globalAlpha(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 978 | { | - | ||||||||||||||||||||||||||||||||||||
| 979 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 980 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 981 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 982 | - | |||||||||||||||||||||||||||||||||||||
| 983 | double globalAlpha = argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 984 | - | |||||||||||||||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||||||||||||||
| 986 | if (!qt_is_finite(globalAlpha)
| 0 | ||||||||||||||||||||||||||||||||||||
| 987 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 988 | - | |||||||||||||||||||||||||||||||||||||
| 989 | if (globalAlpha >= 0.0
| 0 | ||||||||||||||||||||||||||||||||||||
| 990 | r->d()->context->state.globalAlpha = globalAlpha; | - | ||||||||||||||||||||||||||||||||||||
| 991 | r->d()->context->buffer()->setGlobalAlpha(r->d()->context->state.globalAlpha); | - | ||||||||||||||||||||||||||||||||||||
| 992 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 993 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 994 | } | - | ||||||||||||||||||||||||||||||||||||
| 995 | QV4::ReturnedValue QQuickJSContext2D::method_get_globalCompositeOperation(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 996 | { | - | ||||||||||||||||||||||||||||||||||||
| 997 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 998 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 999 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1000 | - | |||||||||||||||||||||||||||||||||||||
| 1001 | return never executed: QV4::Encode(scope.engine->newString(qt_composite_mode_to_string(r->d()->context->state.globalCompositeOperation)));return QV4::Encode(scope.engine->newString(qt_composite_mode_to_string(r->d()->context->state.globalCompositeOperation)));never executed: return QV4::Encode(scope.engine->newString(qt_composite_mode_to_string(r->d()->context->state.globalCompositeOperation))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1002 | } | - | ||||||||||||||||||||||||||||||||||||
| 1003 | - | |||||||||||||||||||||||||||||||||||||
| 1004 | QV4::ReturnedValue QQuickJSContext2D::method_set_globalCompositeOperation(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1005 | { | - | ||||||||||||||||||||||||||||||||||||
| 1006 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1007 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1008 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1009 | - | |||||||||||||||||||||||||||||||||||||
| 1010 | if (!argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1011 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1012 | - | |||||||||||||||||||||||||||||||||||||
| 1013 | QString mode = argv[0].toQString(); | - | ||||||||||||||||||||||||||||||||||||
| 1014 | QPainter::CompositionMode cm = qt_composite_mode_from_string(mode); | - | ||||||||||||||||||||||||||||||||||||
| 1015 | if (cm == QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||||||||||||||
| 1016 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||||||||||||||
| 1018 | if (cm != r->d()->context->state.globalCompositeOperation
| 0 | ||||||||||||||||||||||||||||||||||||
| 1019 | r->d()->context->state.globalCompositeOperation = cm; | - | ||||||||||||||||||||||||||||||||||||
| 1020 | r->d()->context->buffer()->setGlobalCompositeOperation(cm); | - | ||||||||||||||||||||||||||||||||||||
| 1021 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1022 | - | |||||||||||||||||||||||||||||||||||||
| 1023 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1024 | } | - | ||||||||||||||||||||||||||||||||||||
| 1025 | QV4::ReturnedValue QQuickJSContext2D::method_get_fillStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1026 | { | - | ||||||||||||||||||||||||||||||||||||
| 1027 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1028 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1029 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||||||||||||||
| 1031 | QColor color = r->d()->context->state.fillStyle.color(); | - | ||||||||||||||||||||||||||||||||||||
| 1032 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1033 | if (color.alpha() == 255
| 0 | ||||||||||||||||||||||||||||||||||||
| 1034 | return never executed: QV4::Encode(scope.engine->newString(color.name()));return QV4::Encode(scope.engine->newString(color.name()));never executed: return QV4::Encode(scope.engine->newString(color.name())); | 0 | ||||||||||||||||||||||||||||||||||||
| 1035 | QString alphaString = QString::number(color.alphaF(), 'f'); | - | ||||||||||||||||||||||||||||||||||||
| 1036 | while (alphaString.endsWith(QLatin1Char('0'))
| 0 | ||||||||||||||||||||||||||||||||||||
| 1037 | alphaString.chop(1); never executed: alphaString.chop(1); | 0 | ||||||||||||||||||||||||||||||||||||
| 1038 | if (alphaString.endsWith(QLatin1Char('.'))
| 0 | ||||||||||||||||||||||||||||||||||||
| 1039 | alphaString += QLatin1Char('0'); never executed: alphaString += QLatin1Char('0'); | 0 | ||||||||||||||||||||||||||||||||||||
| 1040 | QString str = QString::fromLatin1("rgba(%1, %2, %3, %4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(alphaString); | - | ||||||||||||||||||||||||||||||||||||
| 1041 | return never executed: QV4::Encode(scope.engine->newString(str));return QV4::Encode(scope.engine->newString(str));never executed: return QV4::Encode(scope.engine->newString(str)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1042 | } | - | ||||||||||||||||||||||||||||||||||||
| 1043 | return never executed: QV4::Encode(r->d()->context->m_fillStyle.value());return QV4::Encode(r->d()->context->m_fillStyle.value());never executed: return QV4::Encode(r->d()->context->m_fillStyle.value()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1044 | } | - | ||||||||||||||||||||||||||||||||||||
| 1045 | - | |||||||||||||||||||||||||||||||||||||
| 1046 | QV4::ReturnedValue QQuickJSContext2D::method_set_fillStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1047 | { | - | ||||||||||||||||||||||||||||||||||||
| 1048 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1049 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1050 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||||||||||||||
| 1052 | QV4::ScopedValue value(scope, argc ? argv[0] : QV4::Primitive::undefinedValue()); | - | ||||||||||||||||||||||||||||||||||||
| 1053 | - | |||||||||||||||||||||||||||||||||||||
| 1054 | if (value->as<Object>()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1055 | QColor color = scope.engine->toVariant(value, qMetaTypeId<QColor>()).value<QColor>(); | - | ||||||||||||||||||||||||||||||||||||
| 1056 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1057 | r->d()->context->state.fillStyle = color; | - | ||||||||||||||||||||||||||||||||||||
| 1058 | r->d()->context->buffer()->setFillStyle(color); | - | ||||||||||||||||||||||||||||||||||||
| 1059 | r->d()->context->m_fillStyle.set(scope.engine, value); | - | ||||||||||||||||||||||||||||||||||||
| 1060 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1061 | QV4::Scoped<QQuickContext2DStyle> style(scope, value->as<QQuickContext2DStyle>()); | - | ||||||||||||||||||||||||||||||||||||
| 1062 | if (style
| 0 | ||||||||||||||||||||||||||||||||||||
| 1063 | r->d()->context->state.fillStyle = *style->d()->brush; | - | ||||||||||||||||||||||||||||||||||||
| 1064 | r->d()->context->buffer()->setFillStyle(*style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY); | - | ||||||||||||||||||||||||||||||||||||
| 1065 | r->d()->context->m_fillStyle.set(scope.engine, value); | - | ||||||||||||||||||||||||||||||||||||
| 1066 | r->d()->context->state.fillPatternRepeatX = style->d()->patternRepeatX; | - | ||||||||||||||||||||||||||||||||||||
| 1067 | r->d()->context->state.fillPatternRepeatY = style->d()->patternRepeatY; | - | ||||||||||||||||||||||||||||||||||||
| 1068 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1069 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1070 | } else if (value->isString()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1071 | QColor color = qt_color_from_string(value); | - | ||||||||||||||||||||||||||||||||||||
| 1072 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1073 | r->d()->context->state.fillStyle = QBrush(color); | - | ||||||||||||||||||||||||||||||||||||
| 1074 | r->d()->context->buffer()->setFillStyle(r->d()->context->state.fillStyle); | - | ||||||||||||||||||||||||||||||||||||
| 1075 | r->d()->context->m_fillStyle.set(scope.engine, value); | - | ||||||||||||||||||||||||||||||||||||
| 1076 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1077 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1078 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1079 | } | - | ||||||||||||||||||||||||||||||||||||
| 1080 | QV4::ReturnedValue QQuickJSContext2D::method_get_fillRule(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1081 | { | - | ||||||||||||||||||||||||||||||||||||
| 1082 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1083 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1084 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1085 | - | |||||||||||||||||||||||||||||||||||||
| 1086 | return never executed: QV4::Encode(scope.engine->fromVariant(r->d()->context->state.fillRule));return QV4::Encode(scope.engine->fromVariant(r->d()->context->state.fillRule));never executed: return QV4::Encode(scope.engine->fromVariant(r->d()->context->state.fillRule)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1087 | } | - | ||||||||||||||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||||||||||||||
| 1089 | QV4::ReturnedValue QQuickJSContext2D::method_set_fillRule(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1090 | { | - | ||||||||||||||||||||||||||||||||||||
| 1091 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1092 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1093 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1094 | - | |||||||||||||||||||||||||||||||||||||
| 1095 | QV4::ScopedValue value(scope, argc ? argv[0] : QV4::Primitive::undefinedValue()); | - | ||||||||||||||||||||||||||||||||||||
| 1096 | - | |||||||||||||||||||||||||||||||||||||
| 1097 | if ((value->isString()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1098 | || (value->isInt32()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1099 | r->d()->context->state.fillRule = Qt::WindingFill; | - | ||||||||||||||||||||||||||||||||||||
| 1100 | } never executed: else if ((value->isString()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1101 | || (value->isInt32()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1102 | r->d()->context->state.fillRule = Qt::OddEvenFill; | - | ||||||||||||||||||||||||||||||||||||
| 1103 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1104 | - | |||||||||||||||||||||||||||||||||||||
| 1105 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1106 | r->d()->context->m_path.setFillRule(r->d()->context->state.fillRule); | - | ||||||||||||||||||||||||||||||||||||
| 1107 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1108 | } | - | ||||||||||||||||||||||||||||||||||||
| 1109 | QV4::ReturnedValue QQuickJSContext2D::method_get_strokeStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1110 | { | - | ||||||||||||||||||||||||||||||||||||
| 1111 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1112 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1113 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1114 | - | |||||||||||||||||||||||||||||||||||||
| 1115 | QColor color = r->d()->context->state.strokeStyle.color(); | - | ||||||||||||||||||||||||||||||||||||
| 1116 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1117 | if (color.alpha() == 255
| 0 | ||||||||||||||||||||||||||||||||||||
| 1118 | return never executed: QV4::Encode(scope.engine->newString(color.name()));return QV4::Encode(scope.engine->newString(color.name()));never executed: return QV4::Encode(scope.engine->newString(color.name())); | 0 | ||||||||||||||||||||||||||||||||||||
| 1119 | QString alphaString = QString::number(color.alphaF(), 'f'); | - | ||||||||||||||||||||||||||||||||||||
| 1120 | while (alphaString.endsWith(QLatin1Char('0'))
| 0 | ||||||||||||||||||||||||||||||||||||
| 1121 | alphaString.chop(1); never executed: alphaString.chop(1); | 0 | ||||||||||||||||||||||||||||||||||||
| 1122 | if (alphaString.endsWith(QLatin1Char('.'))
| 0 | ||||||||||||||||||||||||||||||||||||
| 1123 | alphaString += QLatin1Char('0'); never executed: alphaString += QLatin1Char('0'); | 0 | ||||||||||||||||||||||||||||||||||||
| 1124 | QString str = QString::fromLatin1("rgba(%1, %2, %3, %4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(alphaString); | - | ||||||||||||||||||||||||||||||||||||
| 1125 | return never executed: QV4::Encode(scope.engine->newString(str));return QV4::Encode(scope.engine->newString(str));never executed: return QV4::Encode(scope.engine->newString(str)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1126 | } | - | ||||||||||||||||||||||||||||||||||||
| 1127 | return never executed: QV4::Encode(r->d()->context->m_strokeStyle.value());return QV4::Encode(r->d()->context->m_strokeStyle.value());never executed: return QV4::Encode(r->d()->context->m_strokeStyle.value()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1128 | } | - | ||||||||||||||||||||||||||||||||||||
| 1129 | - | |||||||||||||||||||||||||||||||||||||
| 1130 | QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1131 | { | - | ||||||||||||||||||||||||||||||||||||
| 1132 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1133 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1134 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1135 | - | |||||||||||||||||||||||||||||||||||||
| 1136 | QV4::ScopedValue value(scope, argc ? argv[0] : QV4::Primitive::undefinedValue()); | - | ||||||||||||||||||||||||||||||||||||
| 1137 | - | |||||||||||||||||||||||||||||||||||||
| 1138 | if (value->as<Object>()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1139 | QColor color = scope.engine->toVariant(value, qMetaTypeId<QColor>()).value<QColor>(); | - | ||||||||||||||||||||||||||||||||||||
| 1140 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1141 | r->d()->context->state.fillStyle = color; | - | ||||||||||||||||||||||||||||||||||||
| 1142 | r->d()->context->buffer()->setStrokeStyle(color); | - | ||||||||||||||||||||||||||||||||||||
| 1143 | r->d()->context->m_strokeStyle.set(scope.engine, value); | - | ||||||||||||||||||||||||||||||||||||
| 1144 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1145 | QV4::Scoped<QQuickContext2DStyle> style(scope, value->as<QQuickContext2DStyle>()); | - | ||||||||||||||||||||||||||||||||||||
| 1146 | if (style
| 0 | ||||||||||||||||||||||||||||||||||||
| 1147 | r->d()->context->state.strokeStyle = *style->d()->brush; | - | ||||||||||||||||||||||||||||||||||||
| 1148 | r->d()->context->buffer()->setStrokeStyle(*style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY); | - | ||||||||||||||||||||||||||||||||||||
| 1149 | r->d()->context->m_strokeStyle.set(scope.engine, value); | - | ||||||||||||||||||||||||||||||||||||
| 1150 | r->d()->context->state.strokePatternRepeatX = style->d()->patternRepeatX; | - | ||||||||||||||||||||||||||||||||||||
| 1151 | r->d()->context->state.strokePatternRepeatY = style->d()->patternRepeatY; | - | ||||||||||||||||||||||||||||||||||||
| 1152 | - | |||||||||||||||||||||||||||||||||||||
| 1153 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1154 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1155 | } else if (value->isString()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1156 | QColor color = qt_color_from_string(value); | - | ||||||||||||||||||||||||||||||||||||
| 1157 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1158 | r->d()->context->state.strokeStyle = QBrush(color); | - | ||||||||||||||||||||||||||||||||||||
| 1159 | r->d()->context->buffer()->setStrokeStyle(r->d()->context->state.strokeStyle); | - | ||||||||||||||||||||||||||||||||||||
| 1160 | r->d()->context->m_strokeStyle.set(scope.engine, value); | - | ||||||||||||||||||||||||||||||||||||
| 1161 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1162 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1163 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1164 | } | - | ||||||||||||||||||||||||||||||||||||
| 1165 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1166 | { | - | ||||||||||||||||||||||||||||||||||||
| 1167 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1168 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1169 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1170 | - | |||||||||||||||||||||||||||||||||||||
| 1171 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 1172 | qreal x0 = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1173 | qreal y0 = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1174 | qreal x1 = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1175 | qreal y1 = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1176 | - | |||||||||||||||||||||||||||||||||||||
| 1177 | if (!qt_is_finite(x0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1178 | || !qt_is_finite(y0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1179 | || !qt_is_finite(x1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1180 | || !qt_is_finite(y1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1181 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "createLinearGradient(): Incorrect arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createLinearGradient(): Incorrect arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: }return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1182 | } | - | ||||||||||||||||||||||||||||||||||||
| 1183 | QQuickContext2DEngineData *ed = engineData(scope.engine); | - | ||||||||||||||||||||||||||||||||||||
| 1184 | - | |||||||||||||||||||||||||||||||||||||
| 1185 | QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>()); | - | ||||||||||||||||||||||||||||||||||||
| 1186 | QV4::ScopedObject p(scope, ed->gradientProto.value()); | - | ||||||||||||||||||||||||||||||||||||
| 1187 | gradient->setPrototypeOf(p); | - | ||||||||||||||||||||||||||||||||||||
| 1188 | *gradient->d()->brush = QLinearGradient(x0, y0, x1, y1); | - | ||||||||||||||||||||||||||||||||||||
| 1189 | return never executed: QV4::Encode(*gradient);return QV4::Encode(*gradient);never executed: return QV4::Encode(*gradient); | 0 | ||||||||||||||||||||||||||||||||||||
| 1190 | } | - | ||||||||||||||||||||||||||||||||||||
| 1191 | - | |||||||||||||||||||||||||||||||||||||
| 1192 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1193 | - | |||||||||||||||||||||||||||||||||||||
| 1194 | } | - | ||||||||||||||||||||||||||||||||||||
| 1195 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1196 | { | - | ||||||||||||||||||||||||||||||||||||
| 1197 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1198 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1199 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1200 | - | |||||||||||||||||||||||||||||||||||||
| 1201 | if (argc >= 6
| 0 | ||||||||||||||||||||||||||||||||||||
| 1202 | qreal x0 = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1203 | qreal y0 = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1204 | qreal r0 = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1205 | qreal x1 = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1206 | qreal y1 = argv[4].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1207 | qreal r1 = argv[5].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||||||||||||||
| 1209 | if (!qt_is_finite(x0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1210 | || !qt_is_finite(y0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1211 | || !qt_is_finite(x1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1212 | || !qt_is_finite(r0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1213 | || !qt_is_finite(r1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1214 | || !qt_is_finite(y1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1215 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "createRadialGradient(): Incorrect arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createRadialGradient(): Incorrect arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: }return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1216 | } | - | ||||||||||||||||||||||||||||||||||||
| 1217 | - | |||||||||||||||||||||||||||||||||||||
| 1218 | if (r0 < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 1219 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "createRadialGradient(): Incorrect arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createRadialGradient(): Incorrect arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: }return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1220 | - | |||||||||||||||||||||||||||||||||||||
| 1221 | QQuickContext2DEngineData *ed = engineData(scope.engine); | - | ||||||||||||||||||||||||||||||||||||
| 1222 | - | |||||||||||||||||||||||||||||||||||||
| 1223 | QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>()); | - | ||||||||||||||||||||||||||||||||||||
| 1224 | QV4::ScopedObject p(scope, ed->gradientProto.value()); | - | ||||||||||||||||||||||||||||||||||||
| 1225 | gradient->setPrototypeOf(p); | - | ||||||||||||||||||||||||||||||||||||
| 1226 | *gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r1, QPointF(x0, y0), r0); | - | ||||||||||||||||||||||||||||||||||||
| 1227 | return never executed: QV4::Encode(*gradient);return QV4::Encode(*gradient);never executed: return QV4::Encode(*gradient); | 0 | ||||||||||||||||||||||||||||||||||||
| 1228 | } | - | ||||||||||||||||||||||||||||||||||||
| 1229 | - | |||||||||||||||||||||||||||||||||||||
| 1230 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1231 | - | |||||||||||||||||||||||||||||||||||||
| 1232 | } | - | ||||||||||||||||||||||||||||||||||||
| 1233 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1234 | { | - | ||||||||||||||||||||||||||||||||||||
| 1235 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1236 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 1237 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1238 | - | |||||||||||||||||||||||||||||||||||||
| 1239 | if (argc >= 3
| 0 | ||||||||||||||||||||||||||||||||||||
| 1240 | qreal x = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1241 | qreal y = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1242 | qreal angle = qRadiansToDegrees(argv[2].toNumber()); | - | ||||||||||||||||||||||||||||||||||||
| 1243 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1244 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "createConicalGradient(): Incorrect arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createConicalGradient(): Incorrect arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1245 | } | - | ||||||||||||||||||||||||||||||||||||
| 1246 | - | |||||||||||||||||||||||||||||||||||||
| 1247 | if (!qt_is_finite(angle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1248 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "createConicalGradient(): Incorrect arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createConicalGradient(): Incorrect arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1249 | } | - | ||||||||||||||||||||||||||||||||||||
| 1250 | - | |||||||||||||||||||||||||||||||||||||
| 1251 | QQuickContext2DEngineData *ed = engineData(scope.engine); | - | ||||||||||||||||||||||||||||||||||||
| 1252 | - | |||||||||||||||||||||||||||||||||||||
| 1253 | QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>()); | - | ||||||||||||||||||||||||||||||||||||
| 1254 | QV4::ScopedObject p(scope, ed->gradientProto.value()); | - | ||||||||||||||||||||||||||||||||||||
| 1255 | gradient->setPrototypeOf(p); | - | ||||||||||||||||||||||||||||||||||||
| 1256 | *gradient->d()->brush = QConicalGradient(x, y, angle); | - | ||||||||||||||||||||||||||||||||||||
| 1257 | return never executed: QV4::Encode(*gradient);return QV4::Encode(*gradient);never executed: return QV4::Encode(*gradient); | 0 | ||||||||||||||||||||||||||||||||||||
| 1258 | } | - | ||||||||||||||||||||||||||||||||||||
| 1259 | - | |||||||||||||||||||||||||||||||||||||
| 1260 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1261 | - | |||||||||||||||||||||||||||||||||||||
| 1262 | } | - | ||||||||||||||||||||||||||||||||||||
| 1263 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1264 | { | - | ||||||||||||||||||||||||||||||||||||
| 1265 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1266 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1267 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1268 | - | |||||||||||||||||||||||||||||||||||||
| 1269 | if (argc >= 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 1270 | QV4::Scoped<QQuickContext2DStyle> pattern(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>()); | - | ||||||||||||||||||||||||||||||||||||
| 1271 | - | |||||||||||||||||||||||||||||||||||||
| 1272 | QColor color = scope.engine->toVariant(argv[0], qMetaTypeId<QColor>()).value<QColor>(); | - | ||||||||||||||||||||||||||||||||||||
| 1273 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1274 | int patternMode = argv[1].toInt32(); | - | ||||||||||||||||||||||||||||||||||||
| 1275 | Qt::BrushStyle style = Qt::SolidPattern; | - | ||||||||||||||||||||||||||||||||||||
| 1276 | if (patternMode >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 1277 | style = static_cast<Qt::BrushStyle>(patternMode); | - | ||||||||||||||||||||||||||||||||||||
| 1278 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1279 | *pattern->d()->brush = QBrush(color, style); | - | ||||||||||||||||||||||||||||||||||||
| 1280 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1281 | QImage patternTexture; | - | ||||||||||||||||||||||||||||||||||||
| 1282 | - | |||||||||||||||||||||||||||||||||||||
| 1283 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 1284 | QV4::ScopedString s(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "data")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "data" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 1285 | QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, o->get(s)); | - | ||||||||||||||||||||||||||||||||||||
| 1286 | if (!!pixelData
| 0 | ||||||||||||||||||||||||||||||||||||
| 1287 | patternTexture = *pixelData->d()->image; | - | ||||||||||||||||||||||||||||||||||||
| 1288 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1289 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1290 | patternTexture = r->d()->context->createPixmap(QUrl(argv[0].toQStringNoThrow()))->image(); | - | ||||||||||||||||||||||||||||||||||||
| 1291 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1292 | - | |||||||||||||||||||||||||||||||||||||
| 1293 | if (!patternTexture.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1294 | pattern->d()->brush->setTextureImage(patternTexture); | - | ||||||||||||||||||||||||||||||||||||
| 1295 | - | |||||||||||||||||||||||||||||||||||||
| 1296 | QString repetition = argv[1].toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||
| 1297 | if (repetition == QLatin1String("repeat")
| 0 | ||||||||||||||||||||||||||||||||||||
| 1298 | pattern->d()->patternRepeatX = true; | - | ||||||||||||||||||||||||||||||||||||
| 1299 | pattern->d()->patternRepeatY = true; | - | ||||||||||||||||||||||||||||||||||||
| 1300 | } never executed: else if (repetition == QLatin1String("repeat-x")end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1301 | pattern->d()->patternRepeatX = true; | - | ||||||||||||||||||||||||||||||||||||
| 1302 | pattern->d()->patternRepeatY = false; | - | ||||||||||||||||||||||||||||||||||||
| 1303 | } never executed: else if (repetition == QLatin1String("repeat-y")end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1304 | pattern->d()->patternRepeatX = false; | - | ||||||||||||||||||||||||||||||||||||
| 1305 | pattern->d()->patternRepeatY = true; | - | ||||||||||||||||||||||||||||||||||||
| 1306 | } never executed: else if (repetition == QLatin1String("no-repeat")end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1307 | pattern->d()->patternRepeatX = false; | - | ||||||||||||||||||||||||||||||||||||
| 1308 | pattern->d()->patternRepeatY = false; | - | ||||||||||||||||||||||||||||||||||||
| 1309 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1310 | - | |||||||||||||||||||||||||||||||||||||
| 1311 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1312 | - | |||||||||||||||||||||||||||||||||||||
| 1313 | } | - | ||||||||||||||||||||||||||||||||||||
| 1314 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1315 | - | |||||||||||||||||||||||||||||||||||||
| 1316 | return never executed: QV4::Encode(*pattern);return QV4::Encode(*pattern);never executed: return QV4::Encode(*pattern); | 0 | ||||||||||||||||||||||||||||||||||||
| 1317 | - | |||||||||||||||||||||||||||||||||||||
| 1318 | } | - | ||||||||||||||||||||||||||||||||||||
| 1319 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1320 | } | - | ||||||||||||||||||||||||||||||||||||
| 1321 | QV4::ReturnedValue QQuickJSContext2D::method_get_lineCap(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1322 | { | - | ||||||||||||||||||||||||||||||||||||
| 1323 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1324 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1325 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1326 | - | |||||||||||||||||||||||||||||||||||||
| 1327 | switch (r->d()->context->state.lineCap) { | - | ||||||||||||||||||||||||||||||||||||
| 1328 | case never executed: Qt::RoundCap:case Qt::RoundCap:never executed: case Qt::RoundCap: | 0 | ||||||||||||||||||||||||||||||||||||
| 1329 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "round")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "round" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "round")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "round" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "round")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "round" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1330 | case never executed: Qt::SquareCap:case Qt::SquareCap:never executed: case Qt::SquareCap: | 0 | ||||||||||||||||||||||||||||||||||||
| 1331 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "square")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "square" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "square")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "square" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "square")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "square" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1332 | case never executed: Qt::FlatCap:case Qt::FlatCap:never executed: case Qt::FlatCap: | 0 | ||||||||||||||||||||||||||||||||||||
| 1333 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 1334 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1335 | } | - | ||||||||||||||||||||||||||||||||||||
| 1336 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "butt")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "butt" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "butt")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "butt" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "butt")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "butt" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1337 | } | - | ||||||||||||||||||||||||||||||||||||
| 1338 | - | |||||||||||||||||||||||||||||||||||||
| 1339 | QV4::ReturnedValue QQuickJSContext2D::method_set_lineCap(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1340 | { | - | ||||||||||||||||||||||||||||||||||||
| 1341 | if (!argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1342 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1343 | - | |||||||||||||||||||||||||||||||||||||
| 1344 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1345 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1346 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||||||||||||||
| 1348 | QString lineCap = argv[0].toQString(); | - | ||||||||||||||||||||||||||||||||||||
| 1349 | Qt::PenCapStyle cap; | - | ||||||||||||||||||||||||||||||||||||
| 1350 | if (lineCap == QLatin1String("round")
| 0 | ||||||||||||||||||||||||||||||||||||
| 1351 | cap = Qt::RoundCap; never executed: cap = Qt::RoundCap; | 0 | ||||||||||||||||||||||||||||||||||||
| 1352 | else if (lineCap == QLatin1String("butt")
| 0 | ||||||||||||||||||||||||||||||||||||
| 1353 | cap = Qt::FlatCap; never executed: cap = Qt::FlatCap; | 0 | ||||||||||||||||||||||||||||||||||||
| 1354 | else if (lineCap == QLatin1String("square")
| 0 | ||||||||||||||||||||||||||||||||||||
| 1355 | cap = Qt::SquareCap; never executed: cap = Qt::SquareCap; | 0 | ||||||||||||||||||||||||||||||||||||
| 1356 | else | - | ||||||||||||||||||||||||||||||||||||
| 1357 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1358 | - | |||||||||||||||||||||||||||||||||||||
| 1359 | if (cap != r->d()->context->state.lineCap
| 0 | ||||||||||||||||||||||||||||||||||||
| 1360 | r->d()->context->state.lineCap = cap; | - | ||||||||||||||||||||||||||||||||||||
| 1361 | r->d()->context->buffer()->setLineCap(cap); | - | ||||||||||||||||||||||||||||||||||||
| 1362 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1363 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1364 | } | - | ||||||||||||||||||||||||||||||||||||
| 1365 | QV4::ReturnedValue QQuickJSContext2D::method_get_lineJoin(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1366 | { | - | ||||||||||||||||||||||||||||||||||||
| 1367 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1368 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1369 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1370 | - | |||||||||||||||||||||||||||||||||||||
| 1371 | switch (r->d()->context->state.lineJoin) { | - | ||||||||||||||||||||||||||||||||||||
| 1372 | case never executed: Qt::RoundJoin:case Qt::RoundJoin:never executed: case Qt::RoundJoin: | 0 | ||||||||||||||||||||||||||||||||||||
| 1373 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "round")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "round" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "round")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "round" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "round")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "round" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1374 | case never executed: Qt::BevelJoin:case Qt::BevelJoin:never executed: case Qt::BevelJoin: | 0 | ||||||||||||||||||||||||||||||||||||
| 1375 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "bevel")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bevel" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "bevel")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bevel" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "bevel")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bevel" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1376 | case never executed: Qt::MiterJoin:case Qt::MiterJoin:never executed: case Qt::MiterJoin: | 0 | ||||||||||||||||||||||||||||||||||||
| 1377 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 1378 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1379 | } | - | ||||||||||||||||||||||||||||||||||||
| 1380 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "miter")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "miter" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "miter")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "miter" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "miter")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "miter" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1381 | } | - | ||||||||||||||||||||||||||||||||||||
| 1382 | - | |||||||||||||||||||||||||||||||||||||
| 1383 | QV4::ReturnedValue QQuickJSContext2D::method_set_lineJoin(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1384 | { | - | ||||||||||||||||||||||||||||||||||||
| 1385 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1386 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1387 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1388 | - | |||||||||||||||||||||||||||||||||||||
| 1389 | if (!argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1390 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||||||||||||||
| 1392 | QString lineJoin = argv[0].toQString(); | - | ||||||||||||||||||||||||||||||||||||
| 1393 | Qt::PenJoinStyle join; | - | ||||||||||||||||||||||||||||||||||||
| 1394 | if (lineJoin == QLatin1String("round")
| 0 | ||||||||||||||||||||||||||||||||||||
| 1395 | join = Qt::RoundJoin; never executed: join = Qt::RoundJoin; | 0 | ||||||||||||||||||||||||||||||||||||
| 1396 | else if (lineJoin == QLatin1String("bevel")
| 0 | ||||||||||||||||||||||||||||||||||||
| 1397 | join = Qt::BevelJoin; never executed: join = Qt::BevelJoin; | 0 | ||||||||||||||||||||||||||||||||||||
| 1398 | else if (lineJoin == QLatin1String("miter")
| 0 | ||||||||||||||||||||||||||||||||||||
| 1399 | join = Qt::SvgMiterJoin; never executed: join = Qt::SvgMiterJoin; | 0 | ||||||||||||||||||||||||||||||||||||
| 1400 | else | - | ||||||||||||||||||||||||||||||||||||
| 1401 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1402 | - | |||||||||||||||||||||||||||||||||||||
| 1403 | if (join != r->d()->context->state.lineJoin
| 0 | ||||||||||||||||||||||||||||||||||||
| 1404 | r->d()->context->state.lineJoin = join; | - | ||||||||||||||||||||||||||||||||||||
| 1405 | r->d()->context->buffer()->setLineJoin(join); | - | ||||||||||||||||||||||||||||||||||||
| 1406 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1407 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1408 | } | - | ||||||||||||||||||||||||||||||||||||
| 1409 | - | |||||||||||||||||||||||||||||||||||||
| 1410 | - | |||||||||||||||||||||||||||||||||||||
| 1411 | - | |||||||||||||||||||||||||||||||||||||
| 1412 | - | |||||||||||||||||||||||||||||||||||||
| 1413 | - | |||||||||||||||||||||||||||||||||||||
| 1414 | QV4::ReturnedValue QQuickJSContext2D::method_get_lineWidth(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1415 | { | - | ||||||||||||||||||||||||||||||||||||
| 1416 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1417 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1418 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1419 | - | |||||||||||||||||||||||||||||||||||||
| 1420 | return never executed: QV4::Encode(QV4::Encode(r->d()->context->state.lineWidth));return QV4::Encode(QV4::Encode(r->d()->context->state.lineWidth));never executed: return QV4::Encode(QV4::Encode(r->d()->context->state.lineWidth)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1421 | } | - | ||||||||||||||||||||||||||||||||||||
| 1422 | - | |||||||||||||||||||||||||||||||||||||
| 1423 | QV4::ReturnedValue QQuickJSContext2D::method_set_lineWidth(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1424 | { | - | ||||||||||||||||||||||||||||||||||||
| 1425 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1426 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1427 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1428 | - | |||||||||||||||||||||||||||||||||||||
| 1429 | qreal w = argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1430 | - | |||||||||||||||||||||||||||||||||||||
| 1431 | if (w > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 1432 | r->d()->context->state.lineWidth = w; | - | ||||||||||||||||||||||||||||||||||||
| 1433 | r->d()->context->buffer()->setLineWidth(w); | - | ||||||||||||||||||||||||||||||||||||
| 1434 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1435 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1436 | } | - | ||||||||||||||||||||||||||||||||||||
| 1437 | - | |||||||||||||||||||||||||||||||||||||
| 1438 | - | |||||||||||||||||||||||||||||||||||||
| 1439 | - | |||||||||||||||||||||||||||||||||||||
| 1440 | - | |||||||||||||||||||||||||||||||||||||
| 1441 | - | |||||||||||||||||||||||||||||||||||||
| 1442 | - | |||||||||||||||||||||||||||||||||||||
| 1443 | QV4::ReturnedValue QQuickJSContext2D::method_get_miterLimit(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1444 | { | - | ||||||||||||||||||||||||||||||||||||
| 1445 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1446 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1447 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1448 | - | |||||||||||||||||||||||||||||||||||||
| 1449 | return never executed: QV4::Encode(QV4::Encode(r->d()->context->state.miterLimit));return QV4::Encode(QV4::Encode(r->d()->context->state.miterLimit));never executed: return QV4::Encode(QV4::Encode(r->d()->context->state.miterLimit)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1450 | } | - | ||||||||||||||||||||||||||||||||||||
| 1451 | - | |||||||||||||||||||||||||||||||||||||
| 1452 | QV4::ReturnedValue QQuickJSContext2D::method_set_miterLimit(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1453 | { | - | ||||||||||||||||||||||||||||||||||||
| 1454 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1455 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1456 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1457 | - | |||||||||||||||||||||||||||||||||||||
| 1458 | qreal ml = argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1459 | - | |||||||||||||||||||||||||||||||||||||
| 1460 | if (ml > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 1461 | r->d()->context->state.miterLimit = ml; | - | ||||||||||||||||||||||||||||||||||||
| 1462 | r->d()->context->buffer()->setMiterLimit(ml); | - | ||||||||||||||||||||||||||||||||||||
| 1463 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1464 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1465 | } | - | ||||||||||||||||||||||||||||||||||||
| 1466 | - | |||||||||||||||||||||||||||||||||||||
| 1467 | - | |||||||||||||||||||||||||||||||||||||
| 1468 | - | |||||||||||||||||||||||||||||||||||||
| 1469 | - | |||||||||||||||||||||||||||||||||||||
| 1470 | - | |||||||||||||||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||||||||||||||
| 1472 | QV4::ReturnedValue QQuickJSContext2D::method_get_shadowBlur(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1473 | { | - | ||||||||||||||||||||||||||||||||||||
| 1474 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1475 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1476 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1477 | - | |||||||||||||||||||||||||||||||||||||
| 1478 | return never executed: QV4::Encode(QV4::Encode(r->d()->context->state.shadowBlur));return QV4::Encode(QV4::Encode(r->d()->context->state.shadowBlur));never executed: return QV4::Encode(QV4::Encode(r->d()->context->state.shadowBlur)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1479 | } | - | ||||||||||||||||||||||||||||||||||||
| 1480 | - | |||||||||||||||||||||||||||||||||||||
| 1481 | QV4::ReturnedValue QQuickJSContext2D::method_set_shadowBlur(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1482 | { | - | ||||||||||||||||||||||||||||||||||||
| 1483 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1484 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1485 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1486 | - | |||||||||||||||||||||||||||||||||||||
| 1487 | qreal blur = argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1488 | - | |||||||||||||||||||||||||||||||||||||
| 1489 | if (blur > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 1490 | r->d()->context->state.shadowBlur = blur; | - | ||||||||||||||||||||||||||||||||||||
| 1491 | r->d()->context->buffer()->setShadowBlur(blur); | - | ||||||||||||||||||||||||||||||||||||
| 1492 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1493 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1494 | } | - | ||||||||||||||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||||||||||||||
| 1496 | - | |||||||||||||||||||||||||||||||||||||
| 1497 | - | |||||||||||||||||||||||||||||||||||||
| 1498 | - | |||||||||||||||||||||||||||||||||||||
| 1499 | - | |||||||||||||||||||||||||||||||||||||
| 1500 | QV4::ReturnedValue QQuickJSContext2D::method_get_shadowColor(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1501 | { | - | ||||||||||||||||||||||||||||||||||||
| 1502 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1503 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1504 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1505 | - | |||||||||||||||||||||||||||||||||||||
| 1506 | return never executed: QV4::Encode(scope.engine->newString(r->d()->context->state.shadowColor.name()));return QV4::Encode(scope.engine->newString(r->d()->context->state.shadowColor.name()));never executed: return QV4::Encode(scope.engine->newString(r->d()->context->state.shadowColor.name())); | 0 | ||||||||||||||||||||||||||||||||||||
| 1507 | } | - | ||||||||||||||||||||||||||||||||||||
| 1508 | - | |||||||||||||||||||||||||||||||||||||
| 1509 | QV4::ReturnedValue QQuickJSContext2D::method_set_shadowColor(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1510 | { | - | ||||||||||||||||||||||||||||||||||||
| 1511 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1512 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1513 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1514 | - | |||||||||||||||||||||||||||||||||||||
| 1515 | QColor color; | - | ||||||||||||||||||||||||||||||||||||
| 1516 | if (argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1517 | color = qt_color_from_string(argv[0]); never executed: color = qt_color_from_string(argv[0]); | 0 | ||||||||||||||||||||||||||||||||||||
| 1518 | - | |||||||||||||||||||||||||||||||||||||
| 1519 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1520 | r->d()->context->state.shadowColor = color; | - | ||||||||||||||||||||||||||||||||||||
| 1521 | r->d()->context->buffer()->setShadowColor(color); | - | ||||||||||||||||||||||||||||||||||||
| 1522 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1523 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1524 | } | - | ||||||||||||||||||||||||||||||||||||
| 1525 | QV4::ReturnedValue QQuickJSContext2D::method_get_shadowOffsetX(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1526 | { | - | ||||||||||||||||||||||||||||||||||||
| 1527 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1528 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1529 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1530 | - | |||||||||||||||||||||||||||||||||||||
| 1531 | return never executed: QV4::Encode(QV4::Encode(r->d()->context->state.shadowOffsetX));return QV4::Encode(QV4::Encode(r->d()->context->state.shadowOffsetX));never executed: return QV4::Encode(QV4::Encode(r->d()->context->state.shadowOffsetX)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1532 | } | - | ||||||||||||||||||||||||||||||||||||
| 1533 | - | |||||||||||||||||||||||||||||||||||||
| 1534 | QV4::ReturnedValue QQuickJSContext2D::method_set_shadowOffsetX(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1535 | { | - | ||||||||||||||||||||||||||||||||||||
| 1536 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1537 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1538 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1539 | - | |||||||||||||||||||||||||||||||||||||
| 1540 | qreal offsetX = argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1541 | if (qt_is_finite(offsetX)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1542 | r->d()->context->state.shadowOffsetX = offsetX; | - | ||||||||||||||||||||||||||||||||||||
| 1543 | r->d()->context->buffer()->setShadowOffsetX(offsetX); | - | ||||||||||||||||||||||||||||||||||||
| 1544 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1545 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1546 | } | - | ||||||||||||||||||||||||||||||||||||
| 1547 | - | |||||||||||||||||||||||||||||||||||||
| 1548 | - | |||||||||||||||||||||||||||||||||||||
| 1549 | - | |||||||||||||||||||||||||||||||||||||
| 1550 | - | |||||||||||||||||||||||||||||||||||||
| 1551 | - | |||||||||||||||||||||||||||||||||||||
| 1552 | - | |||||||||||||||||||||||||||||||||||||
| 1553 | QV4::ReturnedValue QQuickJSContext2D::method_get_shadowOffsetY(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1554 | { | - | ||||||||||||||||||||||||||||||||||||
| 1555 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1556 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1557 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1558 | - | |||||||||||||||||||||||||||||||||||||
| 1559 | return never executed: QV4::Encode(QV4::Encode(r->d()->context->state.shadowOffsetY));return QV4::Encode(QV4::Encode(r->d()->context->state.shadowOffsetY));never executed: return QV4::Encode(QV4::Encode(r->d()->context->state.shadowOffsetY)); | 0 | ||||||||||||||||||||||||||||||||||||
| 1560 | } | - | ||||||||||||||||||||||||||||||||||||
| 1561 | - | |||||||||||||||||||||||||||||||||||||
| 1562 | QV4::ReturnedValue QQuickJSContext2D::method_set_shadowOffsetY(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1563 | { | - | ||||||||||||||||||||||||||||||||||||
| 1564 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1565 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1566 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1567 | - | |||||||||||||||||||||||||||||||||||||
| 1568 | qreal offsetY = argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 1569 | if (qt_is_finite(offsetY)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1570 | r->d()->context->state.shadowOffsetY = offsetY; | - | ||||||||||||||||||||||||||||||||||||
| 1571 | r->d()->context->buffer()->setShadowOffsetY(offsetY); | - | ||||||||||||||||||||||||||||||||||||
| 1572 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1573 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1574 | } | - | ||||||||||||||||||||||||||||||||||||
| 1575 | - | |||||||||||||||||||||||||||||||||||||
| 1576 | - | |||||||||||||||||||||||||||||||||||||
| 1577 | QV4::ReturnedValue QQuickJSContext2D::method_get_path(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1578 | { | - | ||||||||||||||||||||||||||||||||||||
| 1579 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1580 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1581 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1582 | - | |||||||||||||||||||||||||||||||||||||
| 1583 | return never executed: QV4::Encode(r->d()->context->m_v4path.value());return QV4::Encode(r->d()->context->m_v4path.value());never executed: return QV4::Encode(r->d()->context->m_v4path.value()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1584 | } | - | ||||||||||||||||||||||||||||||||||||
| 1585 | - | |||||||||||||||||||||||||||||||||||||
| 1586 | QV4::ReturnedValue QQuickJSContext2D::method_set_path(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1587 | { | - | ||||||||||||||||||||||||||||||||||||
| 1588 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1589 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1590 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1591 | - | |||||||||||||||||||||||||||||||||||||
| 1592 | QV4::ScopedValue value(scope, argc ? argv[0] : QV4::Primitive::undefinedValue()); | - | ||||||||||||||||||||||||||||||||||||
| 1593 | r->d()->context->beginPath(); | - | ||||||||||||||||||||||||||||||||||||
| 1594 | QV4::Scoped<QV4::QObjectWrapper> qobjectWrapper(scope, value); | - | ||||||||||||||||||||||||||||||||||||
| 1595 | if (!!qobjectWrapper
| 0 | ||||||||||||||||||||||||||||||||||||
| 1596 | if (QQuickPath *path = qobject_cast<QQuickPath*>(qobjectWrapper->object())
| 0 | ||||||||||||||||||||||||||||||||||||
| 1597 | r->d()->context->m_path = path->path(); never executed: r->d()->context->m_path = path->path(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1598 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1599 | QString path =value->toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||
| 1600 | QQuickSvgParser::parsePathDataFast(path, r->d()->context->m_path); | - | ||||||||||||||||||||||||||||||||||||
| 1601 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1602 | r->d()->context->m_v4path.set(scope.engine, value); | - | ||||||||||||||||||||||||||||||||||||
| 1603 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1604 | } | - | ||||||||||||||||||||||||||||||||||||
| 1605 | - | |||||||||||||||||||||||||||||||||||||
| 1606 | - | |||||||||||||||||||||||||||||||||||||
| 1607 | - | |||||||||||||||||||||||||||||||||||||
| 1608 | - | |||||||||||||||||||||||||||||||||||||
| 1609 | - | |||||||||||||||||||||||||||||||||||||
| 1610 | - | |||||||||||||||||||||||||||||||||||||
| 1611 | - | |||||||||||||||||||||||||||||||||||||
| 1612 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_clearRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1613 | { | - | ||||||||||||||||||||||||||||||||||||
| 1614 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1615 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1616 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1617 | - | |||||||||||||||||||||||||||||||||||||
| 1618 | - | |||||||||||||||||||||||||||||||||||||
| 1619 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 1620 | r->d()->context->clearRect(argv[0].toNumber(), never executed: r->d()->context->clearRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1621 | argv[1].toNumber(), never executed: r->d()->context->clearRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1622 | argv[2].toNumber(), never executed: r->d()->context->clearRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1623 | argv[3].toNumber()); never executed: r->d()->context->clearRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1624 | - | |||||||||||||||||||||||||||||||||||||
| 1625 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1626 | - | |||||||||||||||||||||||||||||||||||||
| 1627 | } | - | ||||||||||||||||||||||||||||||||||||
| 1628 | - | |||||||||||||||||||||||||||||||||||||
| 1629 | - | |||||||||||||||||||||||||||||||||||||
| 1630 | - | |||||||||||||||||||||||||||||||||||||
| 1631 | - | |||||||||||||||||||||||||||||||||||||
| 1632 | - | |||||||||||||||||||||||||||||||||||||
| 1633 | - | |||||||||||||||||||||||||||||||||||||
| 1634 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_fillRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1635 | { | - | ||||||||||||||||||||||||||||||||||||
| 1636 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1637 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1638 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1639 | - | |||||||||||||||||||||||||||||||||||||
| 1640 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 1641 | r->d()->context->fillRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); never executed: r->d()->context->fillRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1642 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1643 | - | |||||||||||||||||||||||||||||||||||||
| 1644 | } | - | ||||||||||||||||||||||||||||||||||||
| 1645 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_strokeRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1646 | { | - | ||||||||||||||||||||||||||||||||||||
| 1647 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1648 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1649 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1650 | - | |||||||||||||||||||||||||||||||||||||
| 1651 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 1652 | r->d()->context->strokeRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); never executed: r->d()->context->strokeRect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1653 | - | |||||||||||||||||||||||||||||||||||||
| 1654 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1655 | - | |||||||||||||||||||||||||||||||||||||
| 1656 | } | - | ||||||||||||||||||||||||||||||||||||
| 1657 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_arc(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1658 | { | - | ||||||||||||||||||||||||||||||||||||
| 1659 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1660 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1661 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1662 | - | |||||||||||||||||||||||||||||||||||||
| 1663 | if (argc >= 5
| 0 | ||||||||||||||||||||||||||||||||||||
| 1664 | bool antiClockwise = false; | - | ||||||||||||||||||||||||||||||||||||
| 1665 | - | |||||||||||||||||||||||||||||||||||||
| 1666 | if (argc == 6
| 0 | ||||||||||||||||||||||||||||||||||||
| 1667 | antiClockwise = argv[5].toBoolean(); never executed: antiClockwise = argv[5].toBoolean(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1668 | - | |||||||||||||||||||||||||||||||||||||
| 1669 | qreal radius = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1670 | - | |||||||||||||||||||||||||||||||||||||
| 1671 | if (qt_is_finite(radius)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1672 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "Incorrect argument radius")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Incorrect argument radius" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1673 | - | |||||||||||||||||||||||||||||||||||||
| 1674 | r->d()->context->arc(argv[0].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1675 | argv[1].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1676 | radius, | - | ||||||||||||||||||||||||||||||||||||
| 1677 | argv[3].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1678 | argv[4].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1679 | antiClockwise); | - | ||||||||||||||||||||||||||||||||||||
| 1680 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1681 | - | |||||||||||||||||||||||||||||||||||||
| 1682 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1683 | - | |||||||||||||||||||||||||||||||||||||
| 1684 | } | - | ||||||||||||||||||||||||||||||||||||
| 1685 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_arcTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1686 | { | - | ||||||||||||||||||||||||||||||||||||
| 1687 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1688 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1689 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1690 | - | |||||||||||||||||||||||||||||||||||||
| 1691 | if (argc >= 5
| 0 | ||||||||||||||||||||||||||||||||||||
| 1692 | qreal radius = argv[4].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1693 | - | |||||||||||||||||||||||||||||||||||||
| 1694 | if (qt_is_finite(radius)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1695 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "Incorrect argument radius")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Incorrect argument radius" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1696 | - | |||||||||||||||||||||||||||||||||||||
| 1697 | r->d()->context->arcTo(argv[0].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1698 | argv[1].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1699 | argv[2].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1700 | argv[3].toNumber(), | - | ||||||||||||||||||||||||||||||||||||
| 1701 | radius); | - | ||||||||||||||||||||||||||||||||||||
| 1702 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1703 | - | |||||||||||||||||||||||||||||||||||||
| 1704 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1705 | - | |||||||||||||||||||||||||||||||||||||
| 1706 | } | - | ||||||||||||||||||||||||||||||||||||
| 1707 | - | |||||||||||||||||||||||||||||||||||||
| 1708 | - | |||||||||||||||||||||||||||||||||||||
| 1709 | - | |||||||||||||||||||||||||||||||||||||
| 1710 | - | |||||||||||||||||||||||||||||||||||||
| 1711 | - | |||||||||||||||||||||||||||||||||||||
| 1712 | - | |||||||||||||||||||||||||||||||||||||
| 1713 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_beginPath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1714 | { | - | ||||||||||||||||||||||||||||||||||||
| 1715 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1716 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1717 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1718 | - | |||||||||||||||||||||||||||||||||||||
| 1719 | r->d()->context->beginPath(); | - | ||||||||||||||||||||||||||||||||||||
| 1720 | - | |||||||||||||||||||||||||||||||||||||
| 1721 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1722 | - | |||||||||||||||||||||||||||||||||||||
| 1723 | } | - | ||||||||||||||||||||||||||||||||||||
| 1724 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_bezierCurveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1725 | { | - | ||||||||||||||||||||||||||||||||||||
| 1726 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1727 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1728 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1729 | - | |||||||||||||||||||||||||||||||||||||
| 1730 | if (argc >= 6
| 0 | ||||||||||||||||||||||||||||||||||||
| 1731 | qreal cp1x = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1732 | qreal cp1y = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1733 | qreal cp2x = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1734 | qreal cp2y = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1735 | qreal x = argv[4].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1736 | qreal y = argv[5].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1737 | - | |||||||||||||||||||||||||||||||||||||
| 1738 | if (!qt_is_finite(cp1x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1739 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1740 | - | |||||||||||||||||||||||||||||||||||||
| 1741 | r->d()->context->bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); | - | ||||||||||||||||||||||||||||||||||||
| 1742 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1743 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1744 | } | - | ||||||||||||||||||||||||||||||||||||
| 1745 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_clip(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1746 | { | - | ||||||||||||||||||||||||||||||||||||
| 1747 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1748 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1749 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1750 | - | |||||||||||||||||||||||||||||||||||||
| 1751 | r->d()->context->clip(); | - | ||||||||||||||||||||||||||||||||||||
| 1752 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1753 | } | - | ||||||||||||||||||||||||||||||||||||
| 1754 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_closePath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1755 | { | - | ||||||||||||||||||||||||||||||||||||
| 1756 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1757 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1758 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1759 | - | |||||||||||||||||||||||||||||||||||||
| 1760 | r->d()->context->closePath(); | - | ||||||||||||||||||||||||||||||||||||
| 1761 | - | |||||||||||||||||||||||||||||||||||||
| 1762 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1763 | } | - | ||||||||||||||||||||||||||||||||||||
| 1764 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_fill(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1765 | { | - | ||||||||||||||||||||||||||||||||||||
| 1766 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1767 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1768 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: ;return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1769 | r->d()->context->fill(); | - | ||||||||||||||||||||||||||||||||||||
| 1770 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1771 | } | - | ||||||||||||||||||||||||||||||||||||
| 1772 | - | |||||||||||||||||||||||||||||||||||||
| 1773 | - | |||||||||||||||||||||||||||||||||||||
| 1774 | - | |||||||||||||||||||||||||||||||||||||
| 1775 | - | |||||||||||||||||||||||||||||||||||||
| 1776 | - | |||||||||||||||||||||||||||||||||||||
| 1777 | - | |||||||||||||||||||||||||||||||||||||
| 1778 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_lineTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1779 | { | - | ||||||||||||||||||||||||||||||||||||
| 1780 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1781 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1782 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1783 | - | |||||||||||||||||||||||||||||||||||||
| 1784 | if (argc >= 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 1785 | qreal x = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1786 | qreal y = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1787 | - | |||||||||||||||||||||||||||||||||||||
| 1788 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1789 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1790 | - | |||||||||||||||||||||||||||||||||||||
| 1791 | r->d()->context->lineTo(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 1792 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1793 | - | |||||||||||||||||||||||||||||||||||||
| 1794 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1795 | } | - | ||||||||||||||||||||||||||||||||||||
| 1796 | - | |||||||||||||||||||||||||||||||||||||
| 1797 | - | |||||||||||||||||||||||||||||||||||||
| 1798 | - | |||||||||||||||||||||||||||||||||||||
| 1799 | - | |||||||||||||||||||||||||||||||||||||
| 1800 | - | |||||||||||||||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||||||||||||||
| 1802 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_moveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1803 | { | - | ||||||||||||||||||||||||||||||||||||
| 1804 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1805 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1806 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1807 | - | |||||||||||||||||||||||||||||||||||||
| 1808 | if (argc >= 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 1809 | qreal x = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1810 | qreal y = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1811 | - | |||||||||||||||||||||||||||||||||||||
| 1812 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1813 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1814 | r->d()->context->moveTo(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 1815 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1816 | - | |||||||||||||||||||||||||||||||||||||
| 1817 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1818 | } | - | ||||||||||||||||||||||||||||||||||||
| 1819 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_quadraticCurveTo(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1820 | { | - | ||||||||||||||||||||||||||||||||||||
| 1821 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1822 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1823 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||||||||||||||
| 1825 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 1826 | qreal cpx = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1827 | qreal cpy = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1828 | qreal x = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1829 | qreal y = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1830 | - | |||||||||||||||||||||||||||||||||||||
| 1831 | if (!qt_is_finite(cpx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1832 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1833 | - | |||||||||||||||||||||||||||||||||||||
| 1834 | r->d()->context->quadraticCurveTo(cpx, cpy, x, y); | - | ||||||||||||||||||||||||||||||||||||
| 1835 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1836 | - | |||||||||||||||||||||||||||||||||||||
| 1837 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1838 | } | - | ||||||||||||||||||||||||||||||||||||
| 1839 | - | |||||||||||||||||||||||||||||||||||||
| 1840 | - | |||||||||||||||||||||||||||||||||||||
| 1841 | - | |||||||||||||||||||||||||||||||||||||
| 1842 | - | |||||||||||||||||||||||||||||||||||||
| 1843 | - | |||||||||||||||||||||||||||||||||||||
| 1844 | - | |||||||||||||||||||||||||||||||||||||
| 1845 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_rect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1846 | { | - | ||||||||||||||||||||||||||||||||||||
| 1847 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1848 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1849 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1850 | - | |||||||||||||||||||||||||||||||||||||
| 1851 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 1852 | r->d()->context->rect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); never executed: r->d()->context->rect(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1853 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1854 | - | |||||||||||||||||||||||||||||||||||||
| 1855 | } | - | ||||||||||||||||||||||||||||||||||||
| 1856 | - | |||||||||||||||||||||||||||||||||||||
| 1857 | - | |||||||||||||||||||||||||||||||||||||
| 1858 | - | |||||||||||||||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||||||||||||||
| 1860 | - | |||||||||||||||||||||||||||||||||||||
| 1861 | - | |||||||||||||||||||||||||||||||||||||
| 1862 | - | |||||||||||||||||||||||||||||||||||||
| 1863 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_roundedRect(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1864 | { | - | ||||||||||||||||||||||||||||||||||||
| 1865 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1866 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1867 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1868 | - | |||||||||||||||||||||||||||||||||||||
| 1869 | if (argc >= 6
| 0 | ||||||||||||||||||||||||||||||||||||
| 1870 | r->d()->context->roundedRect(argv[0].toNumber() never executed: r->d()->context->roundedRect(argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1871 | , argv[1].toNumber() never executed: r->d()->context->roundedRect(argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1872 | , argv[2].toNumber() never executed: r->d()->context->roundedRect(argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1873 | , argv[3].toNumber() never executed: r->d()->context->roundedRect(argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1874 | , argv[4].toNumber() never executed: r->d()->context->roundedRect(argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1875 | , argv[5].toNumber()); never executed: r->d()->context->roundedRect(argv[0].toNumber() , argv[1].toNumber() , argv[2].toNumber() , argv[3].toNumber() , argv[4].toNumber() , argv[5].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1876 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1877 | - | |||||||||||||||||||||||||||||||||||||
| 1878 | } | - | ||||||||||||||||||||||||||||||||||||
| 1879 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_ellipse(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1880 | { | - | ||||||||||||||||||||||||||||||||||||
| 1881 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1882 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1883 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1884 | - | |||||||||||||||||||||||||||||||||||||
| 1885 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 1886 | r->d()->context->ellipse(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); never executed: r->d()->context->ellipse(argv[0].toNumber(), argv[1].toNumber(), argv[2].toNumber(), argv[3].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1887 | - | |||||||||||||||||||||||||||||||||||||
| 1888 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1889 | - | |||||||||||||||||||||||||||||||||||||
| 1890 | } | - | ||||||||||||||||||||||||||||||||||||
| 1891 | - | |||||||||||||||||||||||||||||||||||||
| 1892 | - | |||||||||||||||||||||||||||||||||||||
| 1893 | - | |||||||||||||||||||||||||||||||||||||
| 1894 | - | |||||||||||||||||||||||||||||||||||||
| 1895 | - | |||||||||||||||||||||||||||||||||||||
| 1896 | - | |||||||||||||||||||||||||||||||||||||
| 1897 | - | |||||||||||||||||||||||||||||||||||||
| 1898 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_text(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1899 | { | - | ||||||||||||||||||||||||||||||||||||
| 1900 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1901 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1902 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1903 | - | |||||||||||||||||||||||||||||||||||||
| 1904 | if (argc >= 3
| 0 | ||||||||||||||||||||||||||||||||||||
| 1905 | qreal x = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1906 | qreal y = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 1907 | - | |||||||||||||||||||||||||||||||||||||
| 1908 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1909 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1910 | r->d()->context->text(argv[0].toQStringNoThrow(), x, y); | - | ||||||||||||||||||||||||||||||||||||
| 1911 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1912 | - | |||||||||||||||||||||||||||||||||||||
| 1913 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1914 | } | - | ||||||||||||||||||||||||||||||||||||
| 1915 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_stroke(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1916 | { | - | ||||||||||||||||||||||||||||||||||||
| 1917 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1918 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1919 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1920 | - | |||||||||||||||||||||||||||||||||||||
| 1921 | r->d()->context->stroke(); | - | ||||||||||||||||||||||||||||||||||||
| 1922 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 1923 | - | |||||||||||||||||||||||||||||||||||||
| 1924 | } | - | ||||||||||||||||||||||||||||||||||||
| 1925 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_isPointInPath(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1926 | { | - | ||||||||||||||||||||||||||||||||||||
| 1927 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1928 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1929 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1930 | - | |||||||||||||||||||||||||||||||||||||
| 1931 | bool pointInPath = false; | - | ||||||||||||||||||||||||||||||||||||
| 1932 | if (argc >= 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 1933 | pointInPath = r->d()->context->isPointInPath(argv[0].toNumber(), argv[1].toNumber()); never executed: pointInPath = r->d()->context->isPointInPath(argv[0].toNumber(), argv[1].toNumber()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1934 | return never executed: QV4::Encode(QV4::Primitive::fromBoolean(pointInPath).asReturnedValue());return QV4::Encode(QV4::Primitive::fromBoolean(pointInPath).asReturnedValue());never executed: return QV4::Encode(QV4::Primitive::fromBoolean(pointInPath).asReturnedValue()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1935 | } | - | ||||||||||||||||||||||||||||||||||||
| 1936 | - | |||||||||||||||||||||||||||||||||||||
| 1937 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_drawFocusRing(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1938 | { | - | ||||||||||||||||||||||||||||||||||||
| 1939 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1940 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "Context2D::drawFocusRing is not supported")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Context2D::drawFocusRing is not supported" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1941 | } | - | ||||||||||||||||||||||||||||||||||||
| 1942 | - | |||||||||||||||||||||||||||||||||||||
| 1943 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_setCaretSelectionRect(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1944 | { | - | ||||||||||||||||||||||||||||||||||||
| 1945 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1946 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "Context2D::setCaretSelectionRect is not supported")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Context2D::setCaretSelectionRect is not supported" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1947 | } | - | ||||||||||||||||||||||||||||||||||||
| 1948 | - | |||||||||||||||||||||||||||||||||||||
| 1949 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_caretBlinkRate(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1950 | { | - | ||||||||||||||||||||||||||||||||||||
| 1951 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1952 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "Context2D::caretBlinkRate is not supported")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Context2D::caretBlinkRate is not supported" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 1953 | } | - | ||||||||||||||||||||||||||||||||||||
| 1954 | QV4::ReturnedValue QQuickJSContext2D::method_get_font(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1955 | { | - | ||||||||||||||||||||||||||||||||||||
| 1956 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1957 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1958 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1959 | - | |||||||||||||||||||||||||||||||||||||
| 1960 | return never executed: QV4::Encode(scope.engine->newString(r->d()->context->state.font.toString()));return QV4::Encode(scope.engine->newString(r->d()->context->state.font.toString()));never executed: return QV4::Encode(scope.engine->newString(r->d()->context->state.font.toString())); | 0 | ||||||||||||||||||||||||||||||||||||
| 1961 | } | - | ||||||||||||||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||||||||||||||
| 1963 | QV4::ReturnedValue QQuickJSContext2D::method_set_font(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 1964 | { | - | ||||||||||||||||||||||||||||||||||||
| 1965 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1966 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1967 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1968 | - | |||||||||||||||||||||||||||||||||||||
| 1969 | QV4::ScopedString s(scope, argc ? argv[0] : QV4::Primitive::undefinedValue(), QV4::ScopedString::Convert); | - | ||||||||||||||||||||||||||||||||||||
| 1970 | if (scope.engine->hasException
| 0 | ||||||||||||||||||||||||||||||||||||
| 1971 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1972 | QFont font = qt_font_from_string(s->toQString(), r->d()->context->state.font); | - | ||||||||||||||||||||||||||||||||||||
| 1973 | if (font != r->d()->context->state.font
| 0 | ||||||||||||||||||||||||||||||||||||
| 1974 | r->d()->context->state.font = font; | - | ||||||||||||||||||||||||||||||||||||
| 1975 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1976 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1977 | } | - | ||||||||||||||||||||||||||||||||||||
| 1978 | QV4::ReturnedValue QQuickJSContext2D::method_get_textAlign(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 1979 | { | - | ||||||||||||||||||||||||||||||||||||
| 1980 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 1981 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 1982 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 1983 | - | |||||||||||||||||||||||||||||||||||||
| 1984 | switch (r->d()->context->state.textAlign) { | - | ||||||||||||||||||||||||||||||||||||
| 1985 | case never executed: QQuickContext2D::End:case QQuickContext2D::End:never executed: case QQuickContext2D::End: | 0 | ||||||||||||||||||||||||||||||||||||
| 1986 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "end")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "end" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "end")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "end" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "end")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "end" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1987 | case never executed: QQuickContext2D::Left:case QQuickContext2D::Left:never executed: case QQuickContext2D::Left: | 0 | ||||||||||||||||||||||||||||||||||||
| 1988 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "left")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "left" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "left")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "left" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "left")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "left" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1989 | case never executed: QQuickContext2D::Right:case QQuickContext2D::Right:never executed: case QQuickContext2D::Right: | 0 | ||||||||||||||||||||||||||||||||||||
| 1990 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "right")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "right" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "right")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "right" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "right")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "right" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1991 | case never executed: QQuickContext2D::Center:case QQuickContext2D::Center:never executed: case QQuickContext2D::Center: | 0 | ||||||||||||||||||||||||||||||||||||
| 1992 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "center")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "center" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "center")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "center" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "center")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "center" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1993 | case never executed: QQuickContext2D::Start:case QQuickContext2D::Start:never executed: case QQuickContext2D::Start: | 0 | ||||||||||||||||||||||||||||||||||||
| 1994 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 1995 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1996 | } | - | ||||||||||||||||||||||||||||||||||||
| 1997 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "start")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "start" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "start")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "start" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "start")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "start" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1998 | } | - | ||||||||||||||||||||||||||||||||||||
| 1999 | - | |||||||||||||||||||||||||||||||||||||
| 2000 | QV4::ReturnedValue QQuickJSContext2D::method_set_textAlign(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2001 | { | - | ||||||||||||||||||||||||||||||||||||
| 2002 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2003 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2004 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2005 | - | |||||||||||||||||||||||||||||||||||||
| 2006 | QV4::ScopedString s(scope, argc ? argv[0] : QV4::Primitive::undefinedValue(), QV4::ScopedString::Convert); | - | ||||||||||||||||||||||||||||||||||||
| 2007 | if (scope.engine->hasException
| 0 | ||||||||||||||||||||||||||||||||||||
| 2008 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2009 | QString textAlign = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||
| 2010 | - | |||||||||||||||||||||||||||||||||||||
| 2011 | QQuickContext2D::TextAlignType ta; | - | ||||||||||||||||||||||||||||||||||||
| 2012 | if (textAlign == QLatin1String("start")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2013 | ta = QQuickContext2D::Start; never executed: ta = QQuickContext2D::Start; | 0 | ||||||||||||||||||||||||||||||||||||
| 2014 | else if (textAlign == QLatin1String("end")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2015 | ta = QQuickContext2D::End; never executed: ta = QQuickContext2D::End; | 0 | ||||||||||||||||||||||||||||||||||||
| 2016 | else if (textAlign == QLatin1String("left")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2017 | ta = QQuickContext2D::Left; never executed: ta = QQuickContext2D::Left; | 0 | ||||||||||||||||||||||||||||||||||||
| 2018 | else if (textAlign == QLatin1String("right")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2019 | ta = QQuickContext2D::Right; never executed: ta = QQuickContext2D::Right; | 0 | ||||||||||||||||||||||||||||||||||||
| 2020 | else if (textAlign == QLatin1String("center")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2021 | ta = QQuickContext2D::Center; never executed: ta = QQuickContext2D::Center; | 0 | ||||||||||||||||||||||||||||||||||||
| 2022 | else | - | ||||||||||||||||||||||||||||||||||||
| 2023 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2024 | - | |||||||||||||||||||||||||||||||||||||
| 2025 | if (ta != r->d()->context->state.textAlign
| 0 | ||||||||||||||||||||||||||||||||||||
| 2026 | r->d()->context->state.textAlign = ta; never executed: r->d()->context->state.textAlign = ta; | 0 | ||||||||||||||||||||||||||||||||||||
| 2027 | - | |||||||||||||||||||||||||||||||||||||
| 2028 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2029 | } | - | ||||||||||||||||||||||||||||||||||||
| 2030 | QV4::ReturnedValue QQuickJSContext2D::method_get_textBaseline(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 2031 | { | - | ||||||||||||||||||||||||||||||||||||
| 2032 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2033 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2034 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2035 | - | |||||||||||||||||||||||||||||||||||||
| 2036 | switch (r->d()->context->state.textBaseline) { | - | ||||||||||||||||||||||||||||||||||||
| 2037 | case never executed: QQuickContext2D::Hanging:case QQuickContext2D::Hanging:never executed: case QQuickContext2D::Hanging: | 0 | ||||||||||||||||||||||||||||||||||||
| 2038 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "hanging")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "hanging" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "hanging")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "hanging" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "hanging")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "hanging" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 2039 | case never executed: QQuickContext2D::Top:case QQuickContext2D::Top:never executed: case QQuickContext2D::Top: | 0 | ||||||||||||||||||||||||||||||||||||
| 2040 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "top")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "top" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "top")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "top" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "top")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "top" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 2041 | case never executed: QQuickContext2D::Bottom:case QQuickContext2D::Bottom:never executed: case QQuickContext2D::Bottom: | 0 | ||||||||||||||||||||||||||||||||||||
| 2042 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "bottom")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bottom" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "bottom")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bottom" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "bottom")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "bottom" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 2043 | case never executed: QQuickContext2D::Middle:case QQuickContext2D::Middle:never executed: case QQuickContext2D::Middle: | 0 | ||||||||||||||||||||||||||||||||||||
| 2044 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "middle")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "middle" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "middle")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "middle" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "middle")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "middle" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 2045 | case never executed: QQuickContext2D::Alphabetic:case QQuickContext2D::Alphabetic:never executed: case QQuickContext2D::Alphabetic: | 0 | ||||||||||||||||||||||||||||||||||||
| 2046 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 2047 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2048 | } | - | ||||||||||||||||||||||||||||||||||||
| 2049 | return never executed: QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "alphabetic")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "alphabetic" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "alphabetic")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "alphabetic" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }())));return qstring_literal_temp;never executed: return QV4::Encode(scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "alphabetic")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "alphabetic" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()))); | 0 | ||||||||||||||||||||||||||||||||||||
| 2050 | } | - | ||||||||||||||||||||||||||||||||||||
| 2051 | - | |||||||||||||||||||||||||||||||||||||
| 2052 | QV4::ReturnedValue QQuickJSContext2D::method_set_textBaseline(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2053 | { | - | ||||||||||||||||||||||||||||||||||||
| 2054 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2055 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2056 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2057 | QV4::ScopedString s(scope, argc ? argv[0] : QV4::Primitive::undefinedValue(), QV4::ScopedString::Convert); | - | ||||||||||||||||||||||||||||||||||||
| 2058 | if (scope.engine->hasException
| 0 | ||||||||||||||||||||||||||||||||||||
| 2059 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2060 | QString textBaseline = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||
| 2061 | - | |||||||||||||||||||||||||||||||||||||
| 2062 | QQuickContext2D::TextBaseLineType tb; | - | ||||||||||||||||||||||||||||||||||||
| 2063 | if (textBaseline == QLatin1String("alphabetic")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2064 | tb = QQuickContext2D::Alphabetic; never executed: tb = QQuickContext2D::Alphabetic; | 0 | ||||||||||||||||||||||||||||||||||||
| 2065 | else if (textBaseline == QLatin1String("hanging")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2066 | tb = QQuickContext2D::Hanging; never executed: tb = QQuickContext2D::Hanging; | 0 | ||||||||||||||||||||||||||||||||||||
| 2067 | else if (textBaseline == QLatin1String("top")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2068 | tb = QQuickContext2D::Top; never executed: tb = QQuickContext2D::Top; | 0 | ||||||||||||||||||||||||||||||||||||
| 2069 | else if (textBaseline == QLatin1String("bottom")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2070 | tb = QQuickContext2D::Bottom; never executed: tb = QQuickContext2D::Bottom; | 0 | ||||||||||||||||||||||||||||||||||||
| 2071 | else if (textBaseline == QLatin1String("middle")
| 0 | ||||||||||||||||||||||||||||||||||||
| 2072 | tb = QQuickContext2D::Middle; never executed: tb = QQuickContext2D::Middle; | 0 | ||||||||||||||||||||||||||||||||||||
| 2073 | else | - | ||||||||||||||||||||||||||||||||||||
| 2074 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2075 | - | |||||||||||||||||||||||||||||||||||||
| 2076 | if (tb != r->d()->context->state.textBaseline
| 0 | ||||||||||||||||||||||||||||||||||||
| 2077 | r->d()->context->state.textBaseline = tb; never executed: r->d()->context->state.textBaseline = tb; | 0 | ||||||||||||||||||||||||||||||||||||
| 2078 | - | |||||||||||||||||||||||||||||||||||||
| 2079 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2080 | } | - | ||||||||||||||||||||||||||||||||||||
| 2081 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_fillText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2082 | { | - | ||||||||||||||||||||||||||||||||||||
| 2083 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2084 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2085 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2086 | - | |||||||||||||||||||||||||||||||||||||
| 2087 | if (argc >= 3
| 0 | ||||||||||||||||||||||||||||||||||||
| 2088 | qreal x = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2089 | qreal y = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2090 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2091 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2092 | QPainterPath textPath = r->d()->context->createTextGlyphs(x, y, argv[0].toQStringNoThrow()); | - | ||||||||||||||||||||||||||||||||||||
| 2093 | r->d()->context->buffer()->fill(textPath); | - | ||||||||||||||||||||||||||||||||||||
| 2094 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2095 | - | |||||||||||||||||||||||||||||||||||||
| 2096 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 2097 | } | - | ||||||||||||||||||||||||||||||||||||
| 2098 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_strokeText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2099 | { | - | ||||||||||||||||||||||||||||||||||||
| 2100 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2101 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2102 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2103 | - | |||||||||||||||||||||||||||||||||||||
| 2104 | if (argc >= 3
| 0 | ||||||||||||||||||||||||||||||||||||
| 2105 | r->d()->context->drawText(argv[0].toQStringNoThrow(), argv[1].toNumber(), argv[2].toNumber(), false); never executed: r->d()->context->drawText(argv[0].toQStringNoThrow(), argv[1].toNumber(), argv[2].toNumber(), false); | 0 | ||||||||||||||||||||||||||||||||||||
| 2106 | - | |||||||||||||||||||||||||||||||||||||
| 2107 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 2108 | } | - | ||||||||||||||||||||||||||||||||||||
| 2109 | - | |||||||||||||||||||||||||||||||||||||
| 2110 | - | |||||||||||||||||||||||||||||||||||||
| 2111 | - | |||||||||||||||||||||||||||||||||||||
| 2112 | - | |||||||||||||||||||||||||||||||||||||
| 2113 | - | |||||||||||||||||||||||||||||||||||||
| 2114 | - | |||||||||||||||||||||||||||||||||||||
| 2115 | - | |||||||||||||||||||||||||||||||||||||
| 2116 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_measureText(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2117 | { | - | ||||||||||||||||||||||||||||||||||||
| 2118 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2119 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2120 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2121 | - | |||||||||||||||||||||||||||||||||||||
| 2122 | if (argc >= 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 2123 | QFontMetrics fm(r->d()->context->state.font); | - | ||||||||||||||||||||||||||||||||||||
| 2124 | uint width = fm.width(argv[0].toQStringNoThrow()); | - | ||||||||||||||||||||||||||||||||||||
| 2125 | QV4::ScopedObject tm(scope, scope.engine->newObject()); | - | ||||||||||||||||||||||||||||||||||||
| 2126 | tm->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "width")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "width" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))).getPointer(),return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 2127 | QV4::ScopedValue(scope, QV4::Primitive::fromDouble(width))); | - | ||||||||||||||||||||||||||||||||||||
| 2128 | return never executed: QV4::Encode(*tm);return QV4::Encode(*tm);never executed: return QV4::Encode(*tm); | 0 | ||||||||||||||||||||||||||||||||||||
| 2129 | } | - | ||||||||||||||||||||||||||||||||||||
| 2130 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2131 | } | - | ||||||||||||||||||||||||||||||||||||
| 2132 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_drawImage(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2133 | { | - | ||||||||||||||||||||||||||||||||||||
| 2134 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2135 | QV4::Scoped<QQuickJSContext2D> r(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2136 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2137 | - | |||||||||||||||||||||||||||||||||||||
| 2138 | qreal sx, sy, sw, sh, dx, dy, dw, dh; | - | ||||||||||||||||||||||||||||||||||||
| 2139 | - | |||||||||||||||||||||||||||||||||||||
| 2140 | if (!argc
| 0 | ||||||||||||||||||||||||||||||||||||
| 2141 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2142 | - | |||||||||||||||||||||||||||||||||||||
| 2143 | - | |||||||||||||||||||||||||||||||||||||
| 2144 | if (!r->d()->context->state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2145 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2146 | - | |||||||||||||||||||||||||||||||||||||
| 2147 | QQmlRefPointer<QQuickCanvasPixmap> pixmap; | - | ||||||||||||||||||||||||||||||||||||
| 2148 | - | |||||||||||||||||||||||||||||||||||||
| 2149 | QV4::ScopedValue arg(scope, argv[0]); | - | ||||||||||||||||||||||||||||||||||||
| 2150 | if (arg->isString()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2151 | QUrl url(arg->toQString()); | - | ||||||||||||||||||||||||||||||||||||
| 2152 | if (!url.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2153 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawImage(), type mismatch")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawImage(), type mismatch" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(17))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2154 | - | |||||||||||||||||||||||||||||||||||||
| 2155 | pixmap = r->d()->context->createPixmap(url); | - | ||||||||||||||||||||||||||||||||||||
| 2156 | } never executed: else if (arg->isObject()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2157 | QV4::Scoped<QV4::QObjectWrapper> qobjectWrapper(scope, arg); | - | ||||||||||||||||||||||||||||||||||||
| 2158 | if (!!qobjectWrapper
| 0 | ||||||||||||||||||||||||||||||||||||
| 2159 | if (QQuickImage *imageItem = qobject_cast<QQuickImage*>(qobjectWrapper->object())
| 0 | ||||||||||||||||||||||||||||||||||||
| 2160 | pixmap = r->d()->context->createPixmap(imageItem->source()); | - | ||||||||||||||||||||||||||||||||||||
| 2161 | } never executed: else if (QQuickCanvasItem *canvas = qobject_cast<QQuickCanvasItem*>(qobjectWrapper->object())end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2162 | QImage img = canvas->toImage(); | - | ||||||||||||||||||||||||||||||||||||
| 2163 | if (!img.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2164 | pixmap.adopt(new QQuickCanvasPixmap(img)); never executed: pixmap.adopt(new QQuickCanvasPixmap(img)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2165 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2166 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawImage(), type mismatch")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawImage(), type mismatch" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(17))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2167 | } | - | ||||||||||||||||||||||||||||||||||||
| 2168 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 2169 | QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, arg); | - | ||||||||||||||||||||||||||||||||||||
| 2170 | if (!!imageData
| 0 | ||||||||||||||||||||||||||||||||||||
| 2171 | QV4::Scoped<QQuickJSContext2DPixelData> pix(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>()); | - | ||||||||||||||||||||||||||||||||||||
| 2172 | if (pix
| 0 | ||||||||||||||||||||||||||||||||||||
| 2173 | pixmap.adopt(new QQuickCanvasPixmap(*pix->d()->image)); | - | ||||||||||||||||||||||||||||||||||||
| 2174 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2175 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawImage(), type mismatch")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawImage(), type mismatch" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(17))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2176 | } | - | ||||||||||||||||||||||||||||||||||||
| 2177 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 2178 | QUrl url(arg->toQStringNoThrow()); | - | ||||||||||||||||||||||||||||||||||||
| 2179 | if (url.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2180 | pixmap = r->d()->context->createPixmap(url); never executed: pixmap = r->d()->context->createPixmap(url); | 0 | ||||||||||||||||||||||||||||||||||||
| 2181 | else | - | ||||||||||||||||||||||||||||||||||||
| 2182 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawImage(), type mismatch")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawImage(), type mismatch" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(17))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2183 | } | - | ||||||||||||||||||||||||||||||||||||
| 2184 | } | - | ||||||||||||||||||||||||||||||||||||
| 2185 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 2186 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawImage(), type mismatch")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawImage(), type mismatch" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(17))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2187 | } | - | ||||||||||||||||||||||||||||||||||||
| 2188 | - | |||||||||||||||||||||||||||||||||||||
| 2189 | if (pixmap.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2190 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2191 | - | |||||||||||||||||||||||||||||||||||||
| 2192 | if (argc >= 9
| 0 | ||||||||||||||||||||||||||||||||||||
| 2193 | sx = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2194 | sy = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2195 | sw = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2196 | sh = argv[4].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2197 | dx = argv[5].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2198 | dy = argv[6].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2199 | dw = argv[7].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2200 | dh = argv[8].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2201 | } never executed: else if (argc >= 5end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2202 | sx = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2203 | sy = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2204 | sw = pixmap->width(); | - | ||||||||||||||||||||||||||||||||||||
| 2205 | sh = pixmap->height(); | - | ||||||||||||||||||||||||||||||||||||
| 2206 | dx = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2207 | dy = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2208 | dw = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2209 | dh = argv[4].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2210 | } never executed: else if (argc >= 3end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2211 | dx = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2212 | dy = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2213 | sx = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2214 | sy = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2215 | sw = pixmap->width(); | - | ||||||||||||||||||||||||||||||||||||
| 2216 | sh = pixmap->height(); | - | ||||||||||||||||||||||||||||||||||||
| 2217 | dw = sw; | - | ||||||||||||||||||||||||||||||||||||
| 2218 | dh = sh; | - | ||||||||||||||||||||||||||||||||||||
| 2219 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2220 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2221 | } | - | ||||||||||||||||||||||||||||||||||||
| 2222 | - | |||||||||||||||||||||||||||||||||||||
| 2223 | if (!qt_is_finite(sx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2224 | || !qt_is_finite(sy)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2225 | || !qt_is_finite(sw)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2226 | || !qt_is_finite(sh)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2227 | || !qt_is_finite(dx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2228 | || !qt_is_finite(dy)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2229 | || !qt_is_finite(dw)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2230 | || !qt_is_finite(dh)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2231 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2232 | - | |||||||||||||||||||||||||||||||||||||
| 2233 | if (sx < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2234 | || sy < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2235 | || sw == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2236 | || sh == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2237 | || sx + sw > pixmap->width()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2238 | || sy + sh > pixmap->height()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2239 | || sx + sw < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2240 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "drawImage(), index size error")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "drawImage(), index size error" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2241 | } | - | ||||||||||||||||||||||||||||||||||||
| 2242 | - | |||||||||||||||||||||||||||||||||||||
| 2243 | r->d()->context->buffer()->drawPixmap(pixmap, QRectF(sx, sy, sw, sh), QRectF(dx, dy, dw, dh)); | - | ||||||||||||||||||||||||||||||||||||
| 2244 | - | |||||||||||||||||||||||||||||||||||||
| 2245 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 2246 | } | - | ||||||||||||||||||||||||||||||||||||
| 2247 | QV4::ReturnedValue QQuickJSContext2DImageData::method_get_width(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 2248 | { | - | ||||||||||||||||||||||||||||||||||||
| 2249 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2250 | QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2251 | if (!imageData
| 0 | ||||||||||||||||||||||||||||||||||||
| 2252 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2253 | QV4::Scoped<QQuickJSContext2DPixelData> r(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>()); | - | ||||||||||||||||||||||||||||||||||||
| 2254 | int width = r
| 0 | ||||||||||||||||||||||||||||||||||||
| 2255 | return never executed: QV4::Encode(QV4::Encode(width));return QV4::Encode(QV4::Encode(width));never executed: return QV4::Encode(QV4::Encode(width)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2256 | } | - | ||||||||||||||||||||||||||||||||||||
| 2257 | - | |||||||||||||||||||||||||||||||||||||
| 2258 | - | |||||||||||||||||||||||||||||||||||||
| 2259 | - | |||||||||||||||||||||||||||||||||||||
| 2260 | - | |||||||||||||||||||||||||||||||||||||
| 2261 | - | |||||||||||||||||||||||||||||||||||||
| 2262 | QV4::ReturnedValue QQuickJSContext2DImageData::method_get_height(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 2263 | { | - | ||||||||||||||||||||||||||||||||||||
| 2264 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2265 | QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2266 | if (!imageData
| 0 | ||||||||||||||||||||||||||||||||||||
| 2267 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2268 | QV4::Scoped<QQuickJSContext2DPixelData> r(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>()); | - | ||||||||||||||||||||||||||||||||||||
| 2269 | int height = r
| 0 | ||||||||||||||||||||||||||||||||||||
| 2270 | return never executed: QV4::Encode(QV4::Encode(height));return QV4::Encode(QV4::Encode(height));never executed: return QV4::Encode(QV4::Encode(height)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2271 | } | - | ||||||||||||||||||||||||||||||||||||
| 2272 | - | |||||||||||||||||||||||||||||||||||||
| 2273 | - | |||||||||||||||||||||||||||||||||||||
| 2274 | - | |||||||||||||||||||||||||||||||||||||
| 2275 | - | |||||||||||||||||||||||||||||||||||||
| 2276 | - | |||||||||||||||||||||||||||||||||||||
| 2277 | QV4::ReturnedValue QQuickJSContext2DImageData::method_get_data(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 2278 | { | - | ||||||||||||||||||||||||||||||||||||
| 2279 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2280 | QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, *thisObject); | - | ||||||||||||||||||||||||||||||||||||
| 2281 | if (!imageData
| 0 | ||||||||||||||||||||||||||||||||||||
| 2282 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2283 | return never executed: QV4::Encode(imageData->d()->pixelData);return QV4::Encode(imageData->d()->pixelData);never executed: return QV4::Encode(imageData->d()->pixelData); | 0 | ||||||||||||||||||||||||||||||||||||
| 2284 | } | - | ||||||||||||||||||||||||||||||||||||
| 2285 | QV4::ReturnedValue QQuickJSContext2DPixelData::proto_get_length(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||
| 2286 | { | - | ||||||||||||||||||||||||||||||||||||
| 2287 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2288 | QV4::Scoped<QQuickJSContext2DPixelData> r(scope, thisObject->as<QQuickJSContext2DPixelData>()); | - | ||||||||||||||||||||||||||||||||||||
| 2289 | if (!r
| 0 | ||||||||||||||||||||||||||||||||||||
| 2290 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2291 | - | |||||||||||||||||||||||||||||||||||||
| 2292 | return never executed: QV4::Encode(QV4::Encode(r->d()->image->width() * r->d()->image->height() * 4));return QV4::Encode(QV4::Encode(r->d()->image->width() * r->d()->image->height() * 4));never executed: return QV4::Encode(QV4::Encode(r->d()->image->width() * r->d()->image->height() * 4)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2293 | } | - | ||||||||||||||||||||||||||||||||||||
| 2294 | - | |||||||||||||||||||||||||||||||||||||
| 2295 | QV4::ReturnedValue QQuickJSContext2DPixelData::virtualGet(const QV4::Managed *m, QV4::PropertyKey id, const QV4::Value *receiver, bool *hasProperty) | - | ||||||||||||||||||||||||||||||||||||
| 2296 | { | - | ||||||||||||||||||||||||||||||||||||
| 2297 | if (!id.isArrayIndex()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2298 | return never executed: QV4::Object::virtualGet(m, id, receiver, hasProperty);return QV4::Object::virtualGet(m, id, receiver, hasProperty);never executed: return QV4::Object::virtualGet(m, id, receiver, hasProperty); | 0 | ||||||||||||||||||||||||||||||||||||
| 2299 | - | |||||||||||||||||||||||||||||||||||||
| 2300 | uint index = id.asArrayIndex(); | - | ||||||||||||||||||||||||||||||||||||
| 2301 | ((m->as<QQuickJSContext2DPixelData>()) ? static_cast<void>(0) : qt_assert("m->as<QQuickJSContext2DPixelData>()", __FILE__, 3139)); | - | ||||||||||||||||||||||||||||||||||||
| 2302 | QV4::ExecutionEngine *v4 = static_cast<const QQuickJSContext2DPixelData *>(m)->engine(); | - | ||||||||||||||||||||||||||||||||||||
| 2303 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||||||||||||||
| 2304 | QV4::Scoped<QQuickJSContext2DPixelData> r(scope, static_cast<const QQuickJSContext2DPixelData *>(m)); | - | ||||||||||||||||||||||||||||||||||||
| 2305 | - | |||||||||||||||||||||||||||||||||||||
| 2306 | if (index < static_cast<quint32>(r->d()->image->width() * r->d()->image->height() * 4)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2307 | if (hasProperty
| 0 | ||||||||||||||||||||||||||||||||||||
| 2308 | * never executed: hasProperty = true;*hasProperty = true;never executed: *hasProperty = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2309 | const quint32 w = r->d()->image->width(); | - | ||||||||||||||||||||||||||||||||||||
| 2310 | const quint32 row = (index / 4) / w; | - | ||||||||||||||||||||||||||||||||||||
| 2311 | const quint32 col = (index / 4) % w; | - | ||||||||||||||||||||||||||||||||||||
| 2312 | const QRgb* pixel = reinterpret_cast<const QRgb*>(r->d()->image->constScanLine(row)); | - | ||||||||||||||||||||||||||||||||||||
| 2313 | pixel += col; | - | ||||||||||||||||||||||||||||||||||||
| 2314 | switch (index % 4) { | - | ||||||||||||||||||||||||||||||||||||
| 2315 | case never executed: 0:case 0:never executed: case 0: | 0 | ||||||||||||||||||||||||||||||||||||
| 2316 | return never executed: QV4::Encode(qRed(*pixel));return QV4::Encode(qRed(*pixel));never executed: return QV4::Encode(qRed(*pixel)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2317 | case never executed: 1:case 1:never executed: case 1: | 0 | ||||||||||||||||||||||||||||||||||||
| 2318 | return never executed: QV4::Encode(qGreen(*pixel));return QV4::Encode(qGreen(*pixel));never executed: return QV4::Encode(qGreen(*pixel)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2319 | case never executed: 2:case 2:never executed: case 2: | 0 | ||||||||||||||||||||||||||||||||||||
| 2320 | return never executed: QV4::Encode(qBlue(*pixel));return QV4::Encode(qBlue(*pixel));never executed: return QV4::Encode(qBlue(*pixel)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2321 | case never executed: 3:case 3:never executed: case 3: | 0 | ||||||||||||||||||||||||||||||||||||
| 2322 | return never executed: QV4::Encode(qAlpha(*pixel));return QV4::Encode(qAlpha(*pixel));never executed: return QV4::Encode(qAlpha(*pixel)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2323 | } | - | ||||||||||||||||||||||||||||||||||||
| 2324 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2325 | - | |||||||||||||||||||||||||||||||||||||
| 2326 | if (hasProperty
| 0 | ||||||||||||||||||||||||||||||||||||
| 2327 | * never executed: hasProperty = false;*hasProperty = false;never executed: *hasProperty = false; | 0 | ||||||||||||||||||||||||||||||||||||
| 2328 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2329 | } | - | ||||||||||||||||||||||||||||||||||||
| 2330 | - | |||||||||||||||||||||||||||||||||||||
| 2331 | bool QQuickJSContext2DPixelData::virtualPut(QV4::Managed *m, QV4::PropertyKey id, const QV4::Value &value, QV4::Value *receiver) | - | ||||||||||||||||||||||||||||||||||||
| 2332 | { | - | ||||||||||||||||||||||||||||||||||||
| 2333 | if (!id.isArrayIndex()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2334 | return never executed: Object::virtualPut(m, id, value, receiver);return Object::virtualPut(m, id, value, receiver);never executed: return Object::virtualPut(m, id, value, receiver); | 0 | ||||||||||||||||||||||||||||||||||||
| 2335 | - | |||||||||||||||||||||||||||||||||||||
| 2336 | ((m->as<QQuickJSContext2DPixelData>()) ? static_cast<void>(0) : qt_assert("m->as<QQuickJSContext2DPixelData>()", __FILE__, 3174)); | - | ||||||||||||||||||||||||||||||||||||
| 2337 | QV4::ExecutionEngine *v4 = static_cast<QQuickJSContext2DPixelData *>(m)->engine(); | - | ||||||||||||||||||||||||||||||||||||
| 2338 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||||||||||||||
| 2339 | if (scope.hasException()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2340 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 2341 | - | |||||||||||||||||||||||||||||||||||||
| 2342 | uint index = id.asArrayIndex(); | - | ||||||||||||||||||||||||||||||||||||
| 2343 | QV4::Scoped<QQuickJSContext2DPixelData> r(scope, static_cast<QQuickJSContext2DPixelData *>(m)); | - | ||||||||||||||||||||||||||||||||||||
| 2344 | - | |||||||||||||||||||||||||||||||||||||
| 2345 | const int v = value.toInt32(); | - | ||||||||||||||||||||||||||||||||||||
| 2346 | if (r
| 0 | ||||||||||||||||||||||||||||||||||||
| 2347 | const quint32 w = r->d()->image->width(); | - | ||||||||||||||||||||||||||||||||||||
| 2348 | const quint32 row = (index / 4) / w; | - | ||||||||||||||||||||||||||||||||||||
| 2349 | const quint32 col = (index / 4) % w; | - | ||||||||||||||||||||||||||||||||||||
| 2350 | - | |||||||||||||||||||||||||||||||||||||
| 2351 | QRgb* pixel = reinterpret_cast<QRgb*>(r->d()->image->scanLine(row)); | - | ||||||||||||||||||||||||||||||||||||
| 2352 | pixel += col; | - | ||||||||||||||||||||||||||||||||||||
| 2353 | switch (index % 4) { | - | ||||||||||||||||||||||||||||||||||||
| 2354 | case never executed: 0:case 0:never executed: case 0: | 0 | ||||||||||||||||||||||||||||||||||||
| 2355 | *pixel = qRgba(v, qGreen(*pixel), qBlue(*pixel), qAlpha(*pixel)); | - | ||||||||||||||||||||||||||||||||||||
| 2356 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2357 | case never executed: 1:case 1:never executed: case 1: | 0 | ||||||||||||||||||||||||||||||||||||
| 2358 | *pixel = qRgba(qRed(*pixel), v, qBlue(*pixel), qAlpha(*pixel)); | - | ||||||||||||||||||||||||||||||||||||
| 2359 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2360 | case never executed: 2:case 2:never executed: case 2: | 0 | ||||||||||||||||||||||||||||||||||||
| 2361 | *pixel = qRgba(qRed(*pixel), qGreen(*pixel), v, qAlpha(*pixel)); | - | ||||||||||||||||||||||||||||||||||||
| 2362 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2363 | case never executed: 3:case 3:never executed: case 3: | 0 | ||||||||||||||||||||||||||||||||||||
| 2364 | *pixel = qRgba(qRed(*pixel), qGreen(*pixel), qBlue(*pixel), v); | - | ||||||||||||||||||||||||||||||||||||
| 2365 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2366 | } | - | ||||||||||||||||||||||||||||||||||||
| 2367 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2368 | } | - | ||||||||||||||||||||||||||||||||||||
| 2369 | - | |||||||||||||||||||||||||||||||||||||
| 2370 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 2371 | } | - | ||||||||||||||||||||||||||||||||||||
| 2372 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_createImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2373 | { | - | ||||||||||||||||||||||||||||||||||||
| 2374 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2375 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 2376 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2377 | - | |||||||||||||||||||||||||||||||||||||
| 2378 | if (argc == 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 2379 | QV4::ScopedValue arg0(scope, argv[0]); | - | ||||||||||||||||||||||||||||||||||||
| 2380 | QV4::Scoped<QQuickJSContext2DImageData> imgData(scope, arg0); | - | ||||||||||||||||||||||||||||||||||||
| 2381 | if (!!imgData
| 0 | ||||||||||||||||||||||||||||||||||||
| 2382 | QV4::Scoped<QQuickJSContext2DPixelData> pa(scope, imgData->d()->pixelData.as<QQuickJSContext2DPixelData>()); | - | ||||||||||||||||||||||||||||||||||||
| 2383 | if (pa
| 0 | ||||||||||||||||||||||||||||||||||||
| 2384 | qreal w = pa->d()->image->width(); | - | ||||||||||||||||||||||||||||||||||||
| 2385 | qreal h = pa->d()->image->height(); | - | ||||||||||||||||||||||||||||||||||||
| 2386 | return never executed: QV4::Encode(qt_create_image_data(w, h, scope.engine, QImage()));return QV4::Encode(qt_create_image_data(w, h, scope.engine, QImage()));never executed: return QV4::Encode(qt_create_image_data(w, h, scope.engine, QImage())); | 0 | ||||||||||||||||||||||||||||||||||||
| 2387 | } | - | ||||||||||||||||||||||||||||||||||||
| 2388 | } never executed: else if (arg0->isString()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2389 | QImage image = r->d()->context->createPixmap(QUrl(arg0->toQStringNoThrow()))->image(); | - | ||||||||||||||||||||||||||||||||||||
| 2390 | return never executed: QV4::Encode(qt_create_image_data(image.width(), image.height(), scope.engine, image));return QV4::Encode(qt_create_image_data(image.width(), image.height(), scope.engine, image));never executed: return QV4::Encode(qt_create_image_data(image.width(), image.height(), scope.engine, image)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2391 | } | - | ||||||||||||||||||||||||||||||||||||
| 2392 | } never executed: else if (argc == 2end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2393 | qreal w = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2394 | qreal h = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2395 | - | |||||||||||||||||||||||||||||||||||||
| 2396 | if (!qt_is_finite(w)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2397 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "createImageData(): invalid arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createImageData(): invalid arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2398 | - | |||||||||||||||||||||||||||||||||||||
| 2399 | if (w > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2400 | return never executed: QV4::Encode(qt_create_image_data(w, h, scope.engine, QImage()));return QV4::Encode(qt_create_image_data(w, h, scope.engine, QImage()));never executed: return QV4::Encode(qt_create_image_data(w, h, scope.engine, QImage())); | 0 | ||||||||||||||||||||||||||||||||||||
| 2401 | else | - | ||||||||||||||||||||||||||||||||||||
| 2402 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "createImageData(): invalid arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "createImageData(): invalid arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2403 | } | - | ||||||||||||||||||||||||||||||||||||
| 2404 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2405 | } | - | ||||||||||||||||||||||||||||||||||||
| 2406 | - | |||||||||||||||||||||||||||||||||||||
| 2407 | - | |||||||||||||||||||||||||||||||||||||
| 2408 | - | |||||||||||||||||||||||||||||||||||||
| 2409 | - | |||||||||||||||||||||||||||||||||||||
| 2410 | - | |||||||||||||||||||||||||||||||||||||
| 2411 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_getImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2412 | { | - | ||||||||||||||||||||||||||||||||||||
| 2413 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2414 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 2415 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2416 | - | |||||||||||||||||||||||||||||||||||||
| 2417 | if (argc >= 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 2418 | qreal x = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2419 | qreal y = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2420 | qreal w = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2421 | qreal h = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2422 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2423 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "getImageData(): Invalid arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getImageData(): Invalid arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2424 | - | |||||||||||||||||||||||||||||||||||||
| 2425 | if (w <= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2426 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "getImageData(): Invalid arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getImageData(): Invalid arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2427 | - | |||||||||||||||||||||||||||||||||||||
| 2428 | QImage image = r->d()->context->canvas()->toImage(QRectF(x, y, w, h)); | - | ||||||||||||||||||||||||||||||||||||
| 2429 | return never executed: QV4::Encode(qt_create_image_data(w, h, scope.engine, image));return QV4::Encode(qt_create_image_data(w, h, scope.engine, image));never executed: return QV4::Encode(qt_create_image_data(w, h, scope.engine, image)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2430 | } | - | ||||||||||||||||||||||||||||||||||||
| 2431 | return never executed: QV4::Encode(QV4::Encode::null());return QV4::Encode(QV4::Encode::null());never executed: return QV4::Encode(QV4::Encode::null()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2432 | } | - | ||||||||||||||||||||||||||||||||||||
| 2433 | - | |||||||||||||||||||||||||||||||||||||
| 2434 | - | |||||||||||||||||||||||||||||||||||||
| 2435 | - | |||||||||||||||||||||||||||||||||||||
| 2436 | - | |||||||||||||||||||||||||||||||||||||
| 2437 | - | |||||||||||||||||||||||||||||||||||||
| 2438 | QV4::ReturnedValue QQuickJSContext2DPrototype::method_putImageData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2439 | { | - | ||||||||||||||||||||||||||||||||||||
| 2440 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2441 | QV4::Scoped<QQuickJSContext2D> r(scope, thisObject->as<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 2442 | if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));return scope.engine->throwError(QString::fromUtf8("Not a Context2D object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a Context2D object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2443 | if (argc < 7
| 0 | ||||||||||||||||||||||||||||||||||||
| 2444 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2445 | - | |||||||||||||||||||||||||||||||||||||
| 2446 | QV4::ScopedValue arg0(scope, argv[0]); | - | ||||||||||||||||||||||||||||||||||||
| 2447 | if (!arg0->isObject()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2448 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "Context2D::putImageData, the image data type mismatch")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Context2D::putImageData, the image data type mismatch" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(17))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2449 | - | |||||||||||||||||||||||||||||||||||||
| 2450 | qreal dx = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2451 | qreal dy = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2452 | qreal w, h, dirtyX, dirtyY, dirtyWidth, dirtyHeight; | - | ||||||||||||||||||||||||||||||||||||
| 2453 | - | |||||||||||||||||||||||||||||||||||||
| 2454 | if (!qt_is_finite(dx)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2455 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "putImageData() : Invalid arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "putImageData() : Invalid arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2456 | - | |||||||||||||||||||||||||||||||||||||
| 2457 | QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, arg0); | - | ||||||||||||||||||||||||||||||||||||
| 2458 | if (!imageData
| 0 | ||||||||||||||||||||||||||||||||||||
| 2459 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2460 | - | |||||||||||||||||||||||||||||||||||||
| 2461 | QV4::Scoped<QQuickJSContext2DPixelData> pixelArray(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>()); | - | ||||||||||||||||||||||||||||||||||||
| 2462 | if (pixelArray
| 0 | ||||||||||||||||||||||||||||||||||||
| 2463 | w = pixelArray->d()->image->width(); | - | ||||||||||||||||||||||||||||||||||||
| 2464 | h = pixelArray->d()->image->height(); | - | ||||||||||||||||||||||||||||||||||||
| 2465 | - | |||||||||||||||||||||||||||||||||||||
| 2466 | if (argc == 7
| 0 | ||||||||||||||||||||||||||||||||||||
| 2467 | dirtyX = argv[3].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2468 | dirtyY = argv[4].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2469 | dirtyWidth = argv[5].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2470 | dirtyHeight = argv[6].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2471 | - | |||||||||||||||||||||||||||||||||||||
| 2472 | if (!qt_is_finite(dirtyX)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2473 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "putImageData() : Invalid arguments")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "putImageData() : Invalid arguments" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(9))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2474 | - | |||||||||||||||||||||||||||||||||||||
| 2475 | - | |||||||||||||||||||||||||||||||||||||
| 2476 | if (dirtyWidth < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2477 | dirtyX = dirtyX+dirtyWidth; | - | ||||||||||||||||||||||||||||||||||||
| 2478 | dirtyWidth = -dirtyWidth; | - | ||||||||||||||||||||||||||||||||||||
| 2479 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2480 | - | |||||||||||||||||||||||||||||||||||||
| 2481 | if (dirtyHeight < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2482 | dirtyY = dirtyY+dirtyHeight; | - | ||||||||||||||||||||||||||||||||||||
| 2483 | dirtyHeight = -dirtyHeight; | - | ||||||||||||||||||||||||||||||||||||
| 2484 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2485 | - | |||||||||||||||||||||||||||||||||||||
| 2486 | if (dirtyX < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2487 | dirtyWidth = dirtyWidth+dirtyX; | - | ||||||||||||||||||||||||||||||||||||
| 2488 | dirtyX = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2489 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2490 | - | |||||||||||||||||||||||||||||||||||||
| 2491 | if (dirtyY < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2492 | dirtyHeight = dirtyHeight+dirtyY; | - | ||||||||||||||||||||||||||||||||||||
| 2493 | dirtyY = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2494 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2495 | - | |||||||||||||||||||||||||||||||||||||
| 2496 | if (dirtyX+dirtyWidth > w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2497 | dirtyWidth = w - dirtyX; | - | ||||||||||||||||||||||||||||||||||||
| 2498 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2499 | - | |||||||||||||||||||||||||||||||||||||
| 2500 | if (dirtyY+dirtyHeight > h
| 0 | ||||||||||||||||||||||||||||||||||||
| 2501 | dirtyHeight = h - dirtyY; | - | ||||||||||||||||||||||||||||||||||||
| 2502 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2503 | - | |||||||||||||||||||||||||||||||||||||
| 2504 | if (dirtyWidth <=0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2505 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2506 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2507 | dirtyX = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2508 | dirtyY = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2509 | dirtyWidth = w; | - | ||||||||||||||||||||||||||||||||||||
| 2510 | dirtyHeight = h; | - | ||||||||||||||||||||||||||||||||||||
| 2511 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2512 | - | |||||||||||||||||||||||||||||||||||||
| 2513 | QImage image = pixelArray->d()->image->copy(dirtyX, dirtyY, dirtyWidth, dirtyHeight); | - | ||||||||||||||||||||||||||||||||||||
| 2514 | r->d()->context->buffer()->drawImage(image, QRectF(dirtyX, dirtyY, dirtyWidth, dirtyHeight), QRectF(dx, dy, dirtyWidth, dirtyHeight)); | - | ||||||||||||||||||||||||||||||||||||
| 2515 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2516 | - | |||||||||||||||||||||||||||||||||||||
| 2517 | return never executed: QV4::Encode(*thisObject);return QV4::Encode(*thisObject);never executed: return QV4::Encode(*thisObject); | 0 | ||||||||||||||||||||||||||||||||||||
| 2518 | } | - | ||||||||||||||||||||||||||||||||||||
| 2519 | QV4::ReturnedValue QQuickContext2DStyle::gradient_proto_addColorStop(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||
| 2520 | { | - | ||||||||||||||||||||||||||||||||||||
| 2521 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||
| 2522 | QV4::Scoped<QQuickContext2DStyle> style(scope, thisObject->as<QQuickContext2DStyle>()); | - | ||||||||||||||||||||||||||||||||||||
| 2523 | if (!style
| 0 | ||||||||||||||||||||||||||||||||||||
| 2524 | return never executed: scope.engine->throwError(QString::fromUtf8("Not a CanvasGradient object"));return scope.engine->throwError(QString::fromUtf8("Not a CanvasGradient object"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a CanvasGradient object")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2525 | - | |||||||||||||||||||||||||||||||||||||
| 2526 | if (argc == 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 2527 | - | |||||||||||||||||||||||||||||||||||||
| 2528 | if (!style->d()->brush->gradient()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2529 | return never executed: scope.engine->throwError(QString::fromUtf8("Not a valid CanvasGradient object, can't get the gradient information"));return scope.engine->throwError(QString::fromUtf8("Not a valid CanvasGradient object, can't get the gradient information"));never executed: return scope.engine->throwError(QString::fromUtf8("Not a valid CanvasGradient object, can't get the gradient information")); | 0 | ||||||||||||||||||||||||||||||||||||
| 2530 | QGradient gradient = *(style->d()->brush->gradient()); | - | ||||||||||||||||||||||||||||||||||||
| 2531 | qreal pos = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||
| 2532 | QColor color; | - | ||||||||||||||||||||||||||||||||||||
| 2533 | - | |||||||||||||||||||||||||||||||||||||
| 2534 | if (argv[1].as<Object>()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2535 | color = scope.engine->toVariant(argv[1], qMetaTypeId<QColor>()).value<QColor>(); | - | ||||||||||||||||||||||||||||||||||||
| 2536 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2537 | color = qt_color_from_string(argv[1]); | - | ||||||||||||||||||||||||||||||||||||
| 2538 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2539 | if (pos < 0.0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2540 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "CanvasGradient: parameter offset out of range")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "CanvasGradient: parameter offset out of range" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(1))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2541 | } | - | ||||||||||||||||||||||||||||||||||||
| 2542 | - | |||||||||||||||||||||||||||||||||||||
| 2543 | if (color.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2544 | gradient.setColorAt(pos, color); | - | ||||||||||||||||||||||||||||||||||||
| 2545 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2546 | { QV4::ScopedValue v(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "CanvasGradient: parameter color is not a valid color string")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "CanvasGradient: parameter color is not a valid color string" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))); QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(([]() noexcept -> QString { enum { Size = sizeof(u"" "code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn qstring_literal_temp;never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(12))); returnreturn qstring_literal_temp;never executed: scope.engine->throwError(ex);return scope.engine->throwError(ex);never executed: };return scope.engine->throwError(ex); | 0 | ||||||||||||||||||||||||||||||||||||
| 2547 | } | - | ||||||||||||||||||||||||||||||||||||
| 2548 | *style->d()->brush = gradient; | - | ||||||||||||||||||||||||||||||||||||
| 2549 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2550 | - | |||||||||||||||||||||||||||||||||||||
| 2551 | return never executed: thisObject->asReturnedValue();return thisObject->asReturnedValue();never executed: return thisObject->asReturnedValue(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2552 | } | - | ||||||||||||||||||||||||||||||||||||
| 2553 | - | |||||||||||||||||||||||||||||||||||||
| 2554 | void QQuickContext2D::scale(qreal x, qreal y) | - | ||||||||||||||||||||||||||||||||||||
| 2555 | { | - | ||||||||||||||||||||||||||||||||||||
| 2556 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2557 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2558 | - | |||||||||||||||||||||||||||||||||||||
| 2559 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2560 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2561 | - | |||||||||||||||||||||||||||||||||||||
| 2562 | QTransform newTransform = state.matrix; | - | ||||||||||||||||||||||||||||||||||||
| 2563 | newTransform.scale(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2564 | - | |||||||||||||||||||||||||||||||||||||
| 2565 | if (!newTransform.isInvertible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2566 | state.invertibleCTM = false; | - | ||||||||||||||||||||||||||||||||||||
| 2567 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2568 | } | - | ||||||||||||||||||||||||||||||||||||
| 2569 | - | |||||||||||||||||||||||||||||||||||||
| 2570 | state.matrix = newTransform; | - | ||||||||||||||||||||||||||||||||||||
| 2571 | buffer()->updateMatrix(state.matrix); | - | ||||||||||||||||||||||||||||||||||||
| 2572 | m_path = QTransform().scale(1.0 / x, 1.0 / y).map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2573 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2574 | - | |||||||||||||||||||||||||||||||||||||
| 2575 | void QQuickContext2D::rotate(qreal angle) | - | ||||||||||||||||||||||||||||||||||||
| 2576 | { | - | ||||||||||||||||||||||||||||||||||||
| 2577 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2578 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2579 | - | |||||||||||||||||||||||||||||||||||||
| 2580 | if (!qt_is_finite(angle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2581 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2582 | - | |||||||||||||||||||||||||||||||||||||
| 2583 | QTransform newTransform =state.matrix; | - | ||||||||||||||||||||||||||||||||||||
| 2584 | newTransform.rotate(qRadiansToDegrees(angle)); | - | ||||||||||||||||||||||||||||||||||||
| 2585 | - | |||||||||||||||||||||||||||||||||||||
| 2586 | if (!newTransform.isInvertible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2587 | state.invertibleCTM = false; | - | ||||||||||||||||||||||||||||||||||||
| 2588 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2589 | } | - | ||||||||||||||||||||||||||||||||||||
| 2590 | - | |||||||||||||||||||||||||||||||||||||
| 2591 | state.matrix = newTransform; | - | ||||||||||||||||||||||||||||||||||||
| 2592 | buffer()->updateMatrix(state.matrix); | - | ||||||||||||||||||||||||||||||||||||
| 2593 | m_path = QTransform().rotate(-qRadiansToDegrees(angle)).map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2594 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2595 | - | |||||||||||||||||||||||||||||||||||||
| 2596 | void QQuickContext2D::shear(qreal h, qreal v) | - | ||||||||||||||||||||||||||||||||||||
| 2597 | { | - | ||||||||||||||||||||||||||||||||||||
| 2598 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2599 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2600 | - | |||||||||||||||||||||||||||||||||||||
| 2601 | if (!qt_is_finite(h)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2602 | return never executed: ;return ;never executed: return ; | 0 | ||||||||||||||||||||||||||||||||||||
| 2603 | - | |||||||||||||||||||||||||||||||||||||
| 2604 | QTransform newTransform = state.matrix; | - | ||||||||||||||||||||||||||||||||||||
| 2605 | newTransform.shear(h, v); | - | ||||||||||||||||||||||||||||||||||||
| 2606 | - | |||||||||||||||||||||||||||||||||||||
| 2607 | if (!newTransform.isInvertible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2608 | state.invertibleCTM = false; | - | ||||||||||||||||||||||||||||||||||||
| 2609 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2610 | } | - | ||||||||||||||||||||||||||||||||||||
| 2611 | - | |||||||||||||||||||||||||||||||||||||
| 2612 | state.matrix = newTransform; | - | ||||||||||||||||||||||||||||||||||||
| 2613 | buffer()->updateMatrix(state.matrix); | - | ||||||||||||||||||||||||||||||||||||
| 2614 | m_path = QTransform().shear(-h, -v).map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2615 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2616 | - | |||||||||||||||||||||||||||||||||||||
| 2617 | void QQuickContext2D::translate(qreal x, qreal y) | - | ||||||||||||||||||||||||||||||||||||
| 2618 | { | - | ||||||||||||||||||||||||||||||||||||
| 2619 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2620 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2621 | - | |||||||||||||||||||||||||||||||||||||
| 2622 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2623 | return never executed: ;return ;never executed: return ; | 0 | ||||||||||||||||||||||||||||||||||||
| 2624 | - | |||||||||||||||||||||||||||||||||||||
| 2625 | QTransform newTransform = state.matrix; | - | ||||||||||||||||||||||||||||||||||||
| 2626 | newTransform.translate(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2627 | - | |||||||||||||||||||||||||||||||||||||
| 2628 | if (!newTransform.isInvertible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2629 | state.invertibleCTM = false; | - | ||||||||||||||||||||||||||||||||||||
| 2630 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2631 | } | - | ||||||||||||||||||||||||||||||||||||
| 2632 | - | |||||||||||||||||||||||||||||||||||||
| 2633 | state.matrix = newTransform; | - | ||||||||||||||||||||||||||||||||||||
| 2634 | buffer()->updateMatrix(state.matrix); | - | ||||||||||||||||||||||||||||||||||||
| 2635 | m_path = QTransform().translate(-x, -y).map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2636 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2637 | - | |||||||||||||||||||||||||||||||||||||
| 2638 | void QQuickContext2D::transform(qreal a, qreal b, qreal c, qreal d, qreal e, qreal f) | - | ||||||||||||||||||||||||||||||||||||
| 2639 | { | - | ||||||||||||||||||||||||||||||||||||
| 2640 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2641 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2642 | - | |||||||||||||||||||||||||||||||||||||
| 2643 | if (!qt_is_finite(a)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2644 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2645 | - | |||||||||||||||||||||||||||||||||||||
| 2646 | QTransform transform(a, b, c, d, e, f); | - | ||||||||||||||||||||||||||||||||||||
| 2647 | QTransform newTransform = state.matrix * transform; | - | ||||||||||||||||||||||||||||||||||||
| 2648 | - | |||||||||||||||||||||||||||||||||||||
| 2649 | if (!newTransform.isInvertible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2650 | state.invertibleCTM = false; | - | ||||||||||||||||||||||||||||||||||||
| 2651 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2652 | } | - | ||||||||||||||||||||||||||||||||||||
| 2653 | state.matrix = newTransform; | - | ||||||||||||||||||||||||||||||||||||
| 2654 | buffer()->updateMatrix(state.matrix); | - | ||||||||||||||||||||||||||||||||||||
| 2655 | m_path = transform.inverted().map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2656 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2657 | - | |||||||||||||||||||||||||||||||||||||
| 2658 | void QQuickContext2D::setTransform(qreal a, qreal b, qreal c, qreal d, qreal e, qreal f) | - | ||||||||||||||||||||||||||||||||||||
| 2659 | { | - | ||||||||||||||||||||||||||||||||||||
| 2660 | if (!qt_is_finite(a)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2661 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2662 | - | |||||||||||||||||||||||||||||||||||||
| 2663 | QTransform ctm = state.matrix; | - | ||||||||||||||||||||||||||||||||||||
| 2664 | if (!ctm.isInvertible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2665 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2666 | - | |||||||||||||||||||||||||||||||||||||
| 2667 | state.matrix = ctm.inverted() * state.matrix; | - | ||||||||||||||||||||||||||||||||||||
| 2668 | m_path = ctm.map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2669 | state.invertibleCTM = true; | - | ||||||||||||||||||||||||||||||||||||
| 2670 | transform(a, b, c, d, e, f); | - | ||||||||||||||||||||||||||||||||||||
| 2671 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2672 | - | |||||||||||||||||||||||||||||||||||||
| 2673 | void QQuickContext2D::fill() | - | ||||||||||||||||||||||||||||||||||||
| 2674 | { | - | ||||||||||||||||||||||||||||||||||||
| 2675 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2676 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2677 | - | |||||||||||||||||||||||||||||||||||||
| 2678 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2679 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2680 | - | |||||||||||||||||||||||||||||||||||||
| 2681 | m_path.setFillRule(state.fillRule); | - | ||||||||||||||||||||||||||||||||||||
| 2682 | buffer()->fill(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2683 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2684 | - | |||||||||||||||||||||||||||||||||||||
| 2685 | void QQuickContext2D::clip() | - | ||||||||||||||||||||||||||||||||||||
| 2686 | { | - | ||||||||||||||||||||||||||||||||||||
| 2687 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2688 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2689 | - | |||||||||||||||||||||||||||||||||||||
| 2690 | QPainterPath clipPath = m_path; | - | ||||||||||||||||||||||||||||||||||||
| 2691 | clipPath.closeSubpath(); | - | ||||||||||||||||||||||||||||||||||||
| 2692 | if (state.clip
| 0 | ||||||||||||||||||||||||||||||||||||
| 2693 | state.clipPath = clipPath.intersected(state.clipPath); | - | ||||||||||||||||||||||||||||||||||||
| 2694 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2695 | state.clip = true; | - | ||||||||||||||||||||||||||||||||||||
| 2696 | state.clipPath = clipPath; | - | ||||||||||||||||||||||||||||||||||||
| 2697 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2698 | buffer()->clip(state.clip, state.clipPath); | - | ||||||||||||||||||||||||||||||||||||
| 2699 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2700 | - | |||||||||||||||||||||||||||||||||||||
| 2701 | void QQuickContext2D::stroke() | - | ||||||||||||||||||||||||||||||||||||
| 2702 | { | - | ||||||||||||||||||||||||||||||||||||
| 2703 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2704 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2705 | - | |||||||||||||||||||||||||||||||||||||
| 2706 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2707 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2708 | - | |||||||||||||||||||||||||||||||||||||
| 2709 | buffer()->stroke(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 2710 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2711 | - | |||||||||||||||||||||||||||||||||||||
| 2712 | void QQuickContext2D::fillRect(qreal x, qreal y, qreal w, qreal h) | - | ||||||||||||||||||||||||||||||||||||
| 2713 | { | - | ||||||||||||||||||||||||||||||||||||
| 2714 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2715 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2716 | - | |||||||||||||||||||||||||||||||||||||
| 2717 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2718 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2719 | - | |||||||||||||||||||||||||||||||||||||
| 2720 | buffer()->fillRect(QRectF(x, y, w, h)); | - | ||||||||||||||||||||||||||||||||||||
| 2721 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2722 | - | |||||||||||||||||||||||||||||||||||||
| 2723 | void QQuickContext2D::strokeRect(qreal x, qreal y, qreal w, qreal h) | - | ||||||||||||||||||||||||||||||||||||
| 2724 | { | - | ||||||||||||||||||||||||||||||||||||
| 2725 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2726 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2727 | - | |||||||||||||||||||||||||||||||||||||
| 2728 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2729 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2730 | - | |||||||||||||||||||||||||||||||||||||
| 2731 | buffer()->strokeRect(QRectF(x, y, w, h)); | - | ||||||||||||||||||||||||||||||||||||
| 2732 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2733 | - | |||||||||||||||||||||||||||||||||||||
| 2734 | void QQuickContext2D::clearRect(qreal x, qreal y, qreal w, qreal h) | - | ||||||||||||||||||||||||||||||||||||
| 2735 | { | - | ||||||||||||||||||||||||||||||||||||
| 2736 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2737 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2738 | - | |||||||||||||||||||||||||||||||||||||
| 2739 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2740 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2741 | - | |||||||||||||||||||||||||||||||||||||
| 2742 | buffer()->clearRect(QRectF(x, y, w, h)); | - | ||||||||||||||||||||||||||||||||||||
| 2743 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2744 | - | |||||||||||||||||||||||||||||||||||||
| 2745 | void QQuickContext2D::drawText(const QString& text, qreal x, qreal y, bool fill) | - | ||||||||||||||||||||||||||||||||||||
| 2746 | { | - | ||||||||||||||||||||||||||||||||||||
| 2747 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2748 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2749 | - | |||||||||||||||||||||||||||||||||||||
| 2750 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2751 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2752 | - | |||||||||||||||||||||||||||||||||||||
| 2753 | QPainterPath textPath = createTextGlyphs(x, y, text); | - | ||||||||||||||||||||||||||||||||||||
| 2754 | if (fill
| 0 | ||||||||||||||||||||||||||||||||||||
| 2755 | buffer()->fill(textPath); never executed: buffer()->fill(textPath); | 0 | ||||||||||||||||||||||||||||||||||||
| 2756 | else | - | ||||||||||||||||||||||||||||||||||||
| 2757 | buffer()->stroke(textPath); never executed: buffer()->stroke(textPath); | 0 | ||||||||||||||||||||||||||||||||||||
| 2758 | } | - | ||||||||||||||||||||||||||||||||||||
| 2759 | - | |||||||||||||||||||||||||||||||||||||
| 2760 | - | |||||||||||||||||||||||||||||||||||||
| 2761 | void QQuickContext2D::beginPath() | - | ||||||||||||||||||||||||||||||||||||
| 2762 | { | - | ||||||||||||||||||||||||||||||||||||
| 2763 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2764 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2765 | m_path = QPainterPath(); | - | ||||||||||||||||||||||||||||||||||||
| 2766 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2767 | - | |||||||||||||||||||||||||||||||||||||
| 2768 | void QQuickContext2D::closePath() | - | ||||||||||||||||||||||||||||||||||||
| 2769 | { | - | ||||||||||||||||||||||||||||||||||||
| 2770 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2771 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2772 | - | |||||||||||||||||||||||||||||||||||||
| 2773 | QRectF boundRect = m_path.boundingRect(); | - | ||||||||||||||||||||||||||||||||||||
| 2774 | if (boundRect.width()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2775 | m_path.closeSubpath(); never executed: m_path.closeSubpath(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2776 | - | |||||||||||||||||||||||||||||||||||||
| 2777 | - | |||||||||||||||||||||||||||||||||||||
| 2778 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2779 | - | |||||||||||||||||||||||||||||||||||||
| 2780 | void QQuickContext2D::moveTo( qreal x, qreal y) | - | ||||||||||||||||||||||||||||||||||||
| 2781 | { | - | ||||||||||||||||||||||||||||||||||||
| 2782 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2783 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2784 | - | |||||||||||||||||||||||||||||||||||||
| 2785 | - | |||||||||||||||||||||||||||||||||||||
| 2786 | m_path.moveTo(QPointF(x, y)); | - | ||||||||||||||||||||||||||||||||||||
| 2787 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2788 | - | |||||||||||||||||||||||||||||||||||||
| 2789 | void QQuickContext2D::lineTo( qreal x, qreal y) | - | ||||||||||||||||||||||||||||||||||||
| 2790 | { | - | ||||||||||||||||||||||||||||||||||||
| 2791 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2792 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2793 | - | |||||||||||||||||||||||||||||||||||||
| 2794 | QPointF pt(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2795 | - | |||||||||||||||||||||||||||||||||||||
| 2796 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2797 | m_path.moveTo(pt); never executed: m_path.moveTo(pt); | 0 | ||||||||||||||||||||||||||||||||||||
| 2798 | else if (m_path.currentPosition() != pt
| 0 | ||||||||||||||||||||||||||||||||||||
| 2799 | m_path.lineTo(pt); never executed: m_path.lineTo(pt); | 0 | ||||||||||||||||||||||||||||||||||||
| 2800 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2801 | - | |||||||||||||||||||||||||||||||||||||
| 2802 | void QQuickContext2D::quadraticCurveTo(qreal cpx, qreal cpy, | - | ||||||||||||||||||||||||||||||||||||
| 2803 | qreal x, qreal y) | - | ||||||||||||||||||||||||||||||||||||
| 2804 | { | - | ||||||||||||||||||||||||||||||||||||
| 2805 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2806 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2807 | - | |||||||||||||||||||||||||||||||||||||
| 2808 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2809 | m_path.moveTo(QPointF(cpx, cpy)); never executed: m_path.moveTo(QPointF(cpx, cpy)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2810 | - | |||||||||||||||||||||||||||||||||||||
| 2811 | QPointF pt(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2812 | if (m_path.currentPosition() != pt
| 0 | ||||||||||||||||||||||||||||||||||||
| 2813 | m_path.quadTo(QPointF(cpx, cpy), pt); never executed: m_path.quadTo(QPointF(cpx, cpy), pt); | 0 | ||||||||||||||||||||||||||||||||||||
| 2814 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2815 | - | |||||||||||||||||||||||||||||||||||||
| 2816 | void QQuickContext2D::bezierCurveTo(qreal cp1x, qreal cp1y, | - | ||||||||||||||||||||||||||||||||||||
| 2817 | qreal cp2x, qreal cp2y, | - | ||||||||||||||||||||||||||||||||||||
| 2818 | qreal x, qreal y) | - | ||||||||||||||||||||||||||||||||||||
| 2819 | { | - | ||||||||||||||||||||||||||||||||||||
| 2820 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2821 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2822 | - | |||||||||||||||||||||||||||||||||||||
| 2823 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2824 | m_path.moveTo(QPointF(cp1x, cp1y)); never executed: m_path.moveTo(QPointF(cp1x, cp1y)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2825 | - | |||||||||||||||||||||||||||||||||||||
| 2826 | QPointF pt(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2827 | if (m_path.currentPosition() != pt
| 0 | ||||||||||||||||||||||||||||||||||||
| 2828 | m_path.cubicTo(QPointF(cp1x, cp1y), QPointF(cp2x, cp2y), pt); never executed: m_path.cubicTo(QPointF(cp1x, cp1y), QPointF(cp2x, cp2y), pt); | 0 | ||||||||||||||||||||||||||||||||||||
| 2829 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2830 | - | |||||||||||||||||||||||||||||||||||||
| 2831 | void QQuickContext2D::addArcTo(const QPointF& p1, const QPointF& p2, float radius) | - | ||||||||||||||||||||||||||||||||||||
| 2832 | { | - | ||||||||||||||||||||||||||||||||||||
| 2833 | QPointF p0(m_path.currentPosition()); | - | ||||||||||||||||||||||||||||||||||||
| 2834 | - | |||||||||||||||||||||||||||||||||||||
| 2835 | QPointF p1p0((p0.x() - p1.x()), (p0.y() - p1.y())); | - | ||||||||||||||||||||||||||||||||||||
| 2836 | QPointF p1p2((p2.x() - p1.x()), (p2.y() - p1.y())); | - | ||||||||||||||||||||||||||||||||||||
| 2837 | float p1p0_length = std::sqrt(p1p0.x() * p1p0.x() + p1p0.y() * p1p0.y()); | - | ||||||||||||||||||||||||||||||||||||
| 2838 | float p1p2_length = std::sqrt(p1p2.x() * p1p2.x() + p1p2.y() * p1p2.y()); | - | ||||||||||||||||||||||||||||||||||||
| 2839 | - | |||||||||||||||||||||||||||||||||||||
| 2840 | double cos_phi = (p1p0.x() * p1p2.x() + p1p0.y() * p1p2.y()) / (p1p0_length * p1p2_length); | - | ||||||||||||||||||||||||||||||||||||
| 2841 | - | |||||||||||||||||||||||||||||||||||||
| 2842 | - | |||||||||||||||||||||||||||||||||||||
| 2843 | - | |||||||||||||||||||||||||||||||||||||
| 2844 | - | |||||||||||||||||||||||||||||||||||||
| 2845 | if (qFuzzyCompare(std::abs(cos_phi), 1.0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2846 | m_path.lineTo(p1); | - | ||||||||||||||||||||||||||||||||||||
| 2847 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2848 | } | - | ||||||||||||||||||||||||||||||||||||
| 2849 | - | |||||||||||||||||||||||||||||||||||||
| 2850 | float tangent = radius / std::tan(std::acos(cos_phi) / 2); | - | ||||||||||||||||||||||||||||||||||||
| 2851 | float factor_p1p0 = tangent / p1p0_length; | - | ||||||||||||||||||||||||||||||||||||
| 2852 | QPointF t_p1p0((p1.x() + factor_p1p0 * p1p0.x()), (p1.y() + factor_p1p0 * p1p0.y())); | - | ||||||||||||||||||||||||||||||||||||
| 2853 | - | |||||||||||||||||||||||||||||||||||||
| 2854 | QPointF orth_p1p0(p1p0.y(), -p1p0.x()); | - | ||||||||||||||||||||||||||||||||||||
| 2855 | float orth_p1p0_length = std::sqrt(orth_p1p0.x() * orth_p1p0.x() + orth_p1p0.y() * orth_p1p0.y()); | - | ||||||||||||||||||||||||||||||||||||
| 2856 | float factor_ra = radius / orth_p1p0_length; | - | ||||||||||||||||||||||||||||||||||||
| 2857 | - | |||||||||||||||||||||||||||||||||||||
| 2858 | - | |||||||||||||||||||||||||||||||||||||
| 2859 | double cos_alpha = (orth_p1p0.x() * p1p2.x() + orth_p1p0.y() * p1p2.y()) / (orth_p1p0_length * p1p2_length); | - | ||||||||||||||||||||||||||||||||||||
| 2860 | if (cos_alpha < 0.f
| 0 | ||||||||||||||||||||||||||||||||||||
| 2861 | orth_p1p0 = QPointF(-orth_p1p0.x(), -orth_p1p0.y()); never executed: orth_p1p0 = QPointF(-orth_p1p0.x(), -orth_p1p0.y()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2862 | - | |||||||||||||||||||||||||||||||||||||
| 2863 | QPointF p((t_p1p0.x() + factor_ra * orth_p1p0.x()), (t_p1p0.y() + factor_ra * orth_p1p0.y())); | - | ||||||||||||||||||||||||||||||||||||
| 2864 | - | |||||||||||||||||||||||||||||||||||||
| 2865 | - | |||||||||||||||||||||||||||||||||||||
| 2866 | orth_p1p0 = QPointF(-orth_p1p0.x(), -orth_p1p0.y()); | - | ||||||||||||||||||||||||||||||||||||
| 2867 | float sa = std::acos(orth_p1p0.x() / orth_p1p0_length); | - | ||||||||||||||||||||||||||||||||||||
| 2868 | if (orth_p1p0.y() < 0.f
| 0 | ||||||||||||||||||||||||||||||||||||
| 2869 | sa = 2 * never executed: sa = 2 * 3.14159265358979323846 - sa; | 0 | ||||||||||||||||||||||||||||||||||||
| 2870 | 3.14159265358979323846 never executed: sa = 2 * 3.14159265358979323846 - sa; | 0 | ||||||||||||||||||||||||||||||||||||
| 2871 | - sa; never executed: sa = 2 * 3.14159265358979323846 - sa; | 0 | ||||||||||||||||||||||||||||||||||||
| 2872 | - | |||||||||||||||||||||||||||||||||||||
| 2873 | - | |||||||||||||||||||||||||||||||||||||
| 2874 | bool anticlockwise = false; | - | ||||||||||||||||||||||||||||||||||||
| 2875 | - | |||||||||||||||||||||||||||||||||||||
| 2876 | float factor_p1p2 = tangent / p1p2_length; | - | ||||||||||||||||||||||||||||||||||||
| 2877 | QPointF t_p1p2((p1.x() + factor_p1p2 * p1p2.x()), (p1.y() + factor_p1p2 * p1p2.y())); | - | ||||||||||||||||||||||||||||||||||||
| 2878 | QPointF orth_p1p2((t_p1p2.x() - p.x()), (t_p1p2.y() - p.y())); | - | ||||||||||||||||||||||||||||||||||||
| 2879 | float orth_p1p2_length = std::sqrt(orth_p1p2.x() * orth_p1p2.x() + orth_p1p2.y() * orth_p1p2.y()); | - | ||||||||||||||||||||||||||||||||||||
| 2880 | float ea = std::acos(orth_p1p2.x() / orth_p1p2_length); | - | ||||||||||||||||||||||||||||||||||||
| 2881 | if (orth_p1p2.y() < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2882 | ea = 2 * never executed: ea = 2 * 3.14159265358979323846 - ea; | 0 | ||||||||||||||||||||||||||||||||||||
| 2883 | 3.14159265358979323846 never executed: ea = 2 * 3.14159265358979323846 - ea; | 0 | ||||||||||||||||||||||||||||||||||||
| 2884 | - ea; never executed: ea = 2 * 3.14159265358979323846 - ea; | 0 | ||||||||||||||||||||||||||||||||||||
| 2885 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 2886 | 3.14159265358979323846
| 0 | ||||||||||||||||||||||||||||||||||||
| 2887 | )
| 0 | ||||||||||||||||||||||||||||||||||||
| 2888 | anticlockwise = true; never executed: anticlockwise = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2889 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 2890 | 3.14159265358979323846
| 0 | ||||||||||||||||||||||||||||||||||||
| 2891 | )
| 0 | ||||||||||||||||||||||||||||||||||||
| 2892 | anticlockwise = true; never executed: anticlockwise = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2893 | - | |||||||||||||||||||||||||||||||||||||
| 2894 | arc(p.x(), p.y(), radius, sa, ea, anticlockwise); | - | ||||||||||||||||||||||||||||||||||||
| 2895 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2896 | - | |||||||||||||||||||||||||||||||||||||
| 2897 | void QQuickContext2D::arcTo(qreal x1, qreal y1, | - | ||||||||||||||||||||||||||||||||||||
| 2898 | qreal x2, qreal y2, | - | ||||||||||||||||||||||||||||||||||||
| 2899 | qreal radius) | - | ||||||||||||||||||||||||||||||||||||
| 2900 | { | - | ||||||||||||||||||||||||||||||||||||
| 2901 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2902 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2903 | - | |||||||||||||||||||||||||||||||||||||
| 2904 | if (!qt_is_finite(x1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2905 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2906 | - | |||||||||||||||||||||||||||||||||||||
| 2907 | QPointF st(x1, y1); | - | ||||||||||||||||||||||||||||||||||||
| 2908 | QPointF end(x2, y2); | - | ||||||||||||||||||||||||||||||||||||
| 2909 | - | |||||||||||||||||||||||||||||||||||||
| 2910 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2911 | m_path.moveTo(st); never executed: m_path.moveTo(st); | 0 | ||||||||||||||||||||||||||||||||||||
| 2912 | else if (st == m_path.currentPosition()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2913 | lineTo(x1, y1); never executed: lineTo(x1, y1); | 0 | ||||||||||||||||||||||||||||||||||||
| 2914 | else | - | ||||||||||||||||||||||||||||||||||||
| 2915 | addArcTo(st, end, radius); never executed: addArcTo(st, end, radius); | 0 | ||||||||||||||||||||||||||||||||||||
| 2916 | } | - | ||||||||||||||||||||||||||||||||||||
| 2917 | - | |||||||||||||||||||||||||||||||||||||
| 2918 | void QQuickContext2D::rect(qreal x, qreal y, qreal w, qreal h) | - | ||||||||||||||||||||||||||||||||||||
| 2919 | { | - | ||||||||||||||||||||||||||||||||||||
| 2920 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2921 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2922 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2923 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2924 | - | |||||||||||||||||||||||||||||||||||||
| 2925 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2926 | m_path.moveTo(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2927 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2928 | } | - | ||||||||||||||||||||||||||||||||||||
| 2929 | m_path.addRect(x, y, w, h); | - | ||||||||||||||||||||||||||||||||||||
| 2930 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2931 | - | |||||||||||||||||||||||||||||||||||||
| 2932 | void QQuickContext2D::roundedRect(qreal x, qreal y, | - | ||||||||||||||||||||||||||||||||||||
| 2933 | qreal w, qreal h, | - | ||||||||||||||||||||||||||||||||||||
| 2934 | qreal xr, qreal yr) | - | ||||||||||||||||||||||||||||||||||||
| 2935 | { | - | ||||||||||||||||||||||||||||||||||||
| 2936 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2937 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2938 | - | |||||||||||||||||||||||||||||||||||||
| 2939 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2940 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2941 | - | |||||||||||||||||||||||||||||||||||||
| 2942 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2943 | m_path.moveTo(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2944 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2945 | } | - | ||||||||||||||||||||||||||||||||||||
| 2946 | m_path.addRoundedRect(QRectF(x, y, w, h), xr, yr, Qt::AbsoluteSize); | - | ||||||||||||||||||||||||||||||||||||
| 2947 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2948 | - | |||||||||||||||||||||||||||||||||||||
| 2949 | void QQuickContext2D::ellipse(qreal x, qreal y, | - | ||||||||||||||||||||||||||||||||||||
| 2950 | qreal w, qreal h) | - | ||||||||||||||||||||||||||||||||||||
| 2951 | { | - | ||||||||||||||||||||||||||||||||||||
| 2952 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2953 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2954 | - | |||||||||||||||||||||||||||||||||||||
| 2955 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2956 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2957 | - | |||||||||||||||||||||||||||||||||||||
| 2958 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2959 | m_path.moveTo(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 2960 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2961 | } | - | ||||||||||||||||||||||||||||||||||||
| 2962 | - | |||||||||||||||||||||||||||||||||||||
| 2963 | m_path.addEllipse(x, y, w, h); | - | ||||||||||||||||||||||||||||||||||||
| 2964 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2965 | - | |||||||||||||||||||||||||||||||||||||
| 2966 | void QQuickContext2D::text(const QString& str, qreal x, qreal y) | - | ||||||||||||||||||||||||||||||||||||
| 2967 | { | - | ||||||||||||||||||||||||||||||||||||
| 2968 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2969 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2970 | - | |||||||||||||||||||||||||||||||||||||
| 2971 | QPainterPath path; | - | ||||||||||||||||||||||||||||||||||||
| 2972 | path.addText(x, y, state.font, str); | - | ||||||||||||||||||||||||||||||||||||
| 2973 | m_path.addPath(path); | - | ||||||||||||||||||||||||||||||||||||
| 2974 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2975 | - | |||||||||||||||||||||||||||||||||||||
| 2976 | void QQuickContext2D::arc(qreal xc, qreal yc, qreal radius, qreal sar, qreal ear, bool antiClockWise) | - | ||||||||||||||||||||||||||||||||||||
| 2977 | { | - | ||||||||||||||||||||||||||||||||||||
| 2978 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 2979 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2980 | - | |||||||||||||||||||||||||||||||||||||
| 2981 | if (!qt_is_finite(xc)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2982 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2983 | - | |||||||||||||||||||||||||||||||||||||
| 2984 | if (sar == ear
| 0 | ||||||||||||||||||||||||||||||||||||
| 2985 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2986 | - | |||||||||||||||||||||||||||||||||||||
| 2987 | - | |||||||||||||||||||||||||||||||||||||
| 2988 | - | |||||||||||||||||||||||||||||||||||||
| 2989 | - | |||||||||||||||||||||||||||||||||||||
| 2990 | - | |||||||||||||||||||||||||||||||||||||
| 2991 | - | |||||||||||||||||||||||||||||||||||||
| 2992 | - | |||||||||||||||||||||||||||||||||||||
| 2993 | sar = -sar; | - | ||||||||||||||||||||||||||||||||||||
| 2994 | ear = -ear; | - | ||||||||||||||||||||||||||||||||||||
| 2995 | antiClockWise = !antiClockWise; | - | ||||||||||||||||||||||||||||||||||||
| 2996 | - | |||||||||||||||||||||||||||||||||||||
| 2997 | - | |||||||||||||||||||||||||||||||||||||
| 2998 | float sa = qRadiansToDegrees(sar); | - | ||||||||||||||||||||||||||||||||||||
| 2999 | float ea = qRadiansToDegrees(ear); | - | ||||||||||||||||||||||||||||||||||||
| 3000 | - | |||||||||||||||||||||||||||||||||||||
| 3001 | double span = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3002 | - | |||||||||||||||||||||||||||||||||||||
| 3003 | double xs = xc - radius; | - | ||||||||||||||||||||||||||||||||||||
| 3004 | double ys = yc - radius; | - | ||||||||||||||||||||||||||||||||||||
| 3005 | double width = radius*2; | - | ||||||||||||||||||||||||||||||||||||
| 3006 | double height = radius*2; | - | ||||||||||||||||||||||||||||||||||||
| 3007 | if ((!antiClockWise
| 0 | ||||||||||||||||||||||||||||||||||||
| 3008 | - | |||||||||||||||||||||||||||||||||||||
| 3009 | - | |||||||||||||||||||||||||||||||||||||
| 3010 | - | |||||||||||||||||||||||||||||||||||||
| 3011 | span = 360; never executed: span = 360; | 0 | ||||||||||||||||||||||||||||||||||||
| 3012 | else { | - | ||||||||||||||||||||||||||||||||||||
| 3013 | if (!antiClockWise
| 0 | ||||||||||||||||||||||||||||||||||||
| 3014 | span += 360; | - | ||||||||||||||||||||||||||||||||||||
| 3015 | } never executed: else if (antiClockWiseend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 3016 | span -= 360; | - | ||||||||||||||||||||||||||||||||||||
| 3017 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3018 | - | |||||||||||||||||||||||||||||||||||||
| 3019 | - | |||||||||||||||||||||||||||||||||||||
| 3020 | if (!(qFuzzyCompare(span + (ea - sa) + 1, 1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3021 | qFuzzyCompare(qAbs(span), 360)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3022 | span += ea - sa; | - | ||||||||||||||||||||||||||||||||||||
| 3023 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3024 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3025 | - | |||||||||||||||||||||||||||||||||||||
| 3026 | - | |||||||||||||||||||||||||||||||||||||
| 3027 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3028 | m_path.arcMoveTo(xs, ys, width, height, sa); never executed: m_path.arcMoveTo(xs, ys, width, height, sa); | 0 | ||||||||||||||||||||||||||||||||||||
| 3029 | else if (!radius
| 0 | ||||||||||||||||||||||||||||||||||||
| 3030 | m_path.lineTo(xc, yc); | - | ||||||||||||||||||||||||||||||||||||
| 3031 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3032 | } | - | ||||||||||||||||||||||||||||||||||||
| 3033 | - | |||||||||||||||||||||||||||||||||||||
| 3034 | m_path.arcTo(xs, ys, width, height, sa, span); | - | ||||||||||||||||||||||||||||||||||||
| 3035 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3036 | - | |||||||||||||||||||||||||||||||||||||
| 3037 | int baseLineOffset(QQuickContext2D::TextBaseLineType value, const QFontMetrics &metrics) | - | ||||||||||||||||||||||||||||||||||||
| 3038 | { | - | ||||||||||||||||||||||||||||||||||||
| 3039 | int offset = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3040 | switch (value) { | - | ||||||||||||||||||||||||||||||||||||
| 3041 | case never executed: QQuickContext2D::Top:case QQuickContext2D::Top:never executed: case QQuickContext2D::Top: | 0 | ||||||||||||||||||||||||||||||||||||
| 3042 | case never executed: QQuickContext2D::Hanging:case QQuickContext2D::Hanging:never executed: case QQuickContext2D::Hanging: | 0 | ||||||||||||||||||||||||||||||||||||
| 3043 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3044 | case never executed: QQuickContext2D::Middle:case QQuickContext2D::Middle:never executed: case QQuickContext2D::Middle: | 0 | ||||||||||||||||||||||||||||||||||||
| 3045 | offset = (metrics.ascent() >> 1) + metrics.height() - metrics.ascent(); | - | ||||||||||||||||||||||||||||||||||||
| 3046 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3047 | case never executed: QQuickContext2D::Alphabetic:case QQuickContext2D::Alphabetic:never executed: case QQuickContext2D::Alphabetic: | 0 | ||||||||||||||||||||||||||||||||||||
| 3048 | offset = metrics.ascent(); | - | ||||||||||||||||||||||||||||||||||||
| 3049 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3050 | case never executed: QQuickContext2D::Bottom:case QQuickContext2D::Bottom:never executed: case QQuickContext2D::Bottom: | 0 | ||||||||||||||||||||||||||||||||||||
| 3051 | offset = metrics.height(); | - | ||||||||||||||||||||||||||||||||||||
| 3052 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3053 | } | - | ||||||||||||||||||||||||||||||||||||
| 3054 | return never executed: offset;return offset;never executed: return offset; | 0 | ||||||||||||||||||||||||||||||||||||
| 3055 | } | - | ||||||||||||||||||||||||||||||||||||
| 3056 | - | |||||||||||||||||||||||||||||||||||||
| 3057 | static int textAlignOffset(QQuickContext2D::TextAlignType value, const QFontMetrics &metrics, const QString &text) | - | ||||||||||||||||||||||||||||||||||||
| 3058 | { | - | ||||||||||||||||||||||||||||||||||||
| 3059 | int offset = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3060 | if (value == QQuickContext2D::Start
| 0 | ||||||||||||||||||||||||||||||||||||
| 3061 | value = QGuiApplication::layoutDirection() == Qt::LeftToRight
never executed: value = QGuiApplication::layoutDirection() == Qt::LeftToRight ? QQuickContext2D::Left : QQuickContext2D::Right; | 0 | ||||||||||||||||||||||||||||||||||||
| 3062 | else if (value == QQuickContext2D::End
| 0 | ||||||||||||||||||||||||||||||||||||
| 3063 | value = QGuiApplication::layoutDirection() == Qt::LeftToRight
never executed: value = QGuiApplication::layoutDirection() == Qt::LeftToRight ? QQuickContext2D::Right: QQuickContext2D::Left; | 0 | ||||||||||||||||||||||||||||||||||||
| 3064 | switch (value) { | - | ||||||||||||||||||||||||||||||||||||
| 3065 | case never executed: QQuickContext2D::Center:case QQuickContext2D::Center:never executed: case QQuickContext2D::Center: | 0 | ||||||||||||||||||||||||||||||||||||
| 3066 | offset = metrics.width(text)/2; | - | ||||||||||||||||||||||||||||||||||||
| 3067 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3068 | case never executed: QQuickContext2D::Right:case QQuickContext2D::Right:never executed: case QQuickContext2D::Right: | 0 | ||||||||||||||||||||||||||||||||||||
| 3069 | offset = metrics.width(text); | - | ||||||||||||||||||||||||||||||||||||
| 3070 | case never executed: QQuickContext2D::Left:case QQuickContext2D::Left:never executed: case QQuickContext2D::Left:code before this statement never executed: case QQuickContext2D::Left: | 0 | ||||||||||||||||||||||||||||||||||||
| 3071 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 3072 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3073 | } | - | ||||||||||||||||||||||||||||||||||||
| 3074 | return never executed: offset;return offset;never executed: return offset; | 0 | ||||||||||||||||||||||||||||||||||||
| 3075 | } | - | ||||||||||||||||||||||||||||||||||||
| 3076 | - | |||||||||||||||||||||||||||||||||||||
| 3077 | void QQuickContext2D::setGrabbedImage(const QImage& grab) | - | ||||||||||||||||||||||||||||||||||||
| 3078 | { | - | ||||||||||||||||||||||||||||||||||||
| 3079 | m_grabbedImage = grab; | - | ||||||||||||||||||||||||||||||||||||
| 3080 | m_grabbed = true; | - | ||||||||||||||||||||||||||||||||||||
| 3081 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3082 | - | |||||||||||||||||||||||||||||||||||||
| 3083 | QQmlRefPointer<QQuickCanvasPixmap> QQuickContext2D::createPixmap(const QUrl& url) | - | ||||||||||||||||||||||||||||||||||||
| 3084 | { | - | ||||||||||||||||||||||||||||||||||||
| 3085 | return never executed: m_canvas->loadedPixmap(url);return m_canvas->loadedPixmap(url);never executed: return m_canvas->loadedPixmap(url); | 0 | ||||||||||||||||||||||||||||||||||||
| 3086 | } | - | ||||||||||||||||||||||||||||||||||||
| 3087 | - | |||||||||||||||||||||||||||||||||||||
| 3088 | QPainterPath QQuickContext2D::createTextGlyphs(qreal x, qreal y, const QString& text) | - | ||||||||||||||||||||||||||||||||||||
| 3089 | { | - | ||||||||||||||||||||||||||||||||||||
| 3090 | const QFontMetrics metrics(state.font); | - | ||||||||||||||||||||||||||||||||||||
| 3091 | int yoffset = baseLineOffset(static_cast<QQuickContext2D::TextBaseLineType>(state.textBaseline), metrics); | - | ||||||||||||||||||||||||||||||||||||
| 3092 | int xoffset = textAlignOffset(static_cast<QQuickContext2D::TextAlignType>(state.textAlign), metrics, text); | - | ||||||||||||||||||||||||||||||||||||
| 3093 | - | |||||||||||||||||||||||||||||||||||||
| 3094 | QPainterPath textPath; | - | ||||||||||||||||||||||||||||||||||||
| 3095 | - | |||||||||||||||||||||||||||||||||||||
| 3096 | textPath.addText(x - xoffset, y - yoffset+metrics.ascent(), state.font, text); | - | ||||||||||||||||||||||||||||||||||||
| 3097 | return never executed: textPath;return textPath;never executed: return textPath; | 0 | ||||||||||||||||||||||||||||||||||||
| 3098 | } | - | ||||||||||||||||||||||||||||||||||||
| 3099 | - | |||||||||||||||||||||||||||||||||||||
| 3100 | - | |||||||||||||||||||||||||||||||||||||
| 3101 | static inline bool areCollinear(const QPointF& a, const QPointF& b, const QPointF& c) | - | ||||||||||||||||||||||||||||||||||||
| 3102 | { | - | ||||||||||||||||||||||||||||||||||||
| 3103 | - | |||||||||||||||||||||||||||||||||||||
| 3104 | return never executed: qFuzzyCompare((c.y() - b.y()) * (a.x() - b.x()), (a.y() - b.y()) * (c.x() - b.x()));return qFuzzyCompare((c.y() - b.y()) * (a.x() - b.x()), (a.y() - b.y()) * (c.x() - b.x()));never executed: return qFuzzyCompare((c.y() - b.y()) * (a.x() - b.x()), (a.y() - b.y()) * (c.x() - b.x())); | 0 | ||||||||||||||||||||||||||||||||||||
| 3105 | } | - | ||||||||||||||||||||||||||||||||||||
| 3106 | - | |||||||||||||||||||||||||||||||||||||
| 3107 | static inline bool withinRange(qreal p, qreal a, qreal b) | - | ||||||||||||||||||||||||||||||||||||
| 3108 | { | - | ||||||||||||||||||||||||||||||||||||
| 3109 | return never executed: (p >= a && p <= b) || (p >= b && p <= a);return (p >= a && p <= b) || (p >= b && p <= a);never executed: return (p >= a && p <= b) || (p >= b && p <= a); | 0 | ||||||||||||||||||||||||||||||||||||
| 3110 | } | - | ||||||||||||||||||||||||||||||||||||
| 3111 | - | |||||||||||||||||||||||||||||||||||||
| 3112 | bool QQuickContext2D::isPointInPath(qreal x, qreal y) const | - | ||||||||||||||||||||||||||||||||||||
| 3113 | { | - | ||||||||||||||||||||||||||||||||||||
| 3114 | if (!state.invertibleCTM
| 0 | ||||||||||||||||||||||||||||||||||||
| 3115 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 3116 | - | |||||||||||||||||||||||||||||||||||||
| 3117 | if (!m_path.elementCount()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3118 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 3119 | - | |||||||||||||||||||||||||||||||||||||
| 3120 | if (!qt_is_finite(x)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3121 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 3122 | - | |||||||||||||||||||||||||||||||||||||
| 3123 | QPointF point(x, y); | - | ||||||||||||||||||||||||||||||||||||
| 3124 | QTransform ctm = state.matrix; | - | ||||||||||||||||||||||||||||||||||||
| 3125 | QPointF p = ctm.inverted().map(point); | - | ||||||||||||||||||||||||||||||||||||
| 3126 | if (!qt_is_finite(p.x())
| 0 | ||||||||||||||||||||||||||||||||||||
| 3127 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 3128 | - | |||||||||||||||||||||||||||||||||||||
| 3129 | const_cast<QQuickContext2D *>(this)->m_path.setFillRule(state.fillRule); | - | ||||||||||||||||||||||||||||||||||||
| 3130 | - | |||||||||||||||||||||||||||||||||||||
| 3131 | bool contains = m_path.contains(p); | - | ||||||||||||||||||||||||||||||||||||
| 3132 | - | |||||||||||||||||||||||||||||||||||||
| 3133 | if (!contains
| 0 | ||||||||||||||||||||||||||||||||||||
| 3134 | - | |||||||||||||||||||||||||||||||||||||
| 3135 | QPolygonF border = m_path.toFillPolygon(); | - | ||||||||||||||||||||||||||||||||||||
| 3136 | - | |||||||||||||||||||||||||||||||||||||
| 3137 | QPointF p1 = border.at(0); | - | ||||||||||||||||||||||||||||||||||||
| 3138 | QPointF p2; | - | ||||||||||||||||||||||||||||||||||||
| 3139 | - | |||||||||||||||||||||||||||||||||||||
| 3140 | for (int i = 1; i < border.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3141 | p2 = border.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 3142 | if (areCollinear(p, p1, p2)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3143 | - | |||||||||||||||||||||||||||||||||||||
| 3144 | - | |||||||||||||||||||||||||||||||||||||
| 3145 | && (
| 0 | ||||||||||||||||||||||||||||||||||||
| 3146 | withinRange(p.x(), p1.x(), p2.x()) :
| 0 | ||||||||||||||||||||||||||||||||||||
| 3147 | withinRange(p.y(), p1.y(), p2.y()))
| 0 | ||||||||||||||||||||||||||||||||||||
| 3148 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 3149 | } | - | ||||||||||||||||||||||||||||||||||||
| 3150 | p1 = p2; | - | ||||||||||||||||||||||||||||||||||||
| 3151 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3152 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3153 | return never executed: contains;return contains;never executed: return contains; | 0 | ||||||||||||||||||||||||||||||||||||
| 3154 | } | - | ||||||||||||||||||||||||||||||||||||
| 3155 | - | |||||||||||||||||||||||||||||||||||||
| 3156 | class QQuickContext2DThreadCleanup : public QObject | - | ||||||||||||||||||||||||||||||||||||
| 3157 | { | - | ||||||||||||||||||||||||||||||||||||
| 3158 | public: | - | ||||||||||||||||||||||||||||||||||||
| 3159 | QQuickContext2DThreadCleanup(QOpenGLContext *gl, QQuickContext2DTexture *t, QOffscreenSurface *s) | - | ||||||||||||||||||||||||||||||||||||
| 3160 | : context(gl), texture(t), surface(s) | - | ||||||||||||||||||||||||||||||||||||
| 3161 | { } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3162 | - | |||||||||||||||||||||||||||||||||||||
| 3163 | ~QQuickContext2DThreadCleanup() | - | ||||||||||||||||||||||||||||||||||||
| 3164 | { | - | ||||||||||||||||||||||||||||||||||||
| 3165 | - | |||||||||||||||||||||||||||||||||||||
| 3166 | context->makeCurrent(surface); | - | ||||||||||||||||||||||||||||||||||||
| 3167 | delete texture; | - | ||||||||||||||||||||||||||||||||||||
| 3168 | context->doneCurrent(); | - | ||||||||||||||||||||||||||||||||||||
| 3169 | delete context; | - | ||||||||||||||||||||||||||||||||||||
| 3170 | - | |||||||||||||||||||||||||||||||||||||
| 3171 | surface->deleteLater(); | - | ||||||||||||||||||||||||||||||||||||
| 3172 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3173 | - | |||||||||||||||||||||||||||||||||||||
| 3174 | QOpenGLContext *context; | - | ||||||||||||||||||||||||||||||||||||
| 3175 | QQuickContext2DTexture *texture; | - | ||||||||||||||||||||||||||||||||||||
| 3176 | QOffscreenSurface *surface; | - | ||||||||||||||||||||||||||||||||||||
| 3177 | }; | - | ||||||||||||||||||||||||||||||||||||
| 3178 | - | |||||||||||||||||||||||||||||||||||||
| 3179 | class QQuickContext2DTextureCleanup : public QRunnable | - | ||||||||||||||||||||||||||||||||||||
| 3180 | { | - | ||||||||||||||||||||||||||||||||||||
| 3181 | public: | - | ||||||||||||||||||||||||||||||||||||
| 3182 | QQuickContext2DTexture *texture; | - | ||||||||||||||||||||||||||||||||||||
| 3183 | void run() override { delete texture; } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3184 | }; | - | ||||||||||||||||||||||||||||||||||||
| 3185 | - | |||||||||||||||||||||||||||||||||||||
| 3186 | QMutex QQuickContext2D::mutex; | - | ||||||||||||||||||||||||||||||||||||
| 3187 | - | |||||||||||||||||||||||||||||||||||||
| 3188 | QQuickContext2D::QQuickContext2D(QObject *parent) | - | ||||||||||||||||||||||||||||||||||||
| 3189 | : QQuickCanvasContext(parent) | - | ||||||||||||||||||||||||||||||||||||
| 3190 | , m_buffer(new QQuickContext2DCommandBuffer) | - | ||||||||||||||||||||||||||||||||||||
| 3191 | , m_v4engine(nullptr) | - | ||||||||||||||||||||||||||||||||||||
| 3192 | , m_surface(nullptr) | - | ||||||||||||||||||||||||||||||||||||
| 3193 | , m_glContext(nullptr) | - | ||||||||||||||||||||||||||||||||||||
| 3194 | , m_thread(nullptr) | - | ||||||||||||||||||||||||||||||||||||
| 3195 | , m_grabbed(false) | - | ||||||||||||||||||||||||||||||||||||
| 3196 | { | - | ||||||||||||||||||||||||||||||||||||
| 3197 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3198 | - | |||||||||||||||||||||||||||||||||||||
| 3199 | QQuickContext2D::~QQuickContext2D() | - | ||||||||||||||||||||||||||||||||||||
| 3200 | { | - | ||||||||||||||||||||||||||||||||||||
| 3201 | mutex.lock(); | - | ||||||||||||||||||||||||||||||||||||
| 3202 | m_texture->setItem(nullptr); | - | ||||||||||||||||||||||||||||||||||||
| 3203 | delete m_buffer; | - | ||||||||||||||||||||||||||||||||||||
| 3204 | - | |||||||||||||||||||||||||||||||||||||
| 3205 | if (m_renderTarget == QQuickCanvasItem::FramebufferObject
| 0 | ||||||||||||||||||||||||||||||||||||
| 3206 | - | |||||||||||||||||||||||||||||||||||||
| 3207 | if (m_renderStrategy == QQuickCanvasItem::Immediate
| 0 | ||||||||||||||||||||||||||||||||||||
| 3208 | ((QThread::currentThread() == m_glContext->thread()) ? static_cast<void>(0) : qt_assert("QThread::currentThread() == m_glContext->thread()", __FILE__, 4080)); | - | ||||||||||||||||||||||||||||||||||||
| 3209 | m_glContext->makeCurrent(m_surface.data()); | - | ||||||||||||||||||||||||||||||||||||
| 3210 | delete m_texture; | - | ||||||||||||||||||||||||||||||||||||
| 3211 | m_glContext->doneCurrent(); | - | ||||||||||||||||||||||||||||||||||||
| 3212 | delete m_glContext; | - | ||||||||||||||||||||||||||||||||||||
| 3213 | } never executed: else if (m_texture->isOnCustomThread()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 3214 | ((m_glContext) ? static_cast<void>(0) : qt_assert("m_glContext", __FILE__, 4086)); | - | ||||||||||||||||||||||||||||||||||||
| 3215 | QQuickContext2DThreadCleanup *cleaner = new QQuickContext2DThreadCleanup(m_glContext, m_texture, m_surface.take()); | - | ||||||||||||||||||||||||||||||||||||
| 3216 | cleaner->moveToThread(m_texture->thread()); | - | ||||||||||||||||||||||||||||||||||||
| 3217 | cleaner->deleteLater(); | - | ||||||||||||||||||||||||||||||||||||
| 3218 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3219 | if (m_canvas->window()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3220 | QQuickContext2DTextureCleanup *c = new QQuickContext2DTextureCleanup; | - | ||||||||||||||||||||||||||||||||||||
| 3221 | c->texture = m_texture; | - | ||||||||||||||||||||||||||||||||||||
| 3222 | m_canvas->window()->scheduleRenderJob(c, QQuickWindow::AfterSynchronizingStage); | - | ||||||||||||||||||||||||||||||||||||
| 3223 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3224 | m_texture->deleteLater(); | - | ||||||||||||||||||||||||||||||||||||
| 3225 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3226 | } | - | ||||||||||||||||||||||||||||||||||||
| 3227 | - | |||||||||||||||||||||||||||||||||||||
| 3228 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 3229 | - | |||||||||||||||||||||||||||||||||||||
| 3230 | - | |||||||||||||||||||||||||||||||||||||
| 3231 | - | |||||||||||||||||||||||||||||||||||||
| 3232 | m_texture->deleteLater(); | - | ||||||||||||||||||||||||||||||||||||
| 3233 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3234 | mutex.unlock(); | - | ||||||||||||||||||||||||||||||||||||
| 3235 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3236 | - | |||||||||||||||||||||||||||||||||||||
| 3237 | QV4::ReturnedValue QQuickContext2D::v4value() const | - | ||||||||||||||||||||||||||||||||||||
| 3238 | { | - | ||||||||||||||||||||||||||||||||||||
| 3239 | return never executed: m_v4value.value();return m_v4value.value();never executed: return m_v4value.value(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3240 | } | - | ||||||||||||||||||||||||||||||||||||
| 3241 | - | |||||||||||||||||||||||||||||||||||||
| 3242 | QStringList QQuickContext2D::contextNames() const | - | ||||||||||||||||||||||||||||||||||||
| 3243 | { | - | ||||||||||||||||||||||||||||||||||||
| 3244 | return never executed: QStringList() << ([]() noexcept -> QString { enum { Size = sizeof(u"" "2d")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "2d" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn QStringList() << ([]() noexcept -> QString { enum { Size = sizeof(u"" "2d")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "2d" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return QStringList() << ([]() noexcept -> QString { enum { Size = sizeof(u"" "2d")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "2d" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||||||||||||||||||||
| 3245 | } | - | ||||||||||||||||||||||||||||||||||||
| 3246 | - | |||||||||||||||||||||||||||||||||||||
| 3247 | void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args) | - | ||||||||||||||||||||||||||||||||||||
| 3248 | { | - | ||||||||||||||||||||||||||||||||||||
| 3249 | (void)args;; | - | ||||||||||||||||||||||||||||||||||||
| 3250 | - | |||||||||||||||||||||||||||||||||||||
| 3251 | m_canvas = canvasItem; | - | ||||||||||||||||||||||||||||||||||||
| 3252 | m_renderTarget = canvasItem->renderTarget(); | - | ||||||||||||||||||||||||||||||||||||
| 3253 | m_renderStrategy = canvasItem->renderStrategy(); | - | ||||||||||||||||||||||||||||||||||||
| 3254 | if (m_renderTarget == QQuickCanvasItem::FramebufferObject
| 0 | ||||||||||||||||||||||||||||||||||||
| 3255 | && m_renderStrategy == QQuickCanvasItem::Threaded
| 0 | ||||||||||||||||||||||||||||||||||||
| 3256 | && !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3257 | m_renderTarget = QQuickCanvasItem::Image; | - | ||||||||||||||||||||||||||||||||||||
| 3258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3259 | - | |||||||||||||||||||||||||||||||||||||
| 3260 | - | |||||||||||||||||||||||||||||||||||||
| 3261 | if (m_renderTarget == QQuickCanvasItem::FramebufferObject
| 0 | ||||||||||||||||||||||||||||||||||||
| 3262 | QSGRendererInterface *rif = canvasItem->window()->rendererInterface(); | - | ||||||||||||||||||||||||||||||||||||
| 3263 | if (rif
| 0 | ||||||||||||||||||||||||||||||||||||
| 3264 | m_renderTarget = QQuickCanvasItem::Image; never executed: m_renderTarget = QQuickCanvasItem::Image; | 0 | ||||||||||||||||||||||||||||||||||||
| 3265 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3266 | - | |||||||||||||||||||||||||||||||||||||
| 3267 | switch (m_renderTarget) { | - | ||||||||||||||||||||||||||||||||||||
| 3268 | case never executed: QQuickCanvasItem::Image:case QQuickCanvasItem::Image:never executed: case QQuickCanvasItem::Image: | 0 | ||||||||||||||||||||||||||||||||||||
| 3269 | m_texture = new QQuickContext2DImageTexture; | - | ||||||||||||||||||||||||||||||||||||
| 3270 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3271 | case never executed: QQuickCanvasItem::FramebufferObject:case QQuickCanvasItem::FramebufferObject:never executed: case QQuickCanvasItem::FramebufferObject: | 0 | ||||||||||||||||||||||||||||||||||||
| 3272 | - | |||||||||||||||||||||||||||||||||||||
| 3273 | m_texture = new QQuickContext2DFBOTexture; | - | ||||||||||||||||||||||||||||||||||||
| 3274 | - | |||||||||||||||||||||||||||||||||||||
| 3275 | - | |||||||||||||||||||||||||||||||||||||
| 3276 | - | |||||||||||||||||||||||||||||||||||||
| 3277 | - | |||||||||||||||||||||||||||||||||||||
| 3278 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3279 | } | - | ||||||||||||||||||||||||||||||||||||
| 3280 | - | |||||||||||||||||||||||||||||||||||||
| 3281 | m_texture->setItem(canvasItem); | - | ||||||||||||||||||||||||||||||||||||
| 3282 | m_texture->setCanvasWindow(canvasItem->canvasWindow().toRect()); | - | ||||||||||||||||||||||||||||||||||||
| 3283 | m_texture->setTileSize(canvasItem->tileSize()); | - | ||||||||||||||||||||||||||||||||||||
| 3284 | m_texture->setCanvasSize(canvasItem->canvasSize().toSize()); | - | ||||||||||||||||||||||||||||||||||||
| 3285 | m_texture->setSmooth(canvasItem->smooth()); | - | ||||||||||||||||||||||||||||||||||||
| 3286 | m_texture->setAntialiasing(canvasItem->antialiasing()); | - | ||||||||||||||||||||||||||||||||||||
| 3287 | m_texture->setOnCustomThread(m_renderStrategy == QQuickCanvasItem::Threaded); | - | ||||||||||||||||||||||||||||||||||||
| 3288 | m_thread = QThread::currentThread(); | - | ||||||||||||||||||||||||||||||||||||
| 3289 | - | |||||||||||||||||||||||||||||||||||||
| 3290 | QThread *renderThread = m_thread; | - | ||||||||||||||||||||||||||||||||||||
| 3291 | - | |||||||||||||||||||||||||||||||||||||
| 3292 | QQuickWindow *window = canvasItem->window(); | - | ||||||||||||||||||||||||||||||||||||
| 3293 | QQuickWindowPrivate *wd = QQuickWindowPrivate::get(window); | - | ||||||||||||||||||||||||||||||||||||
| 3294 | QThread *sceneGraphThread = wd->context->thread(); | - | ||||||||||||||||||||||||||||||||||||
| 3295 | - | |||||||||||||||||||||||||||||||||||||
| 3296 | if (m_renderStrategy == QQuickCanvasItem::Threaded
| 0 | ||||||||||||||||||||||||||||||||||||
| 3297 | renderThread = QQuickContext2DRenderThread::instance(qmlEngine(canvasItem)); never executed: renderThread = QQuickContext2DRenderThread::instance(qmlEngine(canvasItem)); | 0 | ||||||||||||||||||||||||||||||||||||
| 3298 | else if (m_renderStrategy == QQuickCanvasItem::Cooperative
| 0 | ||||||||||||||||||||||||||||||||||||
| 3299 | renderThread = sceneGraphThread; never executed: renderThread = sceneGraphThread; | 0 | ||||||||||||||||||||||||||||||||||||
| 3300 | - | |||||||||||||||||||||||||||||||||||||
| 3301 | - | |||||||||||||||||||||||||||||||||||||
| 3302 | - | |||||||||||||||||||||||||||||||||||||
| 3303 | - | |||||||||||||||||||||||||||||||||||||
| 3304 | - | |||||||||||||||||||||||||||||||||||||
| 3305 | - | |||||||||||||||||||||||||||||||||||||
| 3306 | if (renderThread
| 0 | ||||||||||||||||||||||||||||||||||||
| 3307 | m_texture->moveToThread(renderThread); never executed: m_texture->moveToThread(renderThread); | 0 | ||||||||||||||||||||||||||||||||||||
| 3308 | - | |||||||||||||||||||||||||||||||||||||
| 3309 | if (m_renderTarget == QQuickCanvasItem::FramebufferObject
| 0 | ||||||||||||||||||||||||||||||||||||
| 3310 | auto openglRenderContext = static_cast<const QSGDefaultRenderContext *>(QQuickWindowPrivate::get(window)->context); | - | ||||||||||||||||||||||||||||||||||||
| 3311 | QOpenGLContext *cc = openglRenderContext->openglContext(); | - | ||||||||||||||||||||||||||||||||||||
| 3312 | m_surface.reset(new QOffscreenSurface); | - | ||||||||||||||||||||||||||||||||||||
| 3313 | m_surface->setFormat(window->format()); | - | ||||||||||||||||||||||||||||||||||||
| 3314 | m_surface->create(); | - | ||||||||||||||||||||||||||||||||||||
| 3315 | m_glContext = new QOpenGLContext; | - | ||||||||||||||||||||||||||||||||||||
| 3316 | m_glContext->setFormat(cc->format()); | - | ||||||||||||||||||||||||||||||||||||
| 3317 | m_glContext->setShareContext(cc); | - | ||||||||||||||||||||||||||||||||||||
| 3318 | if (renderThread != QThread::currentThread()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3319 | m_glContext->moveToThread(renderThread); never executed: m_glContext->moveToThread(renderThread); | 0 | ||||||||||||||||||||||||||||||||||||
| 3320 | m_texture->initializeOpenGL(m_glContext, m_surface.data()); | - | ||||||||||||||||||||||||||||||||||||
| 3321 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3322 | - | |||||||||||||||||||||||||||||||||||||
| 3323 | connect(m_texture, qFlagLocation("2""textureChanged()" "\0" __FILE__ ":" "4206"), qFlagLocation("2""textureChanged()" "\0" __FILE__ ":" "4206")); | - | ||||||||||||||||||||||||||||||||||||
| 3324 | - | |||||||||||||||||||||||||||||||||||||
| 3325 | reset(); | - | ||||||||||||||||||||||||||||||||||||
| 3326 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3327 | - | |||||||||||||||||||||||||||||||||||||
| 3328 | void QQuickContext2D::prepare(const QSize& canvasSize, const QSize& tileSize, const QRect& canvasWindow, const QRect& dirtyRect, bool smooth, bool antialiasing) | - | ||||||||||||||||||||||||||||||||||||
| 3329 | { | - | ||||||||||||||||||||||||||||||||||||
| 3330 | if (m_texture->thread() == QThread::currentThread()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3331 | m_texture->canvasChanged(canvasSize, tileSize, canvasWindow, dirtyRect, smooth, antialiasing); | - | ||||||||||||||||||||||||||||||||||||
| 3332 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3333 | QEvent *e = new QQuickContext2DTexture::CanvasChangeEvent(canvasSize, | - | ||||||||||||||||||||||||||||||||||||
| 3334 | tileSize, | - | ||||||||||||||||||||||||||||||||||||
| 3335 | canvasWindow, | - | ||||||||||||||||||||||||||||||||||||
| 3336 | dirtyRect, | - | ||||||||||||||||||||||||||||||||||||
| 3337 | smooth, | - | ||||||||||||||||||||||||||||||||||||
| 3338 | antialiasing); | - | ||||||||||||||||||||||||||||||||||||
| 3339 | QCoreApplication::postEvent(m_texture, e); | - | ||||||||||||||||||||||||||||||||||||
| 3340 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3341 | } | - | ||||||||||||||||||||||||||||||||||||
| 3342 | - | |||||||||||||||||||||||||||||||||||||
| 3343 | void QQuickContext2D::flush() | - | ||||||||||||||||||||||||||||||||||||
| 3344 | { | - | ||||||||||||||||||||||||||||||||||||
| 3345 | if (m_buffer
| 0 | ||||||||||||||||||||||||||||||||||||
| 3346 | if (m_texture->thread() == QThread::currentThread()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3347 | m_texture->paint(m_buffer); never executed: m_texture->paint(m_buffer); | 0 | ||||||||||||||||||||||||||||||||||||
| 3348 | else | - | ||||||||||||||||||||||||||||||||||||
| 3349 | QCoreApplication::postEvent(m_texture, new QQuickContext2DTexture::PaintEvent(m_buffer)); never executed: QCoreApplication::postEvent(m_texture, new QQuickContext2DTexture::PaintEvent(m_buffer)); | 0 | ||||||||||||||||||||||||||||||||||||
| 3350 | } | - | ||||||||||||||||||||||||||||||||||||
| 3351 | m_buffer = new QQuickContext2DCommandBuffer(); | - | ||||||||||||||||||||||||||||||||||||
| 3352 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3353 | - | |||||||||||||||||||||||||||||||||||||
| 3354 | QQuickContext2DTexture *QQuickContext2D::texture() const | - | ||||||||||||||||||||||||||||||||||||
| 3355 | { | - | ||||||||||||||||||||||||||||||||||||
| 3356 | return never executed: m_texture;return m_texture;never executed: return m_texture; | 0 | ||||||||||||||||||||||||||||||||||||
| 3357 | } | - | ||||||||||||||||||||||||||||||||||||
| 3358 | - | |||||||||||||||||||||||||||||||||||||
| 3359 | QImage QQuickContext2D::toImage(const QRectF& bounds) | - | ||||||||||||||||||||||||||||||||||||
| 3360 | { | - | ||||||||||||||||||||||||||||||||||||
| 3361 | if (m_texture->thread() == QThread::currentThread()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3362 | - | |||||||||||||||||||||||||||||||||||||
| 3363 | - | |||||||||||||||||||||||||||||||||||||
| 3364 | - | |||||||||||||||||||||||||||||||||||||
| 3365 | if (m_renderTarget != QQuickCanvasItem::FramebufferObject
| 0 | ||||||||||||||||||||||||||||||||||||
| 3366 | flush(); | - | ||||||||||||||||||||||||||||||||||||
| 3367 | m_texture->grabImage(bounds); | - | ||||||||||||||||||||||||||||||||||||
| 3368 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3369 | - | |||||||||||||||||||||||||||||||||||||
| 3370 | QQuickWindow *window = m_canvas->window(); | - | ||||||||||||||||||||||||||||||||||||
| 3371 | QOpenGLContext *ctx = window
| 0 | ||||||||||||||||||||||||||||||||||||
| 3372 | if (ctx
| 0 | ||||||||||||||||||||||||||||||||||||
| 3373 | if (ctx == QOpenGLContext::currentContext()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3374 | flush(); | - | ||||||||||||||||||||||||||||||||||||
| 3375 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3376 | ctx->makeCurrent(window); | - | ||||||||||||||||||||||||||||||||||||
| 3377 | flush(); | - | ||||||||||||||||||||||||||||||||||||
| 3378 | ctx->doneCurrent(); | - | ||||||||||||||||||||||||||||||||||||
| 3379 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3380 | m_texture->grabImage(bounds); | - | ||||||||||||||||||||||||||||||||||||
| 3381 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3382 | QMessageLogger(__FILE__, 4265, __PRETTY_FUNCTION__).warning() << "Cannot read pixels from canvas before opengl context is valid"; | - | ||||||||||||||||||||||||||||||||||||
| 3383 | return never executed: QImage();return QImage();never executed: return QImage(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3384 | } | - | ||||||||||||||||||||||||||||||||||||
| 3385 | - | |||||||||||||||||||||||||||||||||||||
| 3386 | - | |||||||||||||||||||||||||||||||||||||
| 3387 | - | |||||||||||||||||||||||||||||||||||||
| 3388 | - | |||||||||||||||||||||||||||||||||||||
| 3389 | } | - | ||||||||||||||||||||||||||||||||||||
| 3390 | } else if (m_renderStrategy == QQuickCanvasItem::Cooperative
| 0 | ||||||||||||||||||||||||||||||||||||
| 3391 | QMessageLogger(__FILE__, 4274, __PRETTY_FUNCTION__).warning() << "Pixel readback is not supported in Cooperative mode, please try Threaded or Immediate mode"; | - | ||||||||||||||||||||||||||||||||||||
| 3392 | return never executed: QImage();return QImage();never executed: return QImage(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3393 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 3394 | flush(); | - | ||||||||||||||||||||||||||||||||||||
| 3395 | QCoreApplication::postEvent(m_texture, new QEvent(QEvent::Type(QEvent::User + 10))); | - | ||||||||||||||||||||||||||||||||||||
| 3396 | QMetaObject::invokeMethod(m_texture, | - | ||||||||||||||||||||||||||||||||||||
| 3397 | "grabImage", | - | ||||||||||||||||||||||||||||||||||||
| 3398 | Qt::BlockingQueuedConnection, | - | ||||||||||||||||||||||||||||||||||||
| 3399 | QArgument<QRectF >("QRectF", bounds)); | - | ||||||||||||||||||||||||||||||||||||
| 3400 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3401 | QImage img = m_grabbedImage; | - | ||||||||||||||||||||||||||||||||||||
| 3402 | m_grabbedImage = QImage(); | - | ||||||||||||||||||||||||||||||||||||
| 3403 | m_grabbed = false; | - | ||||||||||||||||||||||||||||||||||||
| 3404 | return never executed: img;return img;never executed: return img; | 0 | ||||||||||||||||||||||||||||||||||||
| 3405 | } | - | ||||||||||||||||||||||||||||||||||||
| 3406 | - | |||||||||||||||||||||||||||||||||||||
| 3407 | - | |||||||||||||||||||||||||||||||||||||
| 3408 | QQuickContext2DEngineData::QQuickContext2DEngineData(QV4::ExecutionEngine *v4) | - | ||||||||||||||||||||||||||||||||||||
| 3409 | { | - | ||||||||||||||||||||||||||||||||||||
| 3410 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||||||||||||||
| 3411 | - | |||||||||||||||||||||||||||||||||||||
| 3412 | QV4::ScopedObject proto(scope, QQuickJSContext2DPrototype::create(v4)); | - | ||||||||||||||||||||||||||||||||||||
| 3413 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "strokeStyle")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "strokeStyle" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_strokeStyle, QQuickJSContext2D::method_set_strokeStyle);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3414 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "font")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "font" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_font, QQuickJSContext2D::method_set_font);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3415 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fillRule")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fillRule" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_fillRule, QQuickJSContext2D::method_set_fillRule);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3416 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "globalAlpha")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "globalAlpha" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_globalAlpha, QQuickJSContext2D::method_set_globalAlpha);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3417 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "lineCap")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "lineCap" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_lineCap, QQuickJSContext2D::method_set_lineCap);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3418 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "shadowOffsetX")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "shadowOffsetX" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_shadowOffsetX, QQuickJSContext2D::method_set_shadowOffsetX);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3419 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "shadowOffsetY")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "shadowOffsetY" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_shadowOffsetY, QQuickJSContext2D::method_set_shadowOffsetY);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3420 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "globalCompositeOperation")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "globalCompositeOperation" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_globalCompositeOperation, QQuickJSContext2D::method_set_globalCompositeOperation);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3421 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "miterLimit")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "miterLimit" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_miterLimit, QQuickJSContext2D::method_set_miterLimit);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3422 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fillStyle")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fillStyle" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_fillStyle, QQuickJSContext2D::method_set_fillStyle);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3423 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "shadowColor")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "shadowColor" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_shadowColor, QQuickJSContext2D::method_set_shadowColor);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3424 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "textBaseline")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "textBaseline" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_textBaseline, QQuickJSContext2D::method_set_textBaseline);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3425 | - | |||||||||||||||||||||||||||||||||||||
| 3426 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "path")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "path" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_path, QQuickJSContext2D::method_set_path);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3427 | - | |||||||||||||||||||||||||||||||||||||
| 3428 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "lineJoin")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "lineJoin" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_lineJoin, QQuickJSContext2D::method_set_lineJoin);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3429 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "lineWidth")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "lineWidth" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_lineWidth, QQuickJSContext2D::method_set_lineWidth);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3430 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "textAlign")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "textAlign" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_textAlign, QQuickJSContext2D::method_set_textAlign);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3431 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "shadowBlur")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "shadowBlur" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickJSContext2D::method_get_shadowBlur, QQuickJSContext2D::method_set_shadowBlur);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3432 | contextPrototype = proto; | - | ||||||||||||||||||||||||||||||||||||
| 3433 | - | |||||||||||||||||||||||||||||||||||||
| 3434 | proto = scope.engine->newObject(); | - | ||||||||||||||||||||||||||||||||||||
| 3435 | proto->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "addColorStop")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "addColorStop" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()), QQuickContext2DStyle::gradient_proto_addColorStop, 0);return qstring_literal_temp; | 0 | ||||||||||||||||||||||||||||||||||||
| 3436 | gradientProto = proto; | - | ||||||||||||||||||||||||||||||||||||
| 3437 | - | |||||||||||||||||||||||||||||||||||||
| 3438 | proto = scope.engine->newObject(); | - | ||||||||||||||||||||||||||||||||||||
| 3439 | proto->defineAccessorProperty(scope.engine->id_length(), QQuickJSContext2DPixelData::proto_get_length, nullptr); | - | ||||||||||||||||||||||||||||||||||||
| 3440 | pixelArrayProto = proto; | - | ||||||||||||||||||||||||||||||||||||
| 3441 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3442 | - | |||||||||||||||||||||||||||||||||||||
| 3443 | QQuickContext2DEngineData::~QQuickContext2DEngineData() | - | ||||||||||||||||||||||||||||||||||||
| 3444 | { | - | ||||||||||||||||||||||||||||||||||||
| 3445 | } | - | ||||||||||||||||||||||||||||||||||||
| 3446 | - | |||||||||||||||||||||||||||||||||||||
| 3447 | void QQuickContext2D::popState() | - | ||||||||||||||||||||||||||||||||||||
| 3448 | { | - | ||||||||||||||||||||||||||||||||||||
| 3449 | if (m_stateStack.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3450 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3451 | - | |||||||||||||||||||||||||||||||||||||
| 3452 | QQuickContext2D::State newState = m_stateStack.pop(); | - | ||||||||||||||||||||||||||||||||||||
| 3453 | - | |||||||||||||||||||||||||||||||||||||
| 3454 | if (state.matrix != newState.matrix
| 0 | ||||||||||||||||||||||||||||||||||||
| 3455 | buffer()->updateMatrix(newState.matrix); never executed: buffer()->updateMatrix(newState.matrix); | 0 | ||||||||||||||||||||||||||||||||||||
| 3456 | - | |||||||||||||||||||||||||||||||||||||
| 3457 | if (newState.globalAlpha != state.globalAlpha
| 0 | ||||||||||||||||||||||||||||||||||||
| 3458 | buffer()->setGlobalAlpha(newState.globalAlpha); never executed: buffer()->setGlobalAlpha(newState.globalAlpha); | 0 | ||||||||||||||||||||||||||||||||||||
| 3459 | - | |||||||||||||||||||||||||||||||||||||
| 3460 | if (newState.globalCompositeOperation != state.globalCompositeOperation
| 0 | ||||||||||||||||||||||||||||||||||||
| 3461 | buffer()->setGlobalCompositeOperation(newState.globalCompositeOperation); never executed: buffer()->setGlobalCompositeOperation(newState.globalCompositeOperation); | 0 | ||||||||||||||||||||||||||||||||||||
| 3462 | - | |||||||||||||||||||||||||||||||||||||
| 3463 | if (newState.fillStyle != state.fillStyle
| 0 | ||||||||||||||||||||||||||||||||||||
| 3464 | buffer()->setFillStyle(newState.fillStyle); never executed: buffer()->setFillStyle(newState.fillStyle); | 0 | ||||||||||||||||||||||||||||||||||||
| 3465 | - | |||||||||||||||||||||||||||||||||||||
| 3466 | if (newState.strokeStyle != state.strokeStyle
| 0 | ||||||||||||||||||||||||||||||||||||
| 3467 | buffer()->setStrokeStyle(newState.strokeStyle); never executed: buffer()->setStrokeStyle(newState.strokeStyle); | 0 | ||||||||||||||||||||||||||||||||||||
| 3468 | - | |||||||||||||||||||||||||||||||||||||
| 3469 | if (newState.lineWidth != state.lineWidth
| 0 | ||||||||||||||||||||||||||||||||||||
| 3470 | buffer()->setLineWidth(newState.lineWidth); never executed: buffer()->setLineWidth(newState.lineWidth); | 0 | ||||||||||||||||||||||||||||||||||||
| 3471 | - | |||||||||||||||||||||||||||||||||||||
| 3472 | if (newState.lineCap != state.lineCap
| 0 | ||||||||||||||||||||||||||||||||||||
| 3473 | buffer()->setLineCap(newState.lineCap); never executed: buffer()->setLineCap(newState.lineCap); | 0 | ||||||||||||||||||||||||||||||||||||
| 3474 | - | |||||||||||||||||||||||||||||||||||||
| 3475 | if (newState.lineJoin != state.lineJoin
| 0 | ||||||||||||||||||||||||||||||||||||
| 3476 | buffer()->setLineJoin(newState.lineJoin); never executed: buffer()->setLineJoin(newState.lineJoin); | 0 | ||||||||||||||||||||||||||||||||||||
| 3477 | - | |||||||||||||||||||||||||||||||||||||
| 3478 | if (newState.miterLimit != state.miterLimit
| 0 | ||||||||||||||||||||||||||||||||||||
| 3479 | buffer()->setMiterLimit(newState.miterLimit); never executed: buffer()->setMiterLimit(newState.miterLimit); | 0 | ||||||||||||||||||||||||||||||||||||
| 3480 | - | |||||||||||||||||||||||||||||||||||||
| 3481 | if (newState.clip != state.clip
| 0 | ||||||||||||||||||||||||||||||||||||
| 3482 | buffer()->clip(newState.clip, newState.clipPath); never executed: buffer()->clip(newState.clip, newState.clipPath); | 0 | ||||||||||||||||||||||||||||||||||||
| 3483 | - | |||||||||||||||||||||||||||||||||||||
| 3484 | if (newState.shadowBlur != state.shadowBlur
| 0 | ||||||||||||||||||||||||||||||||||||
| 3485 | buffer()->setShadowBlur(newState.shadowBlur); never executed: buffer()->setShadowBlur(newState.shadowBlur); | 0 | ||||||||||||||||||||||||||||||||||||
| 3486 | - | |||||||||||||||||||||||||||||||||||||
| 3487 | if (newState.shadowColor != state.shadowColor
| 0 | ||||||||||||||||||||||||||||||||||||
| 3488 | buffer()->setShadowColor(newState.shadowColor); never executed: buffer()->setShadowColor(newState.shadowColor); | 0 | ||||||||||||||||||||||||||||||||||||
| 3489 | - | |||||||||||||||||||||||||||||||||||||
| 3490 | if (newState.shadowOffsetX != state.shadowOffsetX
| 0 | ||||||||||||||||||||||||||||||||||||
| 3491 | buffer()->setShadowOffsetX(newState.shadowOffsetX); never executed: buffer()->setShadowOffsetX(newState.shadowOffsetX); | 0 | ||||||||||||||||||||||||||||||||||||
| 3492 | - | |||||||||||||||||||||||||||||||||||||
| 3493 | if (newState.shadowOffsetY != state.shadowOffsetY
| 0 | ||||||||||||||||||||||||||||||||||||
| 3494 | buffer()->setShadowOffsetY(newState.shadowOffsetY); never executed: buffer()->setShadowOffsetY(newState.shadowOffsetY); | 0 | ||||||||||||||||||||||||||||||||||||
| 3495 | m_path = state.matrix.map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 3496 | state = newState; | - | ||||||||||||||||||||||||||||||||||||
| 3497 | m_path = state.matrix.inverted().map(m_path); | - | ||||||||||||||||||||||||||||||||||||
| 3498 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3499 | void QQuickContext2D::pushState() | - | ||||||||||||||||||||||||||||||||||||
| 3500 | { | - | ||||||||||||||||||||||||||||||||||||
| 3501 | m_stateStack.push(state); | - | ||||||||||||||||||||||||||||||||||||
| 3502 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3503 | - | |||||||||||||||||||||||||||||||||||||
| 3504 | void QQuickContext2D::reset() | - | ||||||||||||||||||||||||||||||||||||
| 3505 | { | - | ||||||||||||||||||||||||||||||||||||
| 3506 | QQuickContext2D::State newState; | - | ||||||||||||||||||||||||||||||||||||
| 3507 | - | |||||||||||||||||||||||||||||||||||||
| 3508 | m_path = QPainterPath(); | - | ||||||||||||||||||||||||||||||||||||
| 3509 | - | |||||||||||||||||||||||||||||||||||||
| 3510 | newState.clipPath.setFillRule(Qt::WindingFill); | - | ||||||||||||||||||||||||||||||||||||
| 3511 | - | |||||||||||||||||||||||||||||||||||||
| 3512 | m_stateStack.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 3513 | m_stateStack.push(newState); | - | ||||||||||||||||||||||||||||||||||||
| 3514 | popState(); | - | ||||||||||||||||||||||||||||||||||||
| 3515 | m_buffer->clearRect(QRectF(0, 0, m_canvas->width(), m_canvas->height())); | - | ||||||||||||||||||||||||||||||||||||
| 3516 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3517 | - | |||||||||||||||||||||||||||||||||||||
| 3518 | void QQuickContext2D::setV4Engine(QV4::ExecutionEngine *engine) | - | ||||||||||||||||||||||||||||||||||||
| 3519 | { | - | ||||||||||||||||||||||||||||||||||||
| 3520 | if (m_v4engine != engine
| 0 | ||||||||||||||||||||||||||||||||||||
| 3521 | m_v4engine = engine; | - | ||||||||||||||||||||||||||||||||||||
| 3522 | - | |||||||||||||||||||||||||||||||||||||
| 3523 | if (m_v4engine == nullptr
| 0 | ||||||||||||||||||||||||||||||||||||
| 3524 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3525 | - | |||||||||||||||||||||||||||||||||||||
| 3526 | QQuickContext2DEngineData *ed = engineData(engine); | - | ||||||||||||||||||||||||||||||||||||
| 3527 | QV4::Scope scope(engine); | - | ||||||||||||||||||||||||||||||||||||
| 3528 | QV4::Scoped<QQuickJSContext2D> wrapper(scope, engine->memoryManager->allocate<QQuickJSContext2D>()); | - | ||||||||||||||||||||||||||||||||||||
| 3529 | QV4::ScopedObject p(scope, ed->contextPrototype.value()); | - | ||||||||||||||||||||||||||||||||||||
| 3530 | wrapper->setPrototypeOf(p); | - | ||||||||||||||||||||||||||||||||||||
| 3531 | wrapper->d()->context = this; | - | ||||||||||||||||||||||||||||||||||||
| 3532 | m_v4value = wrapper; | - | ||||||||||||||||||||||||||||||||||||
| 3533 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3534 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3535 | - | |||||||||||||||||||||||||||||||||||||
| 3536 | - | |||||||||||||||||||||||||||||||||||||
| 3537 | - | |||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |