mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
LibGfx/WebP: Stop storing vp8_header and vp8l_header in context
They're not needed on the context.
This commit is contained in:
parent
135b029250
commit
5252f1cd60
1 changed files with 7 additions and 9 deletions
|
@ -143,11 +143,9 @@ struct WebPLoadingContext {
|
||||||
|
|
||||||
// Either 'VP8 ' (simple lossy file), 'VP8L' (simple lossless file), or 'VP8X' (extended file).
|
// Either 'VP8 ' (simple lossy file), 'VP8L' (simple lossless file), or 'VP8X' (extended file).
|
||||||
Optional<Chunk> first_chunk;
|
Optional<Chunk> first_chunk;
|
||||||
union {
|
|
||||||
VP8Header vp8_header;
|
// Only valid if first_chunk->type == 'VP8X'.
|
||||||
VP8LHeader vp8l_header;
|
VP8XHeader vp8x_header;
|
||||||
VP8XHeader vp8x_header;
|
|
||||||
};
|
|
||||||
|
|
||||||
// If first_chunk is not a VP8X chunk, then only image_data.image_data_chunk is set and all the other Chunks are not set.
|
// If first_chunk is not a VP8X chunk, then only image_data.image_data_chunk is set and all the other Chunks are not set.
|
||||||
ImageData image_data;
|
ImageData image_data;
|
||||||
|
@ -1567,14 +1565,14 @@ static ErrorOr<void> decode_webp_first_chunk(WebPLoadingContext& context)
|
||||||
TRY(read_webp_first_chunk(context));
|
TRY(read_webp_first_chunk(context));
|
||||||
|
|
||||||
if (context.first_chunk->type == FourCC("VP8 ")) {
|
if (context.first_chunk->type == FourCC("VP8 ")) {
|
||||||
context.vp8_header = TRY(decode_webp_chunk_VP8_header(context, context.first_chunk.value()));
|
auto vp8_header = TRY(decode_webp_chunk_VP8_header(context, context.first_chunk.value()));
|
||||||
context.size = IntSize { context.vp8_header.width, context.vp8_header.height };
|
context.size = IntSize { vp8_header.width, vp8_header.height };
|
||||||
context.state = WebPLoadingContext::State::FirstChunkDecoded;
|
context.state = WebPLoadingContext::State::FirstChunkDecoded;
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (context.first_chunk->type == FourCC("VP8L")) {
|
if (context.first_chunk->type == FourCC("VP8L")) {
|
||||||
context.vp8l_header = TRY(decode_webp_chunk_VP8L_header(context.first_chunk.value()));
|
auto vp8l_header = TRY(decode_webp_chunk_VP8L_header(context.first_chunk.value()));
|
||||||
context.size = IntSize { context.vp8l_header.width, context.vp8l_header.height };
|
context.size = IntSize { vp8l_header.width, vp8l_header.height };
|
||||||
context.state = WebPLoadingContext::State::FirstChunkDecoded;
|
context.state = WebPLoadingContext::State::FirstChunkDecoded;
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue