mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibGfx/PNG: Use PNG specific vocabulary over a generic name
This commit is contained in:
parent
f0ec104131
commit
07d3232f2d
1 changed files with 8 additions and 8 deletions
|
@ -157,7 +157,7 @@ struct PNGLoadingContext {
|
||||||
NotDecoded = 0,
|
NotDecoded = 0,
|
||||||
Error,
|
Error,
|
||||||
HeaderDecoded,
|
HeaderDecoded,
|
||||||
SizeDecoded,
|
IHDRDecoded,
|
||||||
ImageDataChunkDecoded,
|
ImageDataChunkDecoded,
|
||||||
ChunksDecoded,
|
ChunksDecoded,
|
||||||
BitmapDecoded,
|
BitmapDecoded,
|
||||||
|
@ -609,9 +609,9 @@ static bool decode_png_header(PNGLoadingContext& context)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool decode_png_size(PNGLoadingContext& context)
|
static bool decode_png_ihdr(PNGLoadingContext& context)
|
||||||
{
|
{
|
||||||
if (context.state >= PNGLoadingContext::SizeDecoded)
|
if (context.state >= PNGLoadingContext::IHDRDecoded)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (context.state < PNGLoadingContext::HeaderDecoded) {
|
if (context.state < PNGLoadingContext::HeaderDecoded) {
|
||||||
|
@ -631,7 +631,7 @@ static bool decode_png_size(PNGLoadingContext& context)
|
||||||
context.data_current_ptr = streamer.current_data_ptr();
|
context.data_current_ptr = streamer.current_data_ptr();
|
||||||
|
|
||||||
if (context.width && context.height) {
|
if (context.width && context.height) {
|
||||||
context.state = PNGLoadingContext::State::SizeDecoded;
|
context.state = PNGLoadingContext::State::IHDRDecoded;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -644,8 +644,8 @@ static bool decode_png_image_data_chunk(PNGLoadingContext& context)
|
||||||
if (context.state >= PNGLoadingContext::ImageDataChunkDecoded)
|
if (context.state >= PNGLoadingContext::ImageDataChunkDecoded)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (context.state < PNGLoadingContext::SizeDecoded) {
|
if (context.state < PNGLoadingContext::IHDRDecoded) {
|
||||||
if (!decode_png_size(context))
|
if (!decode_png_ihdr(context))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1303,8 +1303,8 @@ IntSize PNGImageDecoderPlugin::size()
|
||||||
if (m_context->state == PNGLoadingContext::State::Error)
|
if (m_context->state == PNGLoadingContext::State::Error)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
if (m_context->state < PNGLoadingContext::State::SizeDecoded) {
|
if (m_context->state < PNGLoadingContext::State::IHDRDecoded) {
|
||||||
bool success = decode_png_size(*m_context);
|
bool success = decode_png_ihdr(*m_context);
|
||||||
if (!success)
|
if (!success)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue