mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibGfx+LibWeb: Cache SkImage in ImmutableBitmap
By caching the SkImage that is reused across repaints, we allow Skia t optimize GPU texture caching. ImmutableBitmap is chosen to own the SkImage because it guarantees that the underlying pixels cannot be modified. This is not the case for Gfx::Bitmap, where invalidating the SkImage would be challenging since it exposes pointers to underlying data through methods like scanline().
This commit is contained in:
parent
460803d2da
commit
698bca686e
Notes:
github-actions[bot]
2024-11-09 20:21:03 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 698bca686e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2254
20 changed files with 186 additions and 118 deletions
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2023, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
|
@ -120,13 +121,6 @@ RefPtr<Gfx::ImmutableBitmap> HTMLImageElement::immutable_bitmap() const
|
|||
return current_image_bitmap();
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap const> HTMLImageElement::bitmap() const
|
||||
{
|
||||
if (auto immutable_bitmap = this->immutable_bitmap())
|
||||
return immutable_bitmap->bitmap();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool HTMLImageElement::is_image_available() const
|
||||
{
|
||||
return m_current_request && m_current_request->is_available();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue