1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00

PixelPaint: Allow partial invalidation of Layer and Image

Let's give ourselves the tools needed to update less than the entire
image every time we paint.

This patch adds plumbing so that Layer invalidations have a modified
rect that gets passed on to Image, and then on to ImageEditor.
This commit is contained in:
Andreas Kling 2021-07-06 20:35:19 +02:00
parent b7e551b164
commit f7053059c9
6 changed files with 14 additions and 13 deletions

View file

@ -28,7 +28,7 @@ public:
virtual void image_did_remove_layer(size_t) { }
virtual void image_did_modify_layer(size_t) { }
virtual void image_did_modify_layer_stack() { }
virtual void image_did_change() { }
virtual void image_did_change(Gfx::IntRect const&) { }
virtual void image_select_layer(Layer*) { }
virtual void image_did_change_title(String const&) { }
@ -72,7 +72,7 @@ public:
void add_client(ImageClient&);
void remove_client(ImageClient&);
void layer_did_modify_bitmap(Badge<Layer>, Layer const&);
void layer_did_modify_bitmap(Badge<Layer>, Layer const&, Gfx::IntRect const& modified_layer_rect);
void layer_did_modify_properties(Badge<Layer>, Layer const&);
size_t index_of(Layer const&) const;
@ -88,7 +88,7 @@ private:
static Result<NonnullRefPtr<Image>, String> try_create_from_pixel_paint_file(String const& file_path);
void did_change();
void did_change(Gfx::IntRect const& modified_rect = {});
void did_modify_layer_stack();
String m_path;