1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

LibGfx+LibWeb: Propagate OOM when creating PaintStyles

This commit is contained in:
MacDue 2023-03-01 23:01:59 +00:00 committed by Andreas Kling
parent f0a99634dd
commit 3a0a7e3e96
5 changed files with 21 additions and 21 deletions

View file

@ -21,9 +21,9 @@ public:
NoRepeat
};
static NonnullRefPtr<CanvasPatternPaintStyle> create(Gfx::Bitmap const& bitmap, Repetition repetition)
static ErrorOr<NonnullRefPtr<CanvasPatternPaintStyle>> create(Gfx::Bitmap const& bitmap, Repetition repetition)
{
return adopt_ref(*new CanvasPatternPaintStyle(bitmap, repetition));
return adopt_nonnull_ref_or_enomem(new (nothrow) CanvasPatternPaintStyle(bitmap, repetition));
}
virtual void paint(Gfx::IntRect physical_bounding_box, PaintFunction paint) const override;