summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-05-07 11:11:04 -0400
committerAndreas Kling <kling@serenityos.org>2023-05-08 12:52:05 +0200
commit135b029250eeee414a9d237f0d7d4170d0fc1397 (patch)
treeba9999035a0515dc83ec2ba8573b4182336badd4 /Userland
parent97d085abea7742ad3e395dce4f9486198a843ffd (diff)
downloadserenity-135b029250eeee414a9d237f0d7d4170d0fc1397.zip
LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_contents()
It was used only for context.error(), and the calling code needs to be changed to deal normal Errors anyways, since CanonicalCode can produce them.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp
index dc9a3b7db7..371317e03e 100644
--- a/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp
+++ b/Userland/Libraries/LibGfx/ImageFormats/WebPLoader.cpp
@@ -1230,7 +1230,7 @@ ErrorOr<NonnullRefPtr<Bitmap>> ColorIndexingTransform::transform(NonnullRefPtr<B
// https://developers.google.com/speed/webp/docs/riff_container#simple_file_format_lossless
// https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#7_overall_structure_of_the_format
-static ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L_contents(WebPLoadingContext& context, VP8LHeader const& vp8l_header, ReadonlyBytes lossless_data);
+static ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L_contents(VP8LHeader const& vp8l_header, ReadonlyBytes lossless_data);
static ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L(WebPLoadingContext& context, Chunk const& vp8l_chunk)
{
@@ -1239,11 +1239,11 @@ static ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L(WebPLoadingContext&
auto vp8l_header = TRY(decode_webp_chunk_VP8L_header(vp8l_chunk));
ReadonlyBytes lossless_data = vp8l_chunk.data.slice(5);
- return decode_webp_chunk_VP8L_contents(context, vp8l_header, lossless_data);
+ return decode_webp_chunk_VP8L_contents(vp8l_header, lossless_data);
}
// Decodes the lossless webp bitstream following the 5-byte header information.
-static ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L_contents(WebPLoadingContext& context, VP8LHeader const& vp8l_header, ReadonlyBytes lossless_data)
+static ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L_contents(VP8LHeader const& vp8l_header, ReadonlyBytes lossless_data)
{
FixedMemoryStream memory_stream { lossless_data };
LittleEndianInputBitStream bit_stream { MaybeOwned<Stream>(memory_stream) };
@@ -1283,7 +1283,7 @@ static ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L_contents(WebPLoadin
// Check that each transform is used only once.
u8 mask = 1 << (int)transform_type;
if (seen_transforms & mask)
- return context.error("WebPImageDecoderPlugin: transform type used multiple times");
+ return Error::from_string_literal("WebPImageDecoderPlugin: transform type used multiple times");
seen_transforms |= mask;
switch (transform_type) {
@@ -1349,7 +1349,7 @@ static ErrorOr<void> decode_webp_chunk_ALPH(WebPLoadingContext& context, Chunk c
// Once the image-stream is decoded into ARGB color values, following the process described in the lossless format specification,
// the transparency information must be extracted from the green channel of the ARGB quadruplet."
VP8LHeader vp8l_header = { static_cast<u16>(bitmap.width()), static_cast<u16>(bitmap.height()), /*is_alpha_used=*/false };
- auto lossless_bitmap = TRY(decode_webp_chunk_VP8L_contents(context, vp8l_header, alpha_data));
+ auto lossless_bitmap = TRY(decode_webp_chunk_VP8L_contents(vp8l_header, alpha_data));
if (pixel_count != static_cast<size_t>(lossless_bitmap->width() * lossless_bitmap->height()))
return context.error("WebPImageDecoderPlugin: decompressed ALPH dimensions don't match VP8 dimensions");