LibWeb: Mark bitmaps passed to Skia as immutable

All bitmaps passed to Skia during rendering are not supposed to be
mutated.
This commit is contained in:
Aliaksandr Kalenik 2024-07-15 11:32:24 +03:00 committed by Alexander Kalenik
parent 31eec0a145
commit af9b91e0f7
Notes: sideshowbarker 2024-07-16 23:05:02 +09:00

View file

@ -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;
}