mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Add ImageProvider virtual to access the DecodedImageData
...and also the current frame index, in case of animations.
This commit is contained in:
parent
5b88b76b84
commit
cebd4cc10d
Notes:
github-actions[bot]
2025-11-05 08:13:10 +00:00
Author: https://github.com/awesomekling
Commit: cebd4cc10d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6699
Reviewed-by: https://github.com/kalenikaliaksandr
8 changed files with 33 additions and 2 deletions
|
|
@ -282,4 +282,11 @@ void SVGImageElement::animate()
|
|||
paintable()->set_needs_display();
|
||||
}
|
||||
|
||||
GC::Ptr<HTML::DecodedImageData> SVGImageElement::decoded_image_data() const
|
||||
{
|
||||
if (!m_resource_request)
|
||||
return nullptr;
|
||||
return m_resource_request->image_data();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace Web::SVG {
|
||||
|
||||
class SVGImageElement
|
||||
class SVGImageElement final
|
||||
: public SVGGraphicsElement
|
||||
, public SVGURIReferenceMixin<SupportsXLinkHref::Yes>
|
||||
, public Layout::ImageProvider {
|
||||
|
|
@ -39,6 +39,8 @@ public:
|
|||
virtual RefPtr<Gfx::ImmutableBitmap> current_image_bitmap_sized(Gfx::IntSize) const override;
|
||||
virtual void set_visible_in_viewport(bool) override { }
|
||||
virtual GC::Ptr<DOM::Element const> to_html_element() const override { return *this; }
|
||||
virtual size_t current_frame_index() const override { return m_current_frame_index; }
|
||||
virtual GC::Ptr<HTML::DecodedImageData> decoded_image_data() const override;
|
||||
|
||||
protected:
|
||||
SVGImageElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue