Skip to content

Commit

Permalink
LibWeb: Mark bitmaps passed to Skia as immutable
Browse files Browse the repository at this point in the history
All bitmaps passed to Skia during rendering are not supposed to be
mutated.
  • Loading branch information
kalenikaliaksandr committed Jul 15, 2024
1 parent 31eec0a commit af9b91e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,12 @@ static SkBitmap to_skia_bitmap(Gfx::Bitmap const& bitmap)
SkBitmap sk_bitmap;
sk_bitmap.setInfo(image_info);

if (!sk_bitmap.installPixels(image_info, (void*)bitmap.begin(), bitmap.width() * 4)) {
if (!sk_bitmap.installPixels(image_info, const_cast<Gfx::ARGB32*>(bitmap.begin()), bitmap.width() * 4)) {
VERIFY_NOT_REACHED();
}

sk_bitmap.setImmutable();

return sk_bitmap;
}

Expand Down

0 comments on commit af9b91e

Please sign in to comment.