How do I use Android’s “Surface” classes?

自闭症网瘾萝莉.ら 提交于 2019-12-03 04:23:17

问题


Is there a detailed explanation of Surface, SurfaceHolder, EGLSurface, SurfaceView, GLSurfaceView, SurfaceTexture, and TextureView?  In particular:

  • What’s the difference between SurfaceView and TextureView?
  • Do I need to use GLSurfaceView to use OpenGL ES?
  • How do Surface and EGLSurface interact?
  • What does SurfaceTexture do?
  • Why does the stuff I draw on a SurfaceView have to go above or below everything else?
  • What is SurfaceFlinger?
  • How does composition of the status and navigation bars work?
  • While we’re at it, what’s the right way to structure a game loop on Android?

回答1:


The answers to these and many other questions can now be found on the Android Open Source Project web site:

Android System-Level Graphics

The document begins with an explanation of the low-level infrastructure, and then explains how the higher-level features are built from them. The goal is not to provide direct answers to common questions, but rather to describe the system at a level of detail that makes the answers apparent without being overwhelming.

The choice of material and level of detail were heavy influenced by Q&A on stackoverflow.

(Technically this is a link-only answer, but writing 10,000 words here seemed like a bad idea.)



来源:https://stackoverflow.com/questions/23414776/how-do-i-use-android-s-surface-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!