1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 17:27:34 +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

@ -43,6 +43,8 @@ public:
void set_transform(Gfx::AffineTransform const& transform) { state().transform = transform; }
void translate(Gfx::FloatPoint translation) { state().transform.translate(translation); }
Gfx::IntRect const& clip_rect() const { return state().clip_rect; }
void fill_rect(Gfx::FloatRect, Gfx::Color);
void fill_rect(Gfx::IntRect, Gfx::Color);
@ -88,6 +90,7 @@ private:
struct State {
Gfx::AffineTransform transform;
Gfx::IntRect clip_rect;
};
[[nodiscard]] State& state() { return m_state_stack.last(); }