0 前言
本文重点分析HardwareRenderer的实现和应用。
1 类图
2 初始化
HardwareRenderer.GlRenderer.initialize(SurfaceHolder holder)
|-->if (isRequested() && !isEnabled())
| |-->initializeEgl()
| | |-->if (sEgl == null && sEglConfig == null)
| | | |-->sEgl = (EGL10) EGLContext.getEGL()
| | | |
| | | | // Get to the default display.
| | | |-->sEglDisplay = sEgl.eglGetDisplay(EGL_DEFAULT_DISPLAY)
| | | |-->if (sEglDisplay == EGL_NO_DISPLAY)
| | | | |-->throw new RuntimeException("eglGetDisplay failed " + GLUtils.getEGLErrorString(sEgl.eglGetError()));
| | | |
| | | | // We can now initialize EGL for that display
| | | |-->int[] version = new int[2]
| | | |-->if (!sEgl.eglInitialize(sEglDisplay, version))
| | | | |-->throw new RuntimeException("eglInitialize failed " + GLUtils.getEGLErrorString(sEgl.eglGetError()))
| | | |
| | | |-->