aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host/libs
diff options
context:
space:
mode:
Diffstat (limited to 'emulator/opengl/host/libs')
-rw-r--r--emulator/opengl/host/libs/GLESv1_dec/Android.mk4
-rw-r--r--emulator/opengl/host/libs/GLESv2_dec/Android.mk4
-rw-r--r--emulator/opengl/host/libs/Translator/GLcommon/Android.mk2
-rw-r--r--emulator/opengl/host/libs/libOpenglRender/Android.mk6
-rw-r--r--emulator/opengl/host/libs/libOpenglRender/render_api.cpp124
5 files changed, 9 insertions, 131 deletions
diff --git a/emulator/opengl/host/libs/GLESv1_dec/Android.mk b/emulator/opengl/host/libs/GLESv1_dec/Android.mk
index 7ab3f0a..e0eca6e 100644
--- a/emulator/opengl/host/libs/GLESv1_dec/Android.mk
+++ b/emulator/opengl/host/libs/GLESv1_dec/Android.mk
@@ -10,7 +10,7 @@ host_common_debug_CFLAGS :=
### host library #########################################
$(call emugl-begin-host-static-library,libGLESv1_dec)
-$(call emugl-import, libOpenglCodecCommon libOpenglOsUtils)
+$(call emugl-import, libOpenglCodecCommon)
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
$(call emugl-gen-decoder,$(LOCAL_PATH),gl)
@@ -27,7 +27,7 @@ $(call emugl-end-module)
ifdef EMUGL_BUILD_64BITS
$(call emugl-begin-host64-static-library,lib64GLESv1_dec)
- $(call emugl-import, lib64OpenglCodecCommon lib64OpenglOsUtils)
+ $(call emugl-import, lib64OpenglCodecCommon)
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
$(call emugl-gen-decoder,$(LOCAL_PATH),gl)
diff --git a/emulator/opengl/host/libs/GLESv2_dec/Android.mk b/emulator/opengl/host/libs/GLESv2_dec/Android.mk
index bc04c25..f658f11 100644
--- a/emulator/opengl/host/libs/GLESv2_dec/Android.mk
+++ b/emulator/opengl/host/libs/GLESv2_dec/Android.mk
@@ -9,7 +9,7 @@ host_common_debug_CFLAGS :=
### host library ##########################################
$(call emugl-begin-host-static-library,libGLESv2_dec)
-$(call emugl-import, libOpenglCodecCommon libOpenglOsUtils)
+$(call emugl-import, libOpenglCodecCommon)
$(call emugl-gen-decoder,$(LOCAL_PATH),gl2)
# For gl2_types.h !
@@ -24,7 +24,7 @@ $(call emugl-end-module)
### host library, 64-bit ####################################
ifdef EMUGL_BUILD_64BITS
$(call emugl-begin-host64-static-library,lib64GLESv2_dec)
- $(call emugl-import, lib64OpenglCodecCommon lib64OpenglOsUtils)
+ $(call emugl-import, lib64OpenglCodecCommon)
$(call emugl-gen-decoder,$(LOCAL_PATH),gl2)
# For gl2_types.h !
diff --git a/emulator/opengl/host/libs/Translator/GLcommon/Android.mk b/emulator/opengl/host/libs/Translator/GLcommon/Android.mk
index b215329..fdbedad 100644
--- a/emulator/opengl/host/libs/Translator/GLcommon/Android.mk
+++ b/emulator/opengl/host/libs/Translator/GLcommon/Android.mk
@@ -35,7 +35,6 @@ endif
$(call emugl-begin-host-static-library,libGLcommon)
-$(call emugl-import,libOpenglOsUtils)
translator_path := $(LOCAL_PATH)/..
LOCAL_SRC_FILES := $(host_common_SRC_FILES)
$(call emugl-export,LDLIBS,$(host_common_LDLIBS))
@@ -50,7 +49,6 @@ $(call emugl-end-module)
ifdef EMUGL_BUILD_64BITS
$(call emugl-begin-host64-static-library,lib64GLcommon)
- $(call emugl-import,lib64OpenglOsUtils)
translator_path := $(LOCAL_PATH)/..
LOCAL_SRC_FILES := $(host_common_SRC_FILES)
LOCAL_CFLAGS += -fPIC
diff --git a/emulator/opengl/host/libs/libOpenglRender/Android.mk b/emulator/opengl/host/libs/libOpenglRender/Android.mk
index 787ae83..ca5a08a 100644
--- a/emulator/opengl/host/libs/libOpenglRender/Android.mk
+++ b/emulator/opengl/host/libs/libOpenglRender/Android.mk
@@ -5,7 +5,7 @@ host_common_LDLIBS :=
ifeq ($(HOST_OS),linux)
host_OS_SRCS = NativeLinuxSubWindow.cpp
- host_common_LDLIBS += -lX11
+ host_common_LDLIBS += -lX11 -lrt
endif
ifeq ($(HOST_OS),darwin)
@@ -43,7 +43,7 @@ host_common_CFLAGS :=
### host libOpenglRender #################################################
$(call emugl-begin-host-shared-library,libOpenglRender)
-$(call emugl-import,libGLESv1_dec libGLESv2_dec lib_renderControl_dec libOpenglCodecCommon libOpenglOsUtils)
+$(call emugl-import,libGLESv1_dec libGLESv2_dec lib_renderControl_dec libOpenglCodecCommon)
LOCAL_LDLIBS += $(host_common_LDLIBS)
@@ -65,7 +65,7 @@ $(call emugl-end-module)
ifdef EMUGL_BUILD_64BITS
$(call emugl-begin-host64-shared-library,lib64OpenglRender)
- $(call emugl-import,lib64GLESv1_dec lib64GLESv2_dec lib64_renderControl_dec lib64OpenglCodecCommon lib64OpenglOsUtils)
+ $(call emugl-import,lib64GLESv1_dec lib64GLESv2_dec lib64_renderControl_dec lib64OpenglCodecCommon)
#LOCAL_LDFLAGS += -m64 # adding -m64 here doesn't work, because it somehow appear BEFORE -m32 in command-line.
LOCAL_LDLIBS += $(host_common_LDLIBS) -m64 # Put -m64 it in LOCAL_LDLIBS instead.
diff --git a/emulator/opengl/host/libs/libOpenglRender/render_api.cpp b/emulator/opengl/host/libs/libOpenglRender/render_api.cpp
index 42df668..9586091 100644
--- a/emulator/opengl/host/libs/libOpenglRender/render_api.cpp
+++ b/emulator/opengl/host/libs/libOpenglRender/render_api.cpp
@@ -17,7 +17,6 @@
#include "IOStream.h"
#include "FrameBuffer.h"
#include "RenderServer.h"
-#include "osProcess.h"
#include "TimeUtils.h"
#include "TcpStream.h"
@@ -31,25 +30,12 @@
#include "GLDispatch.h"
#include "GL2Dispatch.h"
-static osUtils::childProcess *s_renderProc = NULL;
static RenderServer *s_renderThread = NULL;
static char s_renderAddr[256];
static IOStream *createRenderThread(int p_stream_buffer_size,
unsigned int clientFlags);
-//
-// For now run the renderer as a thread inside the calling
-// process instead as running it in a separate process for all
-// platforms.
-// at the future we want it to run as a seperate process except for
-// Mac OS X since it is imposibble on this platform to make one process
-// render to a window created by another process.
-//
-//#ifdef __APPLE__
-#define RENDER_API_USE_THREAD
-//#endif
-
int initLibrary(void)
{
//
@@ -82,11 +68,10 @@ int initOpenGLRenderer(int width, int height, char* addr, size_t addrLen)
//
// Fail if renderer is already initialized
//
- if (s_renderProc || s_renderThread) {
+ if (s_renderThread) {
return false;
}
-#ifdef RENDER_API_USE_THREAD // should be defined for mac
//
// initialize the renderer and listen to connections
// on a thread in the current process.
@@ -104,110 +89,15 @@ int initOpenGLRenderer(int width, int height, char* addr, size_t addrLen)
s_renderThread->start();
-#else
- if (onPost) {
- // onPost callback not supported with separate renderer process.
- //
- // If we ever revive separate process support, we could make the choice
- // between thread and process at runtime instead of compile time, and
- // choose the thread path if an onPost callback is requested. Or, the
- // callback could be supported with a separate process using shmem or
- // other IPC mechanism.
- return false;
- }
-
- //
- // Launch emulator_renderer
- //
- char cmdLine[128];
- snprintf(cmdLine, 128, "emulator_renderer -windowid %d -port %d -x %d -y %d -width %d -height %d",
- (int)window, portNum, x, y, width, height);
-
- s_renderProc = osUtils::childProcess::create(cmdLine, NULL);
- if (!s_renderProc) {
- return false;
- }
-
- //
- // try to connect to the renderer in order to check it
- // was successfully initialized.
- //
- int nTrys = 0;
- IOStream *dummy = NULL;
- do {
- ++nTrys;
-
- //
- // Wait a bit to make the renderer process a chance to be
- // initialized.
- // On Windows we need during this time to handle windows
- // events since the renderer generates a subwindow of this
- // process's window, we need to be responsive for windows
- // during this time to let the renderer generates this subwindow.
- //
-#ifndef _WIN32
- TimeSleepMS(300);
-#else
- long long t0 = GetCurrentTimeMS();
- while( (GetCurrentTimeMS() - t0) < 300 ) {
- MSG msg;
- int n = 0;
- while( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
- {
- n++;
- TranslateMessage( &msg );
- DispatchMessage( &msg );
- }
- if (n == 0) TimeSleepMS(10);
- }
-#endif
-
- dummy = createRenderThread(8, 0);
-
- if (!dummy) {
- // stop if the process is no longer running
- if (!osUtils::isProcessRunning(s_renderProc->getPID())) {
- break;
- }
- }
- } while(!dummy && nTrys < 10); // give up after 3 seconds, XXX: ???
-
- if (!dummy) {
- //
- // Failed - make sure the process is killed
- //
- osUtils::KillProcess(s_renderProc->getPID(), true);
- delete s_renderProc;
- s_renderProc = NULL;
- return false;
- }
-
- // destroy the dummy connection
- delete dummy;
-#endif
-
return true;
}
void setPostCallback(OnPostFn onPost, void* onPostContext)
{
-#ifdef RENDER_API_USE_THREAD // should be defined for mac
FrameBuffer* fb = FrameBuffer::getFB();
if (fb) {
fb->setPostCallback(onPost, onPostContext);
}
-#else
- if (onPost) {
- // onPost callback not supported with separate renderer process.
- //
- // If we ever revive separate process support, we could make the choice
- // between thread and process at runtime instead of compile time, and
- // choose the thread path if an onPost callback is requested. Or, the
- // callback could be supported with a separate process using shmem or
- // other IPC mechanism.
- return false;
- }
-#endif
}
void getHardwareStrings(const char** vendor, const char** renderer, const char** version)
@@ -230,17 +120,7 @@ int stopOpenGLRenderer(void)
IOStream *dummy = createRenderThread(8, IOSTREAM_CLIENT_EXIT_SERVER);
if (!dummy) return false;
- if (s_renderProc) {
- //
- // wait for the process to exit
- //
- int exitStatus;
- ret = s_renderProc->wait(&exitStatus);
-
- delete s_renderProc;
- s_renderProc = NULL;
- }
- else if (s_renderThread) {
+ if (s_renderThread) {
// wait for the thread to exit
ret = s_renderThread->wait(NULL);