Merge "emulator opengl: fixed wrong delete"
diff --git a/ndk/platforms/android-9/arch-x86/lib/crtbegin_dynamic.o b/ndk/platforms/android-9/arch-x86/lib/crtbegin_dynamic.o
index 102fc37..17704f5 100644
--- a/ndk/platforms/android-9/arch-x86/lib/crtbegin_dynamic.o
+++ b/ndk/platforms/android-9/arch-x86/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/crtbegin_so.o b/ndk/platforms/android-9/arch-x86/lib/crtbegin_so.o
index 662d85a..cf50f1d 100644
--- a/ndk/platforms/android-9/arch-x86/lib/crtbegin_so.o
+++ b/ndk/platforms/android-9/arch-x86/lib/crtbegin_so.o
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/crtbegin_static.o b/ndk/platforms/android-9/arch-x86/lib/crtbegin_static.o
index 102fc37..17704f5 100644
--- a/ndk/platforms/android-9/arch-x86/lib/crtbegin_static.o
+++ b/ndk/platforms/android-9/arch-x86/lib/crtbegin_static.o
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libEGL.so b/ndk/platforms/android-9/arch-x86/lib/libEGL.so
index 6a8277e..49020a9 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libEGL.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libEGL.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libGLESv1_CM.so b/ndk/platforms/android-9/arch-x86/lib/libGLESv1_CM.so
index d03d357..83ddd59 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libGLESv1_CM.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libGLESv1_CM.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libGLESv2.so b/ndk/platforms/android-9/arch-x86/lib/libGLESv2.so
index 51d6b59..7c72567 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libGLESv2.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libGLESv2.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libOpenSLES.so b/ndk/platforms/android-9/arch-x86/lib/libOpenSLES.so
index 110da00..de81e57 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libOpenSLES.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libOpenSLES.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libandroid.so b/ndk/platforms/android-9/arch-x86/lib/libandroid.so
index e106436..419d414 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libandroid.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libandroid.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libc.a b/ndk/platforms/android-9/arch-x86/lib/libc.a
index e47736f..90220b0 100644
--- a/ndk/platforms/android-9/arch-x86/lib/libc.a
+++ b/ndk/platforms/android-9/arch-x86/lib/libc.a
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libc.so b/ndk/platforms/android-9/arch-x86/lib/libc.so
index bf23ca5..fd6c188 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libc.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libc.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libdl.so b/ndk/platforms/android-9/arch-x86/lib/libdl.so
index 2c13187..c31fd46 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libdl.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libdl.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libjnigraphics.so b/ndk/platforms/android-9/arch-x86/lib/libjnigraphics.so
index c669957..2a0494f 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libjnigraphics.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libjnigraphics.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/liblog.so b/ndk/platforms/android-9/arch-x86/lib/liblog.so
index f28bf77..6ab1fd2 100755
--- a/ndk/platforms/android-9/arch-x86/lib/liblog.so
+++ b/ndk/platforms/android-9/arch-x86/lib/liblog.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libm.a b/ndk/platforms/android-9/arch-x86/lib/libm.a
index 092b2cc..34f3c1f 100644
--- a/ndk/platforms/android-9/arch-x86/lib/libm.a
+++ b/ndk/platforms/android-9/arch-x86/lib/libm.a
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libm.so b/ndk/platforms/android-9/arch-x86/lib/libm.so
index ce9ffea..78c3def 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libm.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libm.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libstdc++.a b/ndk/platforms/android-9/arch-x86/lib/libstdc++.a
index 04788e0..336bcfa 100644
--- a/ndk/platforms/android-9/arch-x86/lib/libstdc++.a
+++ b/ndk/platforms/android-9/arch-x86/lib/libstdc++.a
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libstdc++.so b/ndk/platforms/android-9/arch-x86/lib/libstdc++.so
index 4ddac65..248dc48 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libstdc++.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libstdc++.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libthread_db.a b/ndk/platforms/android-9/arch-x86/lib/libthread_db.a
index de2e34d..9525ff1 100644
--- a/ndk/platforms/android-9/arch-x86/lib/libthread_db.a
+++ b/ndk/platforms/android-9/arch-x86/lib/libthread_db.a
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libz.a b/ndk/platforms/android-9/arch-x86/lib/libz.a
index 1df2ec3..5c91867 100644
--- a/ndk/platforms/android-9/arch-x86/lib/libz.a
+++ b/ndk/platforms/android-9/arch-x86/lib/libz.a
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/lib/libz.so b/ndk/platforms/android-9/arch-x86/lib/libz.so
index 9155cb9..384e8c4 100755
--- a/ndk/platforms/android-9/arch-x86/lib/libz.so
+++ b/ndk/platforms/android-9/arch-x86/lib/libz.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-x86/symbols/libEGL.so.txt b/ndk/platforms/android-9/arch-x86/symbols/libEGL.so.txt
index 88d4105..8550335 100644
--- a/ndk/platforms/android-9/arch-x86/symbols/libEGL.so.txt
+++ b/ndk/platforms/android-9/arch-x86/symbols/libEGL.so.txt
@@ -1,19 +1,16 @@
eglBindAPI
eglBindTexImage
eglChooseConfig
-eglClientWaitSyncKHR
eglCopyBuffers
eglCreateContext
eglCreateImageKHR
eglCreatePbufferFromClientBuffer
eglCreatePbufferSurface
eglCreatePixmapSurface
-eglCreateSyncKHR
eglCreateWindowSurface
eglDestroyContext
eglDestroyImageKHR
eglDestroySurface
-eglDestroySyncKHR
eglGetConfigAttrib
eglGetConfigs
eglGetCurrentContext
diff --git a/ndk/platforms/android-9/arch-x86/symbols/libc.so.txt b/ndk/platforms/android-9/arch-x86/symbols/libc.so.txt
index 39d905e..6479e95 100644
--- a/ndk/platforms/android-9/arch-x86/symbols/libc.so.txt
+++ b/ndk/platforms/android-9/arch-x86/symbols/libc.so.txt
@@ -11,9 +11,6 @@
__atexit_register_cleanup
__b64_ntop
__b64_pton
-__bionic_atfork_run_child
-__bionic_atfork_run_parent
-__bionic_atfork_run_prepare
__brk
__cxa_atexit
__cxa_finalize
@@ -22,6 +19,7 @@
__dn_count_labels
__dn_skipname
__dorand48
+__dtoa
__errno
__evAddTime
__evCmpTime
@@ -38,6 +36,7 @@
__fork
__fp_nquery
__fp_query
+__fremovelock
__fstatfs64
__futex_syscall3
__futex_syscall4
@@ -51,7 +50,6 @@
__get_stack_base
__get_thread
__get_tls
-__getcpu
__getcwd
__getpriority
__hostalias
@@ -106,7 +104,7 @@
__p_sockun
__p_time
__p_type
-__popcountsi2
+__pread64
__pthread_cleanup_pop
__pthread_cleanup_push
__pthread_clone
@@ -115,6 +113,7 @@
__ptrace
__putlong
__putshort
+__pwrite64
__reboot
__res_close
__res_dnok
@@ -140,6 +139,7 @@
__res_nsearch
__res_nsend
__res_opt
+__res_ourserver_p
__res_ownok
__res_pquery
__res_put_state
@@ -154,12 +154,9 @@
__rt_sigaction
__rt_sigprocmask
__rt_sigtimedwait
-__sched_cpualloc
-__sched_cpucount
-__sched_cpufree
-__sched_getaffinity
__sclose
__set_errno
+__set_syscall_errno
__set_thread_area
__set_tls
__setresuid
@@ -168,8 +165,10 @@
__sflags
__sflush
__sfp
+__sfvwrite
__sigsuspend
__sinit
+__slbexpand
__smakebuf
__sread
__srefill
@@ -198,19 +197,28 @@
__timer_getoverrun
__timer_gettime
__timer_settime
+__timer_table_start_stop
__udivdi3
__umoddi3
__wait4
__waitid
_cleanup
+_dorand48
+_endhtent
_exit
_exit_thread
_exit_with_stack_teardown
_fwalk
+_gethtbyaddr
+_gethtbyname
+_gethtbyname2
+_gethtent
_getlong
_getshort
_init_thread
_longjmp
+_mktemp
+_sethtent
_setjmp
_thread_created_hook
_waitpid
@@ -230,7 +238,6 @@
asctime64_r
asctime_r
asprintf
-atexit
atoi
atol
atoll
@@ -263,6 +270,8 @@
closelog
closelog_r
connect
+copy_TM_to_tm
+copy_tm_to_TM
cpuacct_add
creat
ctime
@@ -308,10 +317,6 @@
erand48
err
errx
-ether_aton
-ether_aton_r
-ether_ntoa
-ether_ntoa_r
eventfd
eventfd_read
eventfd_write
@@ -373,7 +378,6 @@
ftime
ftok
ftruncate
-ftruncate64
ftrylockfile
fts_children
fts_close
@@ -575,13 +579,10 @@
pipe2
poll
popen
-posix2time
prctl
pread
-pread64
printf
pselect
-pthread_atfork
pthread_attr_destroy
pthread_attr_getdetachstate
pthread_attr_getguardsize
@@ -671,7 +672,6 @@
putwc
putwchar
pwrite
-pwrite64
qsort
raise
read
@@ -694,6 +694,7 @@
renameat
res_init
res_mkquery
+res_need_init
res_query
res_search
rewind
@@ -704,12 +705,9 @@
scanf
sched_get_priority_max
sched_get_priority_min
-sched_getaffinity
-sched_getcpu
sched_getparam
sched_getscheduler
sched_rr_get_interval
-sched_setaffinity
sched_setparam
sched_setscheduler
sched_yield
@@ -763,10 +761,8 @@
sigaltstack
sigblock
siginterrupt
-siglongjmp
sigpending
sigprocmask
-sigsetjmp
sigsetmask
sigsuspend
sigwait
@@ -836,10 +832,7 @@
tcsetpgrp
tempnam
time
-time2posix
-timegm
timegm64
-timelocal
timelocal64
timer_create
timer_delete
@@ -873,6 +866,8 @@
utime
utimes
utmpname
+valid_tm_mon
+valid_tm_wday
valloc
vasprintf
verr
@@ -958,23 +953,30 @@
__libc_malloc_dispatch
__p_cert_syms
__p_class_syms
+__p_default_section_syms
__p_key_syms
__p_rcode_syms
__p_type_syms
+__p_update_section_syms
__page_shift
__page_size
-__popcount_tab
__progname
__rand48_add
__rand48_mult
__rand48_seed
__sF
+__sFext
__sdidinit
__sglue
__stack_chk_guard
__system_property_area__
_ctype_
+_nres
_ns_flagdata
+_rand48_add
+_rand48_mult
+_rand48_seed
+_res_opcodes
_tolower_tab_
_toupper_tab_
daylight
diff --git a/ndk/platforms/android-9/arch-x86/symbols/libm.so.txt b/ndk/platforms/android-9/arch-x86/symbols/libm.so.txt
index 1552b5d..349f00f 100644
--- a/ndk/platforms/android-9/arch-x86/symbols/libm.so.txt
+++ b/ndk/platforms/android-9/arch-x86/symbols/libm.so.txt
@@ -28,7 +28,6 @@
__signbitf
__signbitl
__test_sse
-_scan_nan
acos
acosf
acosh
@@ -138,8 +137,6 @@
lroundl
modf
modff
-nan
-nanf
nearbyint
nearbyintf
nextafter
@@ -177,7 +174,6 @@
tanh
tanhf
tgamma
-tgammaf
trunc
truncf
truncl
diff --git a/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmContext.cpp b/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmContext.cpp
index 3c4758a..7d6dbc5 100644
--- a/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmContext.cpp
+++ b/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmContext.cpp
@@ -56,6 +56,7 @@
delete[] m_texCoords;
m_texCoords = NULL;
}
+ m_map[GL_TEXTURE_COORD_ARRAY] = NULL;
}
diff --git a/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp b/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp
index e4afd54..8a507e5 100644
--- a/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp
+++ b/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp
@@ -167,8 +167,6 @@
static TextureData* getTextureData(){
GET_CTX_RET(NULL);
unsigned int tex = ctx->getBindedTexture();
- if (tex==0)
- return NULL;
TextureData *texData = NULL;
ObjectDataPtr objData = thrd->shareGroup->getObjectData(TEXTURE,tex);
if(!objData.Ptr()){
@@ -658,15 +656,23 @@
GL_API void GL_APIENTRY glGetBooleanv( GLenum pname, GLboolean *params) {
GET_CTX()
+
+ GLint i;
+
switch(pname)
{
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
- GLint i;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
glGetIntegerv(pname, &i);
*params = (i != 0) ? GL_TRUE : GL_FALSE;
break;
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &i);
+ *params = (i != 0) ? GL_TRUE : GL_FALSE;
+ break;
+
case GL_TEXTURE_GEN_STR_OES:
{
GLboolean state_s = GL_FALSE;
@@ -725,17 +731,33 @@
size_t nParams = glParamSize(pname);
GLfloat fParams[16];
+ GLint i;
switch(pname)
{
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
- GLint i;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
glGetIntegerv(pname, &i);
*params = I2X(i);
nParams = 0;
break;
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &i);
+ if(i > 0)
+ {
+ GLint* iParams = new GLint[i];
+ glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, iParams);
+ while(i >= 0)
+ {
+ params[i] = I2X(iParams[i]);
+ i--;
+ }
+ delete [] iParams;
+ }
+ break;
+
case GL_TEXTURE_GEN_STR_OES:
ctx->dispatcher().glGetFloatv(GL_TEXTURE_GEN_S,&fParams[0]);
break;
@@ -754,15 +776,33 @@
GL_API void GL_APIENTRY glGetFloatv( GLenum pname, GLfloat *params) {
GET_CTX()
+
+ GLint i;
+
switch(pname)
{
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
- GLint i;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
glGetIntegerv(pname, &i);
*params = (GLfloat)i;
break;
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &i);
+ if(i > 0)
+ {
+ GLint* iParams = new GLint[i];
+ glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, iParams);
+ while(i >= 0)
+ {
+ params[i] = (GLfloat)iParams[i];
+ i--;
+ }
+ delete [] iParams;
+ }
+ break;
+
case GL_TEXTURE_GEN_STR_OES:
ctx->dispatcher().glGetFloatv(GL_TEXTURE_GEN_S,¶ms[0]);
break;
@@ -788,6 +828,14 @@
ctx->dispatcher().glGetIntegerv(GL_TEXTURE_GEN_S,¶ms[0]);
break;
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ getCompressedFormats(params);
+ break;
+
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
+ *params = getCompressedFormats(NULL);
+ break;
+
default:
ctx->dispatcher().glGetIntegerv(pname,params);
}
diff --git a/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.cpp b/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.cpp
index b26b504..1ff40d9 100644
--- a/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.cpp
+++ b/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.cpp
@@ -16,6 +16,8 @@
#include "TextureUtils.h"
#include <stdio.h>
+#define MAX_SUPPORTED_PALLETE 10
+
struct Color
{
@@ -164,3 +166,19 @@
}
return pixelsOut;
}
+
+int getCompressedFormats(int* formats){
+ if(formats){
+ formats[0] = GL_PALETTE4_RGBA8_OES;
+ formats[1] = GL_PALETTE4_RGBA4_OES;
+ formats[2] = GL_PALETTE8_RGBA8_OES;
+ formats[3] = GL_PALETTE8_RGBA4_OES;
+ formats[4] = GL_PALETTE4_RGB8_OES;
+ formats[5] = GL_PALETTE8_RGB8_OES;
+ formats[6] = GL_PALETTE4_RGB5_A1_OES;
+ formats[7] = GL_PALETTE8_RGB5_A1_OES;
+ formats[8] = GL_PALETTE4_R5_G6_B5_OES;
+ formats[9] = GL_PALETTE8_R5_G6_B5_OES;
+ }
+ return MAX_SUPPORTED_PALLETE;
+}
diff --git a/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.h b/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.h
index 21094af..0dc3286 100644
--- a/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.h
+++ b/tools/emulator/opengl/host/libs/Translator/GLES_CM/TextureUtils.h
@@ -18,6 +18,8 @@
#include <GLES/gl.h>
+
unsigned char* uncompressTexture(GLenum internalformat,GLenum& formatOut,GLsizei width,GLsizei height,GLsizei imageSize, const GLvoid* data,GLint level);
+int getCompressedFormats(int* formats);
#endif