2025-11-23 09:07:35 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
|
|
|
|
|
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2026-05-05 08:52:33 -03:00
|
|
|
#include <LibGfx/DecodedImageFrame.h>
|
2025-11-23 09:07:35 -03:00
|
|
|
#include <LibGfx/PaintStyle.h>
|
|
|
|
|
|
|
|
|
|
namespace Gfx {
|
|
|
|
|
|
2026-05-07 09:39:50 -03:00
|
|
|
CanvasPatternPaintStyle::CanvasPatternPaintStyle(Optional<DecodedImageFrame> image, Repetition repetition)
|
2025-11-23 09:07:35 -03:00
|
|
|
: m_image(move(image))
|
|
|
|
|
, m_repetition(repetition)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-07 09:39:50 -03:00
|
|
|
ErrorOr<NonnullRefPtr<CanvasPatternPaintStyle>> CanvasPatternPaintStyle::create(Optional<DecodedImageFrame> image, Repetition repetition)
|
2025-11-23 09:07:35 -03:00
|
|
|
{
|
|
|
|
|
return adopt_nonnull_ref_or_enomem(new (nothrow) CanvasPatternPaintStyle(move(image), repetition));
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-07 09:39:50 -03:00
|
|
|
Optional<DecodedImageFrame> CanvasPatternPaintStyle::image() const
|
2025-11-23 09:07:35 -03:00
|
|
|
{
|
|
|
|
|
return m_image;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|