From 7fd96dcc840957755f2ed4173d66927910359ec7 Mon Sep 17 00:00:00 2001 From: Dimitri Tugo Date: Tue, 14 Oct 2025 16:09:31 +0200 Subject: [PATCH 01/12] Integrate libwebp 1.6.0 for WebP image support on sys targets. --- .gitmodules | 4 + NOTICE.md | 4 + project/Build.xml | 10 + project/include/graphics/format/WEBP.h | 19 ++ project/lib/webp | 1 + project/lib/webp-files.xml | 302 +++++++++++++++++++++++++ project/src/ExternalInterface.cpp | 130 +++++++++++ project/src/graphics/format/WEBP.cpp | 153 +++++++++++++ 8 files changed, 623 insertions(+) create mode 100644 project/include/graphics/format/WEBP.h create mode 160000 project/lib/webp create mode 100644 project/lib/webp-files.xml create mode 100644 project/src/graphics/format/WEBP.cpp diff --git a/.gitmodules b/.gitmodules index 0df9bf9e87..cc08d180fb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -82,3 +82,7 @@ path = project/lib/hashlink url = https://github.com/HaxeFoundation/hashlink shallow = true +[submodule "project/lib/webp"] + path = project/lib/webp + url = https://chromium.googlesource.com/webm/libwebp + shallow = true \ No newline at end of file diff --git a/NOTICE.md b/NOTICE.md index a806789ebd..976e1cac46 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -58,6 +58,10 @@ This product bundles libvorbis 1.3.3, which is available under a This product bundles zlib 1.2.8, which is available under a "zlib" (BSD-style) license. For details, see [project/lib/zlib/](project/lib). +This product bundles libwebp 1.6.0, which is available under a +BSD-3-Clause license. For details, see [project/lib/webp/](project/lib). + + ------- Modifications and source-repository versions of Haxe core files are included in the diff --git a/project/Build.xml b/project/Build.xml index d6f0d7c857..6a5854ba30 100755 --- a/project/Build.xml +++ b/project/Build.xml @@ -26,6 +26,7 @@ + @@ -214,6 +215,13 @@ +
+ + + + +
+
@@ -364,6 +372,7 @@ + @@ -397,6 +406,7 @@ + diff --git a/project/include/graphics/format/WEBP.h b/project/include/graphics/format/WEBP.h new file mode 100644 index 0000000000..65c74cd4fb --- /dev/null +++ b/project/include/graphics/format/WEBP.h @@ -0,0 +1,19 @@ +#ifndef LIME_GRAPHICS_FORMAT_WEBP_H +#define LIME_GRAPHICS_FORMAT_WEBP_H + +#include +#include +#include + +namespace lime { + + class WEBP { + + public: + static bool Decode (Resource *resource, ImageBuffer *imageBuffer, bool decodeData = true); + static bool Encode (ImageBuffer *imageBuffer, Bytes *bytes, int quality); + }; + +} + +#endif diff --git a/project/lib/webp b/project/lib/webp new file mode 160000 index 0000000000..4fa2191233 --- /dev/null +++ b/project/lib/webp @@ -0,0 +1 @@ +Subproject commit 4fa21912338357f89e4fd51cf2368325b59e9bd9 diff --git a/project/lib/webp-files.xml b/project/lib/webp-files.xml new file mode 100644 index 0000000000..6a6de57af7 --- /dev/null +++ b/project/lib/webp-files.xml @@ -0,0 +1,302 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + +
+
+
diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp index 39ccdcf3d5..f4969600da 100644 --- a/project/src/ExternalInterface.cpp +++ b/project/src/ExternalInterface.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1882,6 +1883,17 @@ namespace lime { #endif break; + case 2: + + #ifdef LIME_WEBP + if (WEBP::Encode (&imageBuffer, &data, quality)) { + + return data.Value (bytes); + + } + #endif + break; + default: break; } @@ -1917,6 +1929,17 @@ namespace lime { #endif break; + case 2: + + #ifdef LIME_WEBP + if (WEBP::Encode (buffer, bytes, quality)) { + + return bytes; + + } + #endif + break; + default: break; } @@ -1936,6 +1959,14 @@ namespace lime { bytes.Set (data); resource = Resource (&bytes); + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, &imageBuffer)) { + + return imageBuffer.Value (buffer); + + } + #endif + #ifdef LIME_PNG if (PNG::Decode (&resource, &imageBuffer)) { @@ -1961,6 +1992,14 @@ namespace lime { Resource resource = Resource (data); + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, buffer)) { + + return buffer; + + } + #endif + #ifdef LIME_PNG if (PNG::Decode (&resource, buffer)) { @@ -1987,6 +2026,14 @@ namespace lime { Resource resource = Resource (val_string (data)); ImageBuffer imageBuffer = ImageBuffer (buffer); + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, &imageBuffer)) { + + return imageBuffer.Value (buffer); + + } + #endif + #ifdef LIME_PNG if (PNG::Decode (&resource, &imageBuffer)) { @@ -2012,6 +2059,14 @@ namespace lime { Resource resource = Resource (data); + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, buffer)) { + + return buffer; + + } + #endif + #ifdef LIME_PNG if (PNG::Decode (&resource, buffer)) { @@ -2033,6 +2088,77 @@ namespace lime { } + value lime_webp_decode_bytes (value data, bool decodeData, value buffer) { + + ImageBuffer imageBuffer (buffer); + + Bytes bytes (data); + Resource resource = Resource (&bytes); + + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, &imageBuffer, decodeData)) { + + return imageBuffer.Value (buffer); + + } + #endif + + return alloc_null (); + + } + + + HL_PRIM ImageBuffer* HL_NAME(hl_webp_decode_bytes) (Bytes* data, bool decodeData, ImageBuffer* buffer) { + + Resource resource = Resource (data); + + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, buffer, decodeData)) { + + return buffer; + + } + #endif + + return 0; + + } + + + value lime_webp_decode_file (HxString path, bool decodeData, value buffer) { + + ImageBuffer imageBuffer (buffer); + Resource resource = Resource (hxs_utf8 (path, nullptr)); + + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, &imageBuffer, decodeData)) { + + return imageBuffer.Value (buffer); + + } + #endif + + return alloc_null (); + + } + + + HL_PRIM ImageBuffer* HL_NAME(hl_webp_decode_file) (hl_vstring* path, bool decodeData, ImageBuffer* buffer) { + + Resource resource = Resource (path); + + #ifdef LIME_WEBP + if (WEBP::Decode (&resource, buffer, decodeData)) { + + return buffer; + + } + #endif + + return 0; + + } + value lime_image_load (value data, value buffer) { if (val_is_string (data)) { @@ -4117,6 +4243,8 @@ namespace lime { DEFINE_PRIME2v (lime_orientation_event_manager_register); DEFINE_PRIME3 (lime_png_decode_bytes); DEFINE_PRIME3 (lime_png_decode_file); + DEFINE_PRIME3 (lime_webp_decode_bytes); + DEFINE_PRIME3 (lime_webp_decode_file); DEFINE_PRIME2v (lime_render_event_manager_register); DEFINE_PRIME2v (lime_sensor_event_manager_register); DEFINE_PRIME0 (lime_system_get_allow_screen_timeout); @@ -4311,6 +4439,8 @@ namespace lime { DEFINE_HL_PRIM (_VOID, hl_orientation_event_manager_register, _FUN (_VOID, _NO_ARG) _TORIENTATION_EVENT); DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_png_decode_bytes, _TBYTES _BOOL _TIMAGEBUFFER); DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_png_decode_file, _STRING _BOOL _TIMAGEBUFFER); + DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_webp_decode_bytes, _TBYTES _BOOL _TIMAGEBUFFER); + DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_webp_decode_file, _STRING _BOOL _TIMAGEBUFFER); DEFINE_HL_PRIM (_VOID, hl_render_event_manager_register, _FUN (_VOID, _NO_ARG) _TRENDER_EVENT); DEFINE_HL_PRIM (_VOID, hl_sensor_event_manager_register, _FUN (_VOID, _NO_ARG) _TSENSOR_EVENT); DEFINE_HL_PRIM (_BOOL, hl_system_get_allow_screen_timeout, _NO_ARG); diff --git a/project/src/graphics/format/WEBP.cpp b/project/src/graphics/format/WEBP.cpp new file mode 100644 index 0000000000..47173aca94 --- /dev/null +++ b/project/src/graphics/format/WEBP.cpp @@ -0,0 +1,153 @@ +#ifdef LIME_WEBP + +extern "C" { + #include + #include +} + +#include +#include +#include +#include +#include +#include +#include + +namespace lime { + + static inline int clampi (int v, int lo, int hi) { + return v < lo ? lo : (v > hi ? hi : v); + } + + static bool LoadResourceToMemory (Resource* resource, Bytes*& owned, const uint8_t*& src, size_t& len) { + + owned = nullptr; + src = nullptr; + len = 0; + + if (!resource) return false; + + if (resource->path) { + + FILE_HANDLE* file = lime::fopen (resource->path, "rb"); + if (!file) return false; + + unsigned char sig[12] = {0}; + int readOK = lime::fread (&sig[0], 12, 1, file); + lime::fclose (file); + + if (readOK != 1) return false; + + const bool isRIFF = (sig[0]=='R' && sig[1]=='I' && sig[2]=='F' && sig[3]=='F'); + const bool isWEBP = (sig[8]=='W' && sig[9]=='E' && sig[10]=='B' && sig[11]=='P'); + if (!isRIFF || !isWEBP) return false; + + Bytes* b = new Bytes (); + b->ReadFile (resource->path); + if (b->length <= 0) { delete b; return false; } + + owned = b; + src = reinterpret_cast(b->b); + len = static_cast(b->length); + return true; + + } else if (resource->data) { + + src = reinterpret_cast(resource->data->b); + len = static_cast(resource->data->length); + if (len == 0) return false; + + return true; + + } + + return false; + } + + + bool WEBP::Decode (Resource* resource, ImageBuffer* imageBuffer, bool decodeData) { + + if (!resource || !imageBuffer) return false; + + Bytes* owned = nullptr; + const uint8_t* src = nullptr; + size_t len = 0; + + if (!LoadResourceToMemory (resource, owned, src, len)) { + return false; + } + + int w = 0, h = 0; + if (!WebPGetInfo (src, len, &w, &h) || w <= 0 || h <= 0) { + if (owned) delete owned; + return false; + } + + if (!decodeData) { + imageBuffer->width = w; + imageBuffer->height = h; + if (owned) delete owned; + return true; + } + + imageBuffer->Resize (w, h, 32); + unsigned char* dst = imageBuffer->data && imageBuffer->data->buffer + ? imageBuffer->data->buffer->b : nullptr; + if (!dst) { + if (owned) delete owned; + return false; + } + + const int stride = imageBuffer->Stride (); + const size_t dstSize = static_cast(h) * static_cast(stride); + + uint8_t* ok = WebPDecodeRGBAInto (src, len, dst, dstSize, stride); + if (!ok) { + if (owned) delete owned; + return false; + } + + if (owned) delete owned; + return true; + } + + + + bool WEBP::Encode (ImageBuffer* imageBuffer, Bytes* bytes, int quality) { + + if (!imageBuffer || !bytes) return false; + + const int w = imageBuffer->width; + const int h = imageBuffer->height; + if (w <= 0 || h <= 0) return false; + + const int stride = imageBuffer->Stride (); + const uint8_t* src = imageBuffer->data && imageBuffer->data->buffer + ? reinterpret_cast(imageBuffer->data->buffer->b) : nullptr; + if (!src) return false; + + + uint8_t* out = nullptr; + const float q = static_cast(clampi (quality, 0, 100)); + size_t out_size = WebPEncodeRGBA (src, w, h, stride, q, &out); + + if (!out || out_size == 0) { + if (out) WebPFree (out); + return false; + } + + if (out_size > static_cast((std::numeric_limits::max)())) { + WebPFree (out); + return false; + } + + bytes->Resize (static_cast(out_size)); + std::memcpy (bytes->b, out, out_size); + WebPFree (out); + + return true; + } + +} // namespace lime + +#endif // LIME_WEBP From 5c6c000e1a831f7d53e8acdb29dbbe18849614e5 Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 01:07:45 -0400 Subject: [PATCH 02/12] Use GitHub mirror of libwebp. --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index cc08d180fb..969a47316e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -84,5 +84,5 @@ shallow = true [submodule "project/lib/webp"] path = project/lib/webp - url = https://chromium.googlesource.com/webm/libwebp - shallow = true \ No newline at end of file + url = https://github.com/webmproject/libwebp + shallow = true From 92363f86d3b5721971bb38b00f86678d34f55e0e Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 01:09:45 -0400 Subject: [PATCH 03/12] Add libwebp links. --- project/lib/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/project/lib/README.md b/project/lib/README.md index 022e17030e..5dad9b64cc 100644 --- a/project/lib/README.md +++ b/project/lib/README.md @@ -18,6 +18,7 @@ Lime includes code from several other C/C++ libraries, listed below. Lime prefer - [**OpenAL Soft**](https://openal-soft.org/) | [primary repo](https://github.com/kcat/openal-soft) - [**Pixman**](http://pixman.org/) | [primary repo](https://gitlab.freedesktop.org/pixman/pixman) | [GitHub mirror](https://github.com/freedesktop/pixman) - [**libpng**](http://www.libpng.org/pub/png/libpng.html) | [primary repo](https://sourceforge.net/p/libpng/code) | [GitHub mirror](https://github.com/glennrp/libpng)[^1] +- [**libwebp**](https://developers.google.com/speed/webp) | [primary repo](https://chromium.googlesource.com/webm/libwebp) | [GitHub mirror](https://github.com/webmproject/libwebp)[^1] - [**SDL**](https://www.libsdl.org/) | [primary repo](https://github.com/libsdl-org/SDL) - [**tiny file dialogs**](https://sourceforge.net/projects/tinyfiledialogs/) | [primary repo](https://sourceforge.net/p/tinyfiledialogs/code) | [unofficial GitHub mirror](https://github.com/openfl/libtinyfiledialogs)[^1] - [**Vorbis**](https://www.xiph.org/vorbis/) | [primary repo](https://github.com/xiph/vorbis) From 30140320c28d503c8ba8e3494899c123d228d93a Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 01:11:07 -0400 Subject: [PATCH 04/12] Remove incorrect footnote. I forgot that the footnote is only for SourceForge links. --- project/lib/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/README.md b/project/lib/README.md index 5dad9b64cc..2accca8be9 100644 --- a/project/lib/README.md +++ b/project/lib/README.md @@ -18,7 +18,7 @@ Lime includes code from several other C/C++ libraries, listed below. Lime prefer - [**OpenAL Soft**](https://openal-soft.org/) | [primary repo](https://github.com/kcat/openal-soft) - [**Pixman**](http://pixman.org/) | [primary repo](https://gitlab.freedesktop.org/pixman/pixman) | [GitHub mirror](https://github.com/freedesktop/pixman) - [**libpng**](http://www.libpng.org/pub/png/libpng.html) | [primary repo](https://sourceforge.net/p/libpng/code) | [GitHub mirror](https://github.com/glennrp/libpng)[^1] -- [**libwebp**](https://developers.google.com/speed/webp) | [primary repo](https://chromium.googlesource.com/webm/libwebp) | [GitHub mirror](https://github.com/webmproject/libwebp)[^1] +- [**libwebp**](https://developers.google.com/speed/webp) | [primary repo](https://chromium.googlesource.com/webm/libwebp) | [GitHub mirror](https://github.com/webmproject/libwebp) - [**SDL**](https://www.libsdl.org/) | [primary repo](https://github.com/libsdl-org/SDL) - [**tiny file dialogs**](https://sourceforge.net/projects/tinyfiledialogs/) | [primary repo](https://sourceforge.net/p/tinyfiledialogs/code) | [unofficial GitHub mirror](https://github.com/openfl/libtinyfiledialogs)[^1] - [**Vorbis**](https://www.xiph.org/vorbis/) | [primary repo](https://github.com/xiph/vorbis) From 899591fb94c96e98383a757e0962c51e14f3fd80 Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 01:13:06 -0400 Subject: [PATCH 05/12] Keep dependencies in alphabetical order. --- NOTICE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NOTICE.md b/NOTICE.md index 976e1cac46..ee2998e83d 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -46,6 +46,9 @@ This product bundles pixman 0.32.8, which is available under an This product bundles libpng 1.6.12, which is available under a "zlib" (BSD-style) license. For details, see [project/lib/png/](project/lib). +This product bundles libwebp 1.6.0, which is available under a +BSD-3-Clause license. For details, see [project/lib/webp/](project/lib). + This product bundles SDL 2.0.12, which is available under a "zlib" (BSD-style) license. For details, see [project/lib/sdl/](project/lib). @@ -58,9 +61,6 @@ This product bundles libvorbis 1.3.3, which is available under a This product bundles zlib 1.2.8, which is available under a "zlib" (BSD-style) license. For details, see [project/lib/zlib/](project/lib). -This product bundles libwebp 1.6.0, which is available under a -BSD-3-Clause license. For details, see [project/lib/webp/](project/lib). - ------- From 0cb5f69de2a3c9e206e0c0199787e58445cfaa54 Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 15:18:19 -0400 Subject: [PATCH 06/12] Spell out variable names. --- project/src/graphics/format/WEBP.cpp | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/project/src/graphics/format/WEBP.cpp b/project/src/graphics/format/WEBP.cpp index 47173aca94..70fbfc1457 100644 --- a/project/src/graphics/format/WEBP.cpp +++ b/project/src/graphics/format/WEBP.cpp @@ -15,8 +15,8 @@ extern "C" { namespace lime { - static inline int clampi (int v, int lo, int hi) { - return v < lo ? lo : (v > hi ? hi : v); + static inline int clampi (int value, int min, int max) { + return value < min ? min : (value > max ? max : value); } static bool LoadResourceToMemory (Resource* resource, Bytes*& owned, const uint8_t*& src, size_t& len) { @@ -42,13 +42,13 @@ namespace lime { const bool isWEBP = (sig[8]=='W' && sig[9]=='E' && sig[10]=='B' && sig[11]=='P'); if (!isRIFF || !isWEBP) return false; - Bytes* b = new Bytes (); - b->ReadFile (resource->path); - if (b->length <= 0) { delete b; return false; } + Bytes* bytes = new Bytes (); + bytes->ReadFile (resource->path); + if (bytes->length <= 0) { delete bytes; return false; } - owned = b; - src = reinterpret_cast(b->b); - len = static_cast(b->length); + owned = bytes; + src = reinterpret_cast(bytes->b); + len = static_cast(bytes->length); return true; } else if (resource->data) { @@ -77,20 +77,20 @@ namespace lime { return false; } - int w = 0, h = 0; - if (!WebPGetInfo (src, len, &w, &h) || w <= 0 || h <= 0) { + int width = 0, height = 0; + if (!WebPGetInfo (src, len, &width, &height) || width <= 0 || height <= 0) { if (owned) delete owned; return false; } if (!decodeData) { - imageBuffer->width = w; - imageBuffer->height = h; + imageBuffer->width = width; + imageBuffer->height = height; if (owned) delete owned; return true; } - imageBuffer->Resize (w, h, 32); + imageBuffer->Resize (width, height, 32); unsigned char* dst = imageBuffer->data && imageBuffer->data->buffer ? imageBuffer->data->buffer->b : nullptr; if (!dst) { @@ -99,7 +99,7 @@ namespace lime { } const int stride = imageBuffer->Stride (); - const size_t dstSize = static_cast(h) * static_cast(stride); + const size_t dstSize = static_cast(height) * static_cast(stride); uint8_t* ok = WebPDecodeRGBAInto (src, len, dst, dstSize, stride); if (!ok) { @@ -117,9 +117,9 @@ namespace lime { if (!imageBuffer || !bytes) return false; - const int w = imageBuffer->width; - const int h = imageBuffer->height; - if (w <= 0 || h <= 0) return false; + const int width = imageBuffer->width; + const int height = imageBuffer->height; + if (width <= 0 || height <= 0) return false; const int stride = imageBuffer->Stride (); const uint8_t* src = imageBuffer->data && imageBuffer->data->buffer @@ -128,8 +128,8 @@ namespace lime { uint8_t* out = nullptr; - const float q = static_cast(clampi (quality, 0, 100)); - size_t out_size = WebPEncodeRGBA (src, w, h, stride, q, &out); + const float clampedQuality = static_cast(clampi (quality, 0, 100)); + size_t out_size = WebPEncodeRGBA (src, width, height, stride, clampedQuality, &out); if (!out || out_size == 0) { if (out) WebPFree (out); From 95104b57832fb303d9a58fed8041e1a564406da4 Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 15:46:19 -0400 Subject: [PATCH 07/12] Compile SSE2 files on iOS. --- project/lib/webp-files.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/project/lib/webp-files.xml b/project/lib/webp-files.xml index 6a6de57af7..d779fe03bd 100644 --- a/project/lib/webp-files.xml +++ b/project/lib/webp-files.xml @@ -267,6 +267,23 @@
+ +
+ + + + + + + + + + + + + +
+
From cf9020e562338a44a5ac33e3beba2271b33f34d1 Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 15:57:44 -0400 Subject: [PATCH 08/12] Reduce duplicate code. --- project/lib/webp-files.xml | 274 +++++++++++-------------------------- 1 file changed, 77 insertions(+), 197 deletions(-) diff --git a/project/lib/webp-files.xml b/project/lib/webp-files.xml index d779fe03bd..196d6259f2 100644 --- a/project/lib/webp-files.xml +++ b/project/lib/webp-files.xml @@ -80,240 +80,120 @@
- +
- - - - - - - - - - - - - - - - - - - - - + + +
- - - - - - - - - - - - - - - - - - - - - - - - - + + +
- - - - - - - - - - - - - - - - - - - - - + +
- - - - - - - - - - - - - - - - - - - - - - - - - + + +
- - - - - - - - - - - - - - - - - - - - - + +
- - - - - - - - - - - - - - - - - - - - - - - - - + + +
- - - - - - - - - - - - - - - - - - - - - + +
- - - - - - - - - - - - - +
- - - - - - - - - - - +
- - - - - - - - - - - - - + + +
+ +
+ +
+ + + + + + + + + + + + + +
+ + +
+ + + + + + + + +
+ + +
+ + + + +
+ + +
+ + + + + + + + + + + +
From a8778329637872a480356879b685db69e3f987be Mon Sep 17 00:00:00 2001 From: Dimitri Tugo Date: Thu, 16 Oct 2025 00:35:55 +0200 Subject: [PATCH 09/12] fix iOS Simulator (x86_64) link errors --- project/lib/webp-files.xml | 290 +++++++++++++++++++++++++++---------- 1 file changed, 210 insertions(+), 80 deletions(-) diff --git a/project/lib/webp-files.xml b/project/lib/webp-files.xml index 196d6259f2..363c6dd1f1 100644 --- a/project/lib/webp-files.xml +++ b/project/lib/webp-files.xml @@ -80,120 +80,250 @@
- +
- - - + + + + + + + + + + + + + + + + + + + + +
- - - + + + + + + + + + + + + + + + + + + + + + + + + +
- - + + + + + + + + + + + + + + + + + + + + +
- - - + + + + + + + + + + + + + + + + + + + + + + + + +
- - + + + + + + + + + + + + + + + + + + + + +
- - - + + + + + + + + + + + + + + + + + + + + + + + + +
- - -
- - -
- + + + + + + + + + + + + + + + + + + + + +
- + + + + + + + + + + +
- - + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + +
-
- -
- - - - - - - - - - - - - -
- - -
- - - - - - - - -
- - -
- - - - -
- - -
- - - - - - - - - - - -
-
From 9a3214301da6ec46f4d023e6429e0917f7eb7466 Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 19:18:59 -0400 Subject: [PATCH 10/12] Enable SSE for iOS Simulator instead of iOS. --- project/lib/webp-files.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project/lib/webp-files.xml b/project/lib/webp-files.xml index 196d6259f2..6ddcaba4c1 100644 --- a/project/lib/webp-files.xml +++ b/project/lib/webp-files.xml @@ -126,9 +126,10 @@ - -
+ +
+
From 62cf20b6897990f484be5d99f21d835f80adeaf2 Mon Sep 17 00:00:00 2001 From: player-03 Date: Wed, 15 Oct 2025 19:22:41 -0400 Subject: [PATCH 11/12] Move `` tags outside `
`. hxcpp ignores them otherwise. --- project/lib/webp-files.xml | 66 +++++++++++++------------------------- 1 file changed, 23 insertions(+), 43 deletions(-) diff --git a/project/lib/webp-files.xml b/project/lib/webp-files.xml index 6ddcaba4c1..56ab42243c 100644 --- a/project/lib/webp-files.xml +++ b/project/lib/webp-files.xml @@ -81,67 +81,47 @@
-
- - - -
+ + + -
- - - -
+ + + -
- - -
+ + -
- - - -
+ + + -
- - -
+ + -
- - - -
+ + + -
- - -
+ + -
- - -
+ + -
- -
+ -
- - -
+ +
From e863a017e2856ec2230bb2174c5c3112dba8b21d Mon Sep 17 00:00:00 2001 From: Dimitri Tugo Date: Thu, 16 Oct 2025 08:08:25 +0200 Subject: [PATCH 12/12] bugfix: add AVX2 TUs on x86/32 (CPUID-gated); simplify CPU gating; whitelist GNU -m flags for GCC/Clang to avoid leakage --- project/lib/webp-files.xml | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/project/lib/webp-files.xml b/project/lib/webp-files.xml index f3672efad1..228330de11 100644 --- a/project/lib/webp-files.xml +++ b/project/lib/webp-files.xml @@ -1,20 +1,5 @@ - - - - - - - - - - - - - - - - +
@@ -99,8 +84,8 @@
-
- +
+ @@ -118,8 +103,8 @@
-
- +
+ @@ -131,9 +116,11 @@
-
- - + +
+ + @@ -141,7 +128,7 @@
-
+