mirror of https://code.videolan.org/videolan/vlc
qt: avoid explicit QPainter calls in RoundImage
This commit is contained in:
parent
9cbeacfcf7
commit
38c2a7ecbf
|
@ -351,17 +351,17 @@ QImage RoundImage::RoundImageGenerator::execute()
|
|||
|
||||
target.fill(Qt::transparent);
|
||||
|
||||
QPainter painter;
|
||||
painter.begin(&target);
|
||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||
{
|
||||
QPainter painter(&target);
|
||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||
|
||||
QPainterPath path;
|
||||
path.addRoundedRect(0, 0, width, height, radius, radius);
|
||||
painter.setClipPath(path);
|
||||
QPainterPath path;
|
||||
path.addRoundedRect(0, 0, width, height, radius, radius);
|
||||
painter.setClipPath(path);
|
||||
|
||||
painter.drawImage({alignedCenteredTopLeft, targetSize}, sourceReader.read());
|
||||
painter.end();
|
||||
painter.drawImage({alignedCenteredTopLeft, targetSize}, sourceReader.read());
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue