mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:27:34 +00:00
LibWeb: Skip rendering box-shadow blur if we don't have memory for it
A slight loss in graphical fidelity is better than not rendering the page at all.
This commit is contained in:
parent
850795e088
commit
4fcb1be734
1 changed files with 5 additions and 0 deletions
|
@ -282,6 +282,11 @@ void Box::paint_box_shadow(PaintContext& context)
|
||||||
};
|
};
|
||||||
|
|
||||||
auto new_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, bitmap_rect.size());
|
auto new_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, bitmap_rect.size());
|
||||||
|
if (!new_bitmap) {
|
||||||
|
dbgln("Unable to allocate temporary bitmap for box-shadow rendering");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Gfx::Painter painter(*new_bitmap);
|
Gfx::Painter painter(*new_bitmap);
|
||||||
painter.fill_rect({ { 2 * blur_radius, 2 * blur_radius }, enclosed_int_rect.size() }, box_shadow_data->color);
|
painter.fill_rect({ { 2 * blur_radius, 2 * blur_radius }, enclosed_int_rect.size() }, box_shadow_data->color);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue