step1. 在htc手机(2.3系统)上跑10.3,加载网页flash没有问题,换成10.1,出错,可见10.1确实只能在2.2上跑
step2. 在我们自己的开发板上跟踪,10.3和10.1apk中的内容大致一样,在加载的时候报错,库内部函数无法分配,看来是依赖的函数无法找到实现,10.1和10.3都有这个问题
step3. 10.1出错的是找不到udat_close_4_2的实现,先没管他,去弄10.3了。10.3出错是找不到surfacetexture XXXX的实现,因为我们的芯片没gpu,只能跑纯软件的gles,推断这个是gles2.0里面的扩展
step4. 于是我们傻乎乎的去想办法把gles2.0跑起来
gles的代码在framework/base/opengl下,其中libagl是一个软件实现,逻辑代码集中在libs中,有egl,gles2,gles_cm三种实现,三个文件夹会编译成三个so文件,由framework/base/opengl/libs/egl/loader.cpp进行加载
吐槽一下里面的加载流程
void* Loader::open(EGLNativeDisplayType display, int impl, egl_connection_t* cnx)
{
/*
* TODO: if we don't find display/0, then use 0/0
* (0/0 should always work)
*/
void* dso;
int index = int(display);
driver_t* hnd = 0;
char const* tag = getTag(index, impl);
if (tag) {
dso = load_driver("GLES", tag, cnx, EGL | GLESv1_CM | GLESv2);
if (dso) {
hnd = new driver_t(dso);
} else {
// Always load EGL first
dso = load_driver("EGL", tag, cnx, EGL);
if (dso) {
hnd = new driver_t(dso);
// TODO: make this more automated
hnd->set( load_driver("GLESv1_CM", tag, cnx, GLESv1_CM), GLESv1_CM );
hnd->set( load_driver("GLESv2", tag, cnx, GLESv2), GLESv2 );
}
}
}
LOG_FATAL_IF(!index && !impl && !hnd,
"couldn't find the default OpenGL ES implementation "
"for default display");
return (void*)hnd;
}
是不是应该优先加载牛逼的2.0,然后才是1.0更好一些啊~
通过改代码(其实这样很蠢),我们把2.0强行加载进去了,当然一进去就黑了
之后了解到可以通过修改/system/lib/egl/egl.cfg来确定启动的时候加载哪个库
再吐槽一下,为毛没有默认的配置文件,这是省事还是挖坑
具体传送门http://wenku.baidu.com/view/d31518f7f61fb7360b4c65d1.html
至此,基本上10.3已经在我们的开发板上宣判死刑