summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/GIFLoader.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-05-21 10:30:21 +0100
committerLinus Groh <mail@linusgroh.de>2021-05-21 10:30:52 +0100
commitd60ebbbba6429bf7f3ce58783acd8232d487d4b9 (patch)
treeea37facb5b78f0bd73402bcc2a869c2ee4b9528a /Userland/Libraries/LibGfx/GIFLoader.cpp
parent68f76b9e3750c8f4e5e3ee8c3d346772ce6d3593 (diff)
downloadserenity-d60ebbbba6429bf7f3ce58783acd8232d487d4b9.zip
Revert "Userland: static vs non-static constexpr variables"
This reverts commit 800ea8ea969835297dc7e7da345a45b9dc5e751a. Booting the system no longer worked after these changes.
Diffstat (limited to 'Userland/Libraries/LibGfx/GIFLoader.cpp')
-rw-r--r--Userland/Libraries/LibGfx/GIFLoader.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp
index 7c1d55ba37..d8b60c0dbb 100644
--- a/Userland/Libraries/LibGfx/GIFLoader.cpp
+++ b/Userland/Libraries/LibGfx/GIFLoader.cpp
@@ -19,6 +19,10 @@
namespace Gfx {
+// Row strides and offsets for each interlace pass.
+static const int INTERLACE_ROW_STRIDES[] = { 8, 8, 4, 2 };
+static const int INTERLACE_ROW_OFFSETS[] = { 0, 4, 2, 1 };
+
struct ImageDescriptor {
u16 x { 0 };
u16 y { 0 };
@@ -108,8 +112,8 @@ enum class GIFFormat {
static Optional<GIFFormat> decode_gif_header(InputMemoryStream& stream)
{
- constexpr char valid_header_87[] = "GIF87a";
- constexpr char valid_header_89[] = "GIF89a";
+ static const char valid_header_87[] = "GIF87a";
+ static const char valid_header_89[] = "GIF89a";
Array<u8, 6> header;
stream >> header;
@@ -374,8 +378,6 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
if (pixel_index % image.width == 0) {
if (image.interlaced) {
if (interlace_pass < 4) {
- constexpr Array INTERLACE_ROW_STRIDES = { 8, 8, 4, 2 };
- constexpr Array INTERLACE_ROW_OFFSETS = { 0, 4, 2, 1 };
if (row + INTERLACE_ROW_STRIDES[interlace_pass] >= image.height) {
++interlace_pass;
if (interlace_pass < 4)