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:
parent
f0a99634dd
commit
3a0a7e3e96
5 changed files with 21 additions and 21 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue