PixelPaint: Calculate histogram and vectorscope data only when needed

With this patch the histogram and vectorscope data for the image is
only computed when the widgets are visible to the user and therefore
saves some processing time when this information is not required
to be computed.
This commit is contained in:
Torstennator 2023-08-16 14:30:00 +02:00 committed by Sam Atkins
commit 60b72b8033
Notes: sideshowbarker 2024-07-18 05:01:22 +09:00
7 changed files with 40 additions and 14 deletions

View file

@ -23,9 +23,13 @@ public:
void set_image(Image*);
virtual void image_changed() = 0;
void set_color_at_mouseposition(Color);
void set_scope_visibility(bool);
bool read_visibility_from_configuration();
protected:
virtual void paint_event(GUI::PaintEvent&) override = 0;
virtual AK::StringView widget_config_name() const = 0;
bool should_process_data();
Color m_color_at_mouseposition = Color::Transparent;
RefPtr<Image> m_image;