Android Graphics 分析 关于应用程序、opengles、bufferqueue

来源:互联网 发布:linux学习文档 编辑:程序博客网 时间:2024/06/07 04:40

前提介绍

由于厂家提供的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

0 0
原创粉丝点击