Commit 6396f9f5 authored by Alexandre Julliard's avatar Alexandre Julliard

wineandroid: Load the gralloc module in all processes.

parent fe6367ae
......@@ -107,4 +107,6 @@ int send_event( const union event_data *data );
extern JavaVM *wine_get_java_vm(void);
extern jobject wine_get_java_object(void);
extern struct gralloc_module_t *gralloc_module;
#endif /* __WINE_ANDROID_H */
......@@ -402,6 +402,31 @@ static const JNINativeMethod methods[] =
DECL_FUNCPTR( __android_log_print );
DECL_FUNCPTR( ANativeWindow_fromSurface );
DECL_FUNCPTR( ANativeWindow_release );
DECL_FUNCPTR( hw_get_module );
struct gralloc_module_t *gralloc_module = NULL;
static void load_hardware_libs(void)
{
const struct hw_module_t *module;
void *libhardware;
char error[256];
if ((libhardware = wine_dlopen( "libhardware.so", RTLD_GLOBAL, error, sizeof(error) )))
{
LOAD_FUNCPTR( libhardware, hw_get_module );
}
else
{
ERR( "failed to load libhardware: %s\n", error );
return;
}
if (phw_get_module( GRALLOC_HARDWARE_MODULE_ID, &module ) == 0)
gralloc_module = (struct gralloc_module_t *)module;
else
ERR( "failed to load gralloc module\n" );
}
static void load_android_libs(void)
{
......@@ -433,6 +458,8 @@ static BOOL process_attach(void)
JNIEnv *jni_env;
JavaVM *java_vm;
load_hardware_libs();
if ((java_vm = wine_get_java_vm())) /* running under Java */
{
#ifdef __i386__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment