drop noop SVG quality implementation

altought it would be pretty easy to implement it seems to be in somewhat
unsupported state anyway, for reference:
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering
https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-11-18 14:10:13 +02:00
parent dcddc9b718
commit 041b961c0b
3 changed files with 2 additions and 71 deletions

View file

@ -42,10 +42,6 @@ void QSvgNode::appendStyleProperty(QSvgStyleProperty *prop, const QString &id)
{ {
//qDebug()<<"appending "<<prop->type()<< " ("<< id <<") "<<"to "<<this<<this->type(); //qDebug()<<"appending "<<prop->type()<< " ("<< id <<") "<<"to "<<this<<this->type();
switch (prop->type()) { switch (prop->type()) {
case QSvgStyleProperty::QUALITY: {
m_style.quality = static_cast<QSvgQualityStyle*>(prop);
break;
}
case QSvgStyleProperty::FILL: { case QSvgStyleProperty::FILL: {
m_style.fill = static_cast<QSvgFillStyle*>(prop); m_style.fill = static_cast<QSvgFillStyle*>(prop);
break; break;
@ -110,10 +106,6 @@ QSvgStyleProperty * QSvgNode::styleProperty(QSvgStyleProperty::Type type) const
const QSvgNode *node = this; const QSvgNode *node = this;
while (node) { while (node) {
switch (type) { switch (type) {
case QSvgStyleProperty::QUALITY:
if (node->m_style.quality)
return node->m_style.quality;
break;
case QSvgStyleProperty::FILL: case QSvgStyleProperty::FILL:
if (node->m_style.fill) if (node->m_style.fill)
return node->m_style.fill; return node->m_style.fill;

View file

@ -60,20 +60,6 @@ void QSvgFillStyleProperty::revert(QPainter *, QSvgExtraStates &)
Q_ASSERT(!"This should not be called!"); Q_ASSERT(!"This should not be called!");
} }
QSvgQualityStyle::QSvgQualityStyle(int color)
{
Q_UNUSED(color);
}
void QSvgQualityStyle::apply(QPainter *, const QSvgNode *, QSvgExtraStates &)
{
}
void QSvgQualityStyle::revert(QPainter *, QSvgExtraStates &)
{
}
QSvgFillStyle::QSvgFillStyle() QSvgFillStyle::QSvgFillStyle()
: m_style(0) : m_style(0)
, m_fillRule(Qt::WindingFill) , m_fillRule(Qt::WindingFill)
@ -425,11 +411,6 @@ void QSvgTransformStyle::revert(QPainter *p, QSvgExtraStates &)
p->setWorldTransform(m_oldWorldTransform, false /* don't combine */); p->setWorldTransform(m_oldWorldTransform, false /* don't combine */);
} }
QSvgStyleProperty::Type QSvgQualityStyle::type() const
{
return QUALITY;
}
QSvgStyleProperty::Type QSvgFillStyle::type() const QSvgStyleProperty::Type QSvgFillStyle::type() const
{ {
return FILL; return FILL;
@ -494,10 +475,6 @@ QSvgStyle::~QSvgStyle()
void QSvgStyle::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states) void QSvgStyle::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
{ {
if (quality) {
quality->apply(p, node, states);
}
if (fill) { if (fill) {
fill->apply(p, node, states); fill->apply(p, node, states);
} }
@ -529,10 +506,6 @@ void QSvgStyle::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states
void QSvgStyle::revert(QPainter *p, QSvgExtraStates &states) void QSvgStyle::revert(QPainter *p, QSvgExtraStates &states)
{ {
if (quality) {
quality->revert(p, states);
}
if (fill) { if (fill) {
fill->revert(p, states); fill->revert(p, states);
} }

View file

@ -134,7 +134,6 @@ class QSvgStyleProperty : public QSvgRefCounted
public: public:
enum Type enum Type
{ {
QUALITY,
FILL, FILL,
VIEWPORT_FILL, VIEWPORT_FILL,
FONT, FONT,
@ -160,38 +159,6 @@ public:
virtual void revert(QPainter *p, QSvgExtraStates &states); virtual void revert(QPainter *p, QSvgExtraStates &states);
}; };
class QSvgQualityStyle : public QSvgStyleProperty
{
public:
QSvgQualityStyle(int color);
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
private:
// color-render ing v v 'auto' | 'optimizeSpeed' |
// 'optimizeQuality' | 'inherit'
//int m_colorRendering;
// shape-rendering v v 'auto' | 'optimizeSpeed' | 'crispEdges' |
// 'geometricPrecision' | 'inherit'
//QSvgShapeRendering m_shapeRendering;
// text-rendering v v 'auto' | 'optimizeSpeed' | 'optimizeLegibility'
// | 'geometricPrecision' | 'inherit'
//QSvgTextRendering m_textRendering;
// vector-effect v x 'default' | 'non-scaling-stroke' | 'inherit'
//QSvgVectorEffect m_vectorEffect;
// image-rendering v v 'auto' | 'optimizeSpeed' | 'optimizeQuality' |
// 'inherit'
//QSvgImageRendering m_imageRendering;
};
class QSvgOpacityStyle : public QSvgStyleProperty class QSvgOpacityStyle : public QSvgStyleProperty
{ {
public: public:
@ -624,8 +591,7 @@ class QSvgStyle
{ {
public: public:
QSvgStyle() QSvgStyle()
: quality(0), : fill(0),
fill(0),
viewportFill(0), viewportFill(0),
font(0), font(0),
stroke(0), stroke(0),
@ -639,7 +605,7 @@ public:
void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states); void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
void revert(QPainter *p, QSvgExtraStates &states); void revert(QPainter *p, QSvgExtraStates &states);
QSvgRefCounter<QSvgQualityStyle> quality;
QSvgRefCounter<QSvgFillStyle> fill; QSvgRefCounter<QSvgFillStyle> fill;
QSvgRefCounter<QSvgViewportFillStyle> viewportFill; QSvgRefCounter<QSvgViewportFillStyle> viewportFill;
QSvgRefCounter<QSvgFontStyle> font; QSvgRefCounter<QSvgFontStyle> font;