| 217 | } |
| 218 | |
| 219 | bool EGLInfo::createWindowSurface(ANativeWindow* window) { |
| 220 | // EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is |
| 221 | // guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). |
| 222 | // As soon as we picked a EGLConfig, we can safely reconfigure the |
| 223 | // ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. |
| 224 | EGLint format; |
| 225 | if (!eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format)) { |
| 226 | EGLLOGE("Fatal error! Failed to get config format!"); |
| 227 | return false; |
| 228 | } |
| 229 | |
| 230 | ANativeWindow_setBuffersGeometry(window, 0, 0, format); |
| 231 | m_surface = eglCreateWindowSurface(m_display, m_config, window, NULL); |
| 232 | |
| 233 | return m_surface != NULL; |
| 234 | } |
| 235 | |
| 236 | EGLInfo::EGLInfo() { |
| 237 | m_display = EGL_NO_DISPLAY; |
nothing calls this directly
no outgoing calls
no test coverage detected