1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00

qt: avoid explicit QPainter calls in RoundImage

This commit is contained in:
Fatih Uzunoglu 2022-03-02 19:47:04 +02:00 committed by Hugo Beauzée-Luyssen
parent 9cbeacfcf7
commit 38c2a7ecbf

View File

@ -351,17 +351,17 @@ QImage RoundImage::RoundImageGenerator::execute()
target.fill(Qt::transparent); target.fill(Qt::transparent);
QPainter painter; {
painter.begin(&target); QPainter painter(&target);
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::SmoothPixmapTransform, true); painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
QPainterPath path; QPainterPath path;
path.addRoundedRect(0, 0, width, height, radius, radius); path.addRoundedRect(0, 0, width, height, radius, radius);
painter.setClipPath(path); painter.setClipPath(path);
painter.drawImage({alignedCenteredTopLeft, targetSize}, sourceReader.read()); painter.drawImage({alignedCenteredTopLeft, targetSize}, sourceReader.read());
painter.end(); }
return target; return target;
} }