Loading opengl/libs/EGL/Loader.cpp +35 −3 Original line number Original line Diff line number Diff line Loading @@ -92,7 +92,7 @@ checkGlesEmulationStatus(void) return -1; return -1; /* We are in the emulator, get GPU status value */ /* We are in the emulator, get GPU status value */ property_get("ro.kernel.qemu.gles",prop,"0"); property_get("qemu.gles",prop,"0"); return atoi(prop); return atoi(prop); } } Loading Loading @@ -174,11 +174,45 @@ static void* load_wrapper(const char* path) { #endif #endif #endif #endif static void setEmulatorGlesValue(void) { char prop[PROPERTY_VALUE_MAX]; property_get("ro.kernel.qemu", prop, "0"); if (atoi(prop) != 1) return; property_get("ro.kernel.qemu.gles",prop,"0"); if (atoi(prop) == 1) { ALOGD("Emulator has host GPU support, qemu.gles is set to 1."); property_set("qemu.gles", "1"); return; } // for now, checking the following // directory is good enough for emulator system images const char* vendor_lib_path = #if defined(__LP64__) "/vendor/lib64/egl"; #else "/vendor/lib/egl"; #endif const bool has_vendor_lib = (access(vendor_lib_path, R_OK) == 0); if (has_vendor_lib) { ALOGD("Emulator has vendor provided software renderer, qemu.gles is set to 2."); property_set("qemu.gles", "2"); } else { ALOGD("Emulator without GPU support detected. " "Fallback to legacy software renderer, qemu.gles is set to 0."); property_set("qemu.gles", "0"); } } void* Loader::open(egl_connection_t* cnx) void* Loader::open(egl_connection_t* cnx) { { void* dso; void* dso; driver_t* hnd = 0; driver_t* hnd = 0; setEmulatorGlesValue(); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2); if (dso) { if (dso) { hnd = new driver_t(dso); hnd = new driver_t(dso); Loading Loading @@ -280,8 +314,6 @@ void *Loader::load_driver(const char* kind, int emulationStatus = checkGlesEmulationStatus(); int emulationStatus = checkGlesEmulationStatus(); switch (emulationStatus) { switch (emulationStatus) { case 0: case 0: ALOGD("Emulator without GPU support detected. " "Fallback to legacy software renderer."); #if defined(__LP64__) #if defined(__LP64__) result.setTo("/system/lib64/egl/libGLES_android.so"); result.setTo("/system/lib64/egl/libGLES_android.so"); #else #else Loading Loading
opengl/libs/EGL/Loader.cpp +35 −3 Original line number Original line Diff line number Diff line Loading @@ -92,7 +92,7 @@ checkGlesEmulationStatus(void) return -1; return -1; /* We are in the emulator, get GPU status value */ /* We are in the emulator, get GPU status value */ property_get("ro.kernel.qemu.gles",prop,"0"); property_get("qemu.gles",prop,"0"); return atoi(prop); return atoi(prop); } } Loading Loading @@ -174,11 +174,45 @@ static void* load_wrapper(const char* path) { #endif #endif #endif #endif static void setEmulatorGlesValue(void) { char prop[PROPERTY_VALUE_MAX]; property_get("ro.kernel.qemu", prop, "0"); if (atoi(prop) != 1) return; property_get("ro.kernel.qemu.gles",prop,"0"); if (atoi(prop) == 1) { ALOGD("Emulator has host GPU support, qemu.gles is set to 1."); property_set("qemu.gles", "1"); return; } // for now, checking the following // directory is good enough for emulator system images const char* vendor_lib_path = #if defined(__LP64__) "/vendor/lib64/egl"; #else "/vendor/lib/egl"; #endif const bool has_vendor_lib = (access(vendor_lib_path, R_OK) == 0); if (has_vendor_lib) { ALOGD("Emulator has vendor provided software renderer, qemu.gles is set to 2."); property_set("qemu.gles", "2"); } else { ALOGD("Emulator without GPU support detected. " "Fallback to legacy software renderer, qemu.gles is set to 0."); property_set("qemu.gles", "0"); } } void* Loader::open(egl_connection_t* cnx) void* Loader::open(egl_connection_t* cnx) { { void* dso; void* dso; driver_t* hnd = 0; driver_t* hnd = 0; setEmulatorGlesValue(); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2); dso = load_driver("GLES", cnx, EGL | GLESv1_CM | GLESv2); if (dso) { if (dso) { hnd = new driver_t(dso); hnd = new driver_t(dso); Loading Loading @@ -280,8 +314,6 @@ void *Loader::load_driver(const char* kind, int emulationStatus = checkGlesEmulationStatus(); int emulationStatus = checkGlesEmulationStatus(); switch (emulationStatus) { switch (emulationStatus) { case 0: case 0: ALOGD("Emulator without GPU support detected. " "Fallback to legacy software renderer."); #if defined(__LP64__) #if defined(__LP64__) result.setTo("/system/lib64/egl/libGLES_android.so"); result.setTo("/system/lib64/egl/libGLES_android.so"); #else #else Loading