LibGfx: Let Painter care about TinyVG transforms

This helps us with non-uniform scales, and makes things simple
This commit is contained in:
Pavel Shliak 2024-12-03 00:24:34 +04:00 committed by Jelle Raaijmakers
commit ea469fbeab
Notes: github-actions[bot] 2024-12-14 22:30:42 +00:00
5 changed files with 19 additions and 31 deletions

View file

@ -6,7 +6,6 @@
#include <AK/MemoryStream.h>
#include <AK/String.h>
#include <LibGfx/PainterSkia.h>
#include <LibGfx/Rect.h>
#include <UI/Qt/StringUtils.h>
#include <UI/Qt/TVGIconEngine.h>
@ -34,12 +33,7 @@ QPixmap TVGIconEngine::pixmap(QSize const& size, QIcon::Mode mode, QIcon::State
auto key = pixmap_cache_key(size, mode, state);
if (QPixmapCache::find(key, &pixmap))
return pixmap;
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { size.width(), size.height() }));
auto painter = Gfx::PainterSkia::create(bitmap);
painter->clear_rect(bitmap->rect().to_type<float>(), Gfx::Color::Transparent);
m_image_data->draw_into(*painter, bitmap->rect());
auto bitmap = MUST(m_image_data->bitmap({ size.width(), size.height() }));
for (auto const& filter : m_filters) {
if (filter->mode() == mode) {