前提介绍
由于厂家提供的opengl/egl库不开源,所以我们参考了android自带的libGLES_android.so的源码实现;
frameworks/native/opengl/libagl
参考程序为bootanimation;
android版本为4.4.2 aosp版本;
分析过程:
出队列:
本以为是eglCreateWindowSurface时会去调用bufferqueue中的dequeuebuffer接口申请buffer,结果追踪后发现是在eglMakeCurrent中通过egl_window_surface_v2_t::connect来申请buffer;
入队列:
这个基本不用说,eglSwapBuffers中调用;
接下来的流程:
BufferQueue::queueBuffer
Layer::onFrameAvailable
SurfaceFlinger::signalLayerUpdate