mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-17 16:42:54 +00:00
LibGfx+LibWeb: Replace usages of Bitmap::fill() with Gfx::Painter
Let's always mutate a bitmap using painter, because Skia likely could do it faster than our own implementation.
This commit is contained in:
parent
f2d3f8bc42
commit
a499ece16c
Notes:
github-actions[bot]
2024-09-19 04:22:36 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: a499ece16c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1432
Reviewed-by: https://github.com/circl-lastname
2 changed files with 6 additions and 3 deletions
|
@ -385,8 +385,9 @@ void CanvasRenderingContext2D::reset_to_default_state()
|
|||
auto* bitmap = canvas_element().bitmap();
|
||||
|
||||
// 1. Clear canvas's bitmap to transparent black.
|
||||
if (bitmap)
|
||||
bitmap->fill(Gfx::Color::Transparent);
|
||||
if (bitmap) {
|
||||
painter()->clear_rect(bitmap->rect().to_type<float>(), Color::Transparent);
|
||||
}
|
||||
|
||||
// 2. Empty the list of subpaths in context's current default path.
|
||||
path().clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue