1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:57:42 +00:00

LibAccelGfx+LibWeb: Discard painting of commands outside of viewport

This commit is contained in:
Aliaksandr Kalenik 2023-11-26 16:29:40 +01:00 committed by Andreas Kling
parent c68a9b2cfe
commit 17fb82d49b
3 changed files with 9 additions and 3 deletions

View file

@ -306,10 +306,10 @@ CommandResult PaintingCommandExecutorGPU::paint_borders(DevicePixelRect const& b
return CommandResult::Continue;
}
bool PaintingCommandExecutorGPU::would_be_fully_clipped_by_painter(Gfx::IntRect) const
bool PaintingCommandExecutorGPU::would_be_fully_clipped_by_painter(Gfx::IntRect rect) const
{
// FIXME
return false;
auto translation = painter().transform().translation().to_type<int>();
return !painter().clip_rect().intersects(rect.translated(translation));
}
void PaintingCommandExecutorGPU::prepare_glyph_texture(HashMap<Gfx::Font const*, HashTable<u32>> const& unique_glyphs)