mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 10:36:02 +00:00
PixelPaint: Add mask Bitmap to Layer and expose it
This commit is contained in:
parent
31a9196bfe
commit
82bfdec790
Notes:
sideshowbarker
2024-07-17 17:47:07 +09:00
Author: https://github.com/TobyAsE
Commit: 82bfdec790
Pull-request: https://github.com/SerenityOS/serenity/pull/12934
2 changed files with 15 additions and 1 deletions
|
@ -153,10 +153,16 @@ void Layer::update_cached_bitmap()
|
|||
if (!is_masked()) {
|
||||
if (m_content_bitmap.ptr() == m_cached_display_bitmap.ptr())
|
||||
return;
|
||||
|
||||
m_cached_display_bitmap = m_content_bitmap;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Layer::create_mask()
|
||||
{
|
||||
m_mask_bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, size()));
|
||||
m_mask_bitmap->fill(Gfx::Color::White);
|
||||
update_cached_bitmap();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue