mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
LibAccelGfx+LibWeb: Add texture cache for immutable bitmaps
This change introduces a texture cache for immutable bitmaps in the GPU painter. The cache is persisted across page repaints, so now, on page scroll repaint, in many cases, we won't need to upload any new textures. Also, if the same image is painted more than once on a page, its texture will only be uploaded once. Generally, the GPU painter works much faster with this change on all pages that have images.
This commit is contained in:
parent
f4a5c136c3
commit
a1c8fb10fa
7 changed files with 65 additions and 1 deletions
|
@ -67,7 +67,7 @@ CommandResult PaintingCommandExecutorGPU::draw_scaled_bitmap(Gfx::IntRect const&
|
|||
|
||||
CommandResult PaintingCommandExecutorGPU::draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_rect, Gfx::ImmutableBitmap const& immutable_bitmap, Gfx::IntRect const& src_rect, Gfx::Painter::ScalingMode scaling_mode)
|
||||
{
|
||||
painter().draw_scaled_bitmap(dst_rect, immutable_bitmap.bitmap(), src_rect, to_accelgfx_scaling_mode(scaling_mode));
|
||||
painter().draw_scaled_immutable_bitmap(dst_rect, immutable_bitmap, src_rect, to_accelgfx_scaling_mode(scaling_mode));
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
|
@ -316,4 +316,9 @@ void PaintingCommandExecutorGPU::prepare_glyph_texture(HashMap<Gfx::Font const*,
|
|||
painter().prepare_glyph_texture(unique_glyphs);
|
||||
}
|
||||
|
||||
void PaintingCommandExecutorGPU::update_immutable_bitmap_texture_cache(HashMap<u32, Gfx::ImmutableBitmap const*>& immutable_bitmaps)
|
||||
{
|
||||
painter().update_immutable_bitmap_texture_cache(immutable_bitmaps);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue