1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:37:44 +00:00

PixelPaint: BrushTool performance optimization

This patch optimizes how the Brush-Tool modifies the pixels. The new
logic generates a "reference brush" with the required size, falloff
and color only once and uses that for the rawing operations. If no
editing mask is used the reference brush is writen via a blit operation
to the content or mask image. This increases the drawing speed and
therefore also allows bigger brush sizes.
This commit is contained in:
Torstennator 2023-07-18 14:44:00 +02:00 committed by Sam Atkins
parent 31ee20e179
commit b9b4ca064f
3 changed files with 62 additions and 8 deletions

View file

@ -62,6 +62,10 @@ private:
bool m_has_clicked { false };
Gfx::IntPoint m_last_position;
NonnullRefPtr<Gfx::Bitmap const> m_cursor = build_cursor();
RefPtr<Gfx::Bitmap> m_brush_reference = nullptr;
Gfx::Color m_ensured_color {};
int m_ensured_hardness = 0;
ErrorOr<void> ensure_brush_reference_bitmap(Gfx::Color);
};
}