mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-03 22:35:32 +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:
committed by
Andrew Kaster
parent
a54baa2c34
commit
c990db0913
@@ -12,6 +12,7 @@ jobject global_instance;
|
||||
jclass global_class_reference;
|
||||
jmethodID bind_request_server_method;
|
||||
jmethodID bind_web_socket_method;
|
||||
jmethodID bind_image_decoder_method;
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_org_serenityos_ladybird_WebContentService_nativeInit(JNIEnv* env, jobject thiz)
|
||||
@@ -33,6 +34,11 @@ Java_org_serenityos_ladybird_WebContentService_nativeInit(JNIEnv* env, jobject t
|
||||
if (!method)
|
||||
TODO();
|
||||
bind_web_socket_method = method;
|
||||
|
||||
method = env->GetMethodID(global_class_reference, "bindImageDecoder", "(II)V");
|
||||
if (!method)
|
||||
TODO();
|
||||
bind_image_decoder_method = method;
|
||||
}
|
||||
|
||||
void bind_request_server_java(int ipc_socket, int fd_passing_socket)
|
||||
@@ -46,3 +52,9 @@ void bind_web_socket_java(int ipc_socket, int fd_passing_socket)
|
||||
Ladybird::JavaEnvironment env(global_vm);
|
||||
env.get()->CallVoidMethod(global_instance, bind_web_socket_method, ipc_socket, fd_passing_socket);
|
||||
}
|
||||
|
||||
void bind_image_decoder_java(int ipc_socket, int fd_passing_socket)
|
||||
{
|
||||
Ladybird::JavaEnvironment env(global_vm);
|
||||
env.get()->CallVoidMethod(global_instance, bind_image_decoder_method, ipc_socket, fd_passing_socket);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user