From 73cb02262b956368078fafa453a0be77de3b3080 Mon Sep 17 00:00:00 2001 From: bohu Date: Tue, 30 May 2017 10:31:46 -0700 Subject: goldfish-opengl: move to vendor partition move all the opengl related libraries to vendor/lib , vendor/lib/egl and vendor/lib/hw respectively. BUG: 37511975 Change-Id: I1c68e445b58f0268fc9e5ddfea0e64436e1e56df --- common.mk | 4 ++++ system/egl/eglDisplay.cpp | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/common.mk b/common.mk index 03cadc06..81f558bd 100644 --- a/common.mk +++ b/common.mk @@ -38,6 +38,10 @@ emugl-begin-module = \ $(eval _EMUGL_INCLUDE_TYPE := $(BUILD_$2)) \ $(call _emugl-init-module,$1,$2,$3) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo TREBLE),TREBLE) + emugl-begin-module += $(eval LOCAL_VENDOR_MODULE := true) +endif + ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow) emugl-begin-module += $(eval include external/stlport/libstlport.mk) endif diff --git a/system/egl/eglDisplay.cpp b/system/egl/eglDisplay.cpp index 5e94cfab..c7ff1791 100644 --- a/system/egl/eglDisplay.cpp +++ b/system/egl/eglDisplay.cpp @@ -80,6 +80,12 @@ eglDisplay::~eglDisplay() pthread_mutex_destroy(&m_surfaceLock); } +#if PLATFORM_SDK_VERSION >= 26 +#define PARTITION "/vendor" +#else +#define PARTITION "/system" +#endif + bool eglDisplay::initialize(EGLClient_eglInterface *eglIface) { pthread_mutex_lock(&m_lock); @@ -89,11 +95,11 @@ bool eglDisplay::initialize(EGLClient_eglInterface *eglIface) // load GLES client API // #if __LP64__ - m_gles_iface = loadGLESClientAPI("/system/lib64/egl/libGLESv1_CM_emulation.so", + m_gles_iface = loadGLESClientAPI(PARTITION "/lib64/egl/libGLESv1_CM_emulation.so", eglIface, &s_gles_lib); #else - m_gles_iface = loadGLESClientAPI("/system/lib/egl/libGLESv1_CM_emulation.so", + m_gles_iface = loadGLESClientAPI(PARTITION "/lib/egl/libGLESv1_CM_emulation.so", eglIface, &s_gles_lib); #endif @@ -105,11 +111,11 @@ bool eglDisplay::initialize(EGLClient_eglInterface *eglIface) #ifdef WITH_GLES2 #if __LP64__ - m_gles2_iface = loadGLESClientAPI("/system/lib64/egl/libGLESv2_emulation.so", + m_gles2_iface = loadGLESClientAPI(PARTITION "/lib64/egl/libGLESv2_emulation.so", eglIface, &s_gles2_lib); #else - m_gles2_iface = loadGLESClientAPI("/system/lib/egl/libGLESv2_emulation.so", + m_gles2_iface = loadGLESClientAPI(PARTITION "/lib/egl/libGLESv2_emulation.so", eglIface, &s_gles2_lib); #endif -- cgit v1.2.3