1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

LibWeb: Move "visible in viewport" state tracking to ImageLoader

This should technically apply to any LayoutImage, so let's just move
it to ImageLoader.
This commit is contained in:
Andreas Kling 2020-06-14 19:32:23 +02:00
parent c45615128b
commit 73c9f7ebf4
7 changed files with 12 additions and 13 deletions

View file

@ -41,7 +41,7 @@ public:
const Gfx::Bitmap* bitmap() const;
const Gfx::ImageDecoder* image_decoder() const;
void set_visible_in_viewport(bool);
void set_visible_in_viewport(bool) const;
Function<void()> on_load;
Function<void()> on_fail;
@ -57,7 +57,7 @@ private:
void animate();
RefPtr<Gfx::ImageDecoder> m_decoder;
bool m_visible_in_viewport { false };
mutable bool m_visible_in_viewport { false };
size_t m_current_frame_index { 0 };
size_t m_loops_completed { 0 };