diff options
Diffstat (limited to 'src/svg/qsvghandler.cpp')
-rw-r--r-- | src/svg/qsvghandler.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 523efa6..9fe892d 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -221,6 +221,7 @@ struct QSvgAttributes QStringView offset; QStringView stopColor; QStringView stopOpacity; + QStringView imageRendering; #ifndef QT_NO_CSSPARSER QList<QSvgCssAttribute> m_cssAttributes; @@ -274,6 +275,10 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa else if (name == QLatin1String("font-variant")) fontVariant = value; break; + case 'i': + if (name == QLatin1String("image-rendering")) + imageRendering = value; + break; case 'o': if (name == QLatin1String("opacity")) @@ -376,6 +381,8 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa case 'i': if (name == QLatin1String("id")) id = value.toString(); + else if (name == QLatin1String("image-rendering")) + imageRendering = value; break; case 'o': @@ -2251,6 +2258,25 @@ static void parseOthers(QSvgNode *node, } } +static void parseRenderingHints(QSvgNode *node, + const QSvgAttributes &attributes, + QSvgHandler *) +{ + if (attributes.imageRendering.isEmpty()) + return; + + QString ir = attributes.imageRendering.toString().trimmed(); + QSvgQualityStyle *p = new QSvgQualityStyle(0); + if (ir == QLatin1String("auto")) + p->setImageRendering(QSvgQualityStyle::ImageRenderingAuto); + else if (ir == QLatin1String("optimizeSpeed")) + p->setImageRendering(QSvgQualityStyle::ImageRenderingOptimizeSpeed); + else if (ir == QLatin1String("optimizeQuality")) + p->setImageRendering(QSvgQualityStyle::ImageRenderingOptimizeQuality); + node->appendStyleProperty(p, attributes.id); +} + + static bool parseStyle(QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *handler) @@ -2263,7 +2289,9 @@ static bool parseStyle(QSvgNode *node, parseVisibility(node, attributes, handler); parseOpacity(node, attributes, handler); parseCompOp(node, attributes, handler); + parseRenderingHints(node, attributes, handler); parseOthers(node, attributes, handler); + #if 0 value = attributes.value("audio-level"); |