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:
parent
31ee20e179
commit
b9b4ca064f
3 changed files with 62 additions and 8 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue