1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:17:35 +00:00

Ladybird/Android: Create a service for ImageDecoder

This follows the pattern for the other services spawned by WebContent.
The notable quirk about this service is that it's actually spawned by
the ImageCodecPlugin rather than in main.cpp in the non-Android port.

As a result we needed to do some ifdef surgery to get all the pieces
in place. But we can now load images in the Android port again :^).
This commit is contained in:
Andrew Kaster 2023-10-31 15:27:23 -06:00 committed by Andrew Kaster
parent a54baa2c34
commit c990db0913
10 changed files with 108 additions and 8 deletions

View file

@ -2,11 +2,22 @@ set(IMAGE_DECODER_SOURCE_DIR ${SERENITY_SOURCE_DIR}/Userland/Services/ImageDecod
set(IMAGE_DECODER_SOURCES
${IMAGE_DECODER_SOURCE_DIR}/ConnectionFromClient.cpp
main.cpp
)
add_executable(ImageDecoder ${IMAGE_DECODER_SOURCES})
if (ANDROID)
add_library(imagedecoder SHARED
${IMAGE_DECODER_SOURCES}
../Android/src/main/cpp/ImageDecoderService.cpp
../Android/src/main/cpp/LadybirdServiceBaseJNI.cpp
../Utilities.cpp
)
else()
add_library(imagedecoder STATIC ${IMAGE_DECODER_SOURCES})
endif()
target_include_directories(ImageDecoder PRIVATE ${SERENITY_SOURCE_DIR}/Userland/Services/)
target_include_directories(ImageDecoder PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..)
target_link_libraries(ImageDecoder PRIVATE LibCore LibGfx LibIPC LibImageDecoderClient LibMain)
add_executable(ImageDecoder main.cpp)
target_link_libraries(ImageDecoder PRIVATE imagedecoder LibMain)
target_include_directories(imagedecoder PRIVATE ${SERENITY_SOURCE_DIR}/Userland/Services/)
target_include_directories(imagedecoder PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..)
target_link_libraries(imagedecoder PRIVATE LibCore LibGfx LibIPC LibImageDecoderClient LibMain)