摘要
本文给出一种将Android图形系统SurfaceFlinger移植到桌面Linux发行版的X Window系统环境下运行的方案.在X Window系统环境下运行的SurfaceFlinger可使Android运行环境中以本地进程形式的Android应用进程的UI界面显示到X Window的窗口中.使用Mesa作为Open GL ES实现并使Mesa EGL兼容Android的本地窗口ANative Window,同时借助Androidx86的gralloc.drm.so模块,实现了Android应用程序的UI渲染过程SurfaceFlinger的图像合成过程能够使用GPU进行硬件加速.另外,用X11的DRI2扩展协调SurfaceFlinger的窗口和X Server的DDX驱动,使合成后的图像能高效地更新到窗口中,避免了SurfaceFlinger的图像缓存由独立显存到系统内存的拷贝过程.经实验,在本移植方案下,第三方3D基准测试软件San-Angeles能达到60FPS的帧率.相比于已有方案,本方案的架构更加简洁高效,且支持硬件加速.
This paper presents a method to transplant Android's graphic system, SurfaceFlinger, to run on desktop Linux distribution's X Window System. SurfaceFlinger running on X can make UI of the Android applications, running as native processes in the desktop Android runtime, show in a window of X. Using Mesa as the Open GL ES implementation and making Mesa EGL compatible with Android's native window, together with gralloc.drm.so module, the Android UI rendering process and SurfaceFlinger's graphic compositing process can be implemented by using the GPU for hardware acceleration. In addition, using X11's DRI2 extension to coordinate window of SurfaceFlinger with X Server's DDX driver, can avoid graphic buffer coping from GPU's dedicated memory to the system memory. In our experiment, the third-party 3D benchmark software San-Angeles can achieve 60 FPS on variety GPUs. Compared with the existing method, the architecture of our method is more concise, efficient, and supportive of hardware acceleration.
作者
江帆
贺也平
周启明
JIANG Fan HE Ye-Ping ZHOU Qi-Ming(National Engineering Research Center of Fundamental Software, Institue of Sofware, Chinese Academy of Sciences, Beijing 100190, China)
出处
《计算机系统应用》
2017年第10期95-101,共7页
Computer Systems & Applications
基金
国家科技重大专项(2012ZX01039-004)