mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 11:09:18 +00:00
LibGfx: Let Painter care about TinyVG transforms
This helps us with non-uniform scales, and makes things simple
This commit is contained in:
parent
0b1c7d6af2
commit
ea469fbeab
Notes:
github-actions[bot]
2024-12-14 22:30:42 +00:00
Author: https://github.com/shlyakpavel
Commit: ea469fbeab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2717
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta
5 changed files with 19 additions and 31 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue