mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 14:42:51 +00:00
LibWeb: Make DecodedImageData an abstract class
The existing implementation moves down into a new subclass called AnimatedBitmapDecodedImageData. The purpose of this change is to create an extension point where we can plug in an SVG renderer. :^)
This commit is contained in:
parent
f7185dfa91
commit
4ee1e5b224
Notes:
sideshowbarker
2024-07-17 02:05:41 +09:00
Author: https://github.com/awesomekling
Commit: 4ee1e5b224
Pull-request: https://github.com/SerenityOS/serenity/pull/18943
Reviewed-by: https://github.com/winfr34k
6 changed files with 108 additions and 61 deletions
|
@ -14,8 +14,8 @@
|
|||
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
|
||||
#include <LibWeb/Fetch/Response.h>
|
||||
#include <LibWeb/HTML/AnimatedBitmapDecodedImageData.h>
|
||||
#include <LibWeb/HTML/CORSSettingAttribute.h>
|
||||
#include <LibWeb/HTML/DecodedImageData.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
#include <LibWeb/HTML/HTMLImageElement.h>
|
||||
#include <LibWeb/HTML/HTMLLinkElement.h>
|
||||
|
@ -530,15 +530,15 @@ void HTMLImageElement::handle_successful_fetch(AK::URL const& url_string, ImageR
|
|||
return;
|
||||
}
|
||||
|
||||
Vector<DecodedImageData::Frame> frames;
|
||||
Vector<AnimatedBitmapDecodedImageData::Frame> frames;
|
||||
for (auto& frame : result.value().frames) {
|
||||
frames.append(DecodedImageData::Frame {
|
||||
frames.append(AnimatedBitmapDecodedImageData::Frame {
|
||||
.bitmap = frame.bitmap,
|
||||
.duration = static_cast<int>(frame.duration),
|
||||
});
|
||||
}
|
||||
|
||||
auto image_data = DecodedImageData::create(move(frames), result.value().loop_count, result.value().is_animated).release_value_but_fixme_should_propagate_errors();
|
||||
auto image_data = AnimatedBitmapDecodedImageData::create(move(frames), result.value().loop_count, result.value().is_animated).release_value_but_fixme_should_propagate_errors();
|
||||
image_request.set_image_data(image_data);
|
||||
|
||||
ListOfAvailableImages::Key key;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue