Relocate global webp decoder initilization

This commit is contained in:
Martín Capello 2024-10-10 09:29:35 -03:00
parent 765cf43f69
commit ac1024f5d3
4 changed files with 10 additions and 10 deletions

View File

@ -78,6 +78,10 @@
#include "os/x11/system.h"
#endif
#if ENABLE_WEBP && LAF_WINDOWS
#include "app/util/decode_webp.h"
#endif
#include <iostream>
#include <memory>
@ -482,6 +486,10 @@ void App::run()
manager->display()->nativeWindow()
->setInterpretOneFingerGestureAsMouseMovement(
preferences().experimental.oneFingerAsMouseMovement());
#if ENABLE_WEBP
// In Windows we use a custom webp decoder for drag & drop operations.
os::set_decode_webp(util::decode_webp);
#endif
#endif
#if LAF_LINUX

View File

@ -23,10 +23,6 @@
#include "doc/layer_list.h"
#include "render/dithering.h"
#if ENABLE_WEBP && LAF_WINDOWS
#include "app/util/decode_webp.h"
#endif
#include <algorithm>
namespace app {

View File

@ -6,6 +6,8 @@
#include "app/util/decode_webp.h"
#include "os/system.h"
#include <webp/demux.h>
#include <webp/mux.h>

View File

@ -9,7 +9,6 @@
#pragma once
#include "os/surface.h"
#include "os/system.h"
namespace app {
@ -19,11 +18,6 @@ namespace util {
// frame.
os::SurfaceRef decode_webp(const uint8_t* buf, uint32_t len);
static void* once = []() {
os::set_decode_webp(decode_webp);
return nullptr;
}();
}
}