Decoration::paint takes the repaint region

This commit is contained in:
Martin Gräßlin 2014-11-11 09:39:45 +01:00
parent 931c43b6c4
commit cb9cbae36e
6 changed files with 7 additions and 7 deletions

View file

@ -391,8 +391,9 @@ void Decoration::updateBorders()
setBorders(b->left(), b->right(), b->top(), b->bottom());
}
void Decoration::paint(QPainter *painter)
void Decoration::paint(QPainter *painter, const QRegion &repaintRegion)
{
Q_UNUSED(repaintRegion)
if (!settings()->isAlphaChannelSupported()) {
return;
}

View file

@ -44,7 +44,7 @@ public:
explicit Decoration(QObject *parent = nullptr, const QVariantList &args = QVariantList());
virtual ~Decoration();
void paint(QPainter *painter) override;
void paint(QPainter *painter, const QRegion &repaintRegion) override;
Q_INVOKABLE QVariant readConfig(const QString &key, const QVariant &defaultValue = QVariant());

View file

@ -71,7 +71,7 @@ QImage Renderer::renderToImage(const QRect &geo)
p.setRenderHint(QPainter::Antialiasing);
p.setWindow(geo);
p.setClipRect(geo);
client()->decoration()->paint(&p);
client()->decoration()->paint(&p, geo);
return image;
}

View file

@ -128,11 +128,10 @@ void PreviewButtonItem::syncGeometry()
void PreviewButtonItem::paint(QPainter *painter)
{
Q_UNUSED(painter)
if (!m_button) {
return;
}
m_button->paint(painter);
m_button->paint(painter, QRegion(0, 0, width(), height()));
}
}

View file

@ -154,7 +154,7 @@ void PreviewItem::paint(QPainter *painter)
int paddingRight = 0;
int paddingBottom = 0;
paintShadow(painter, paddingLeft, paddingRight, paddingTop, paddingBottom);
m_decoration->paint(painter);
m_decoration->paint(painter, QRegion(0, 0, width(), height()));
if (m_drawBackground) {
painter->fillRect(m_decoration->borderLeft(), m_decoration->borderTop(),
width() - m_decoration->borderLeft() - m_decoration->borderRight() - paddingLeft - paddingRight,

View file

@ -646,7 +646,7 @@ void SceneQPainterDecorationRenderer::render()
painter.setCompositionMode(QPainter::CompositionMode_Source);
painter.fillRect(rect, Qt::red);
painter.restore();
client()->decoration()->paint(&painter);
client()->decoration()->paint(&painter, rect);
};
renderPart(left.intersected(geometry), left, int(DecorationPart::Left));