diff options
| author | 2020-01-18 03:52:04 +0000 | |
|---|---|---|
| committer | 2020-01-18 03:52:04 +0000 | |
| commit | 46bb0aec07de33d13c545c39f5e2720450a50731 (patch) | |
| tree | eb9e94f6471687a4b04e74a69e295efc43ef6bca | |
| parent | b8c7368328425733bc4566cb40a0e292641e92bc (diff) | |
| parent | eac35ebc899f61c7737216d1fe4908e164ee2ae5 (diff) | |
Merge "GpuStats: complete the coverage of ES1 usage tracking"
| -rw-r--r-- | opengl/libs/EGL/egl_platform_entries.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/opengl/libs/EGL/egl_platform_entries.cpp b/opengl/libs/EGL/egl_platform_entries.cpp index eefb57412c..c8840f9f19 100644 --- a/opengl/libs/EGL/egl_platform_entries.cpp +++ b/opengl/libs/EGL/egl_platform_entries.cpp @@ -976,22 +976,20 @@ EGLContext eglCreateContextImpl(EGLDisplay dpy, EGLConfig config, dp->disp.dpy, config, share_list, attrib_list); if (context != EGL_NO_CONTEXT) { // figure out if it's a GLESv1 or GLESv2 - int version = 0; + int version = egl_connection_t::GLESv1_INDEX; if (attrib_list) { while (*attrib_list != EGL_NONE) { GLint attr = *attrib_list++; GLint value = *attrib_list++; - if (attr == EGL_CONTEXT_CLIENT_VERSION) { - if (value == 1) { - version = egl_connection_t::GLESv1_INDEX; - android::GraphicsEnv::getInstance().setTargetStats( - android::GpuStatsInfo::Stats::GLES_1_IN_USE); - } else if (value == 2 || value == 3) { - version = egl_connection_t::GLESv2_INDEX; - } + if (attr == EGL_CONTEXT_CLIENT_VERSION && (value == 2 || value == 3)) { + version = egl_connection_t::GLESv2_INDEX; } }; } + if (version == egl_connection_t::GLESv1_INDEX) { + android::GraphicsEnv::getInstance().setTargetStats( + android::GpuStatsInfo::Stats::GLES_1_IN_USE); + } egl_context_t* c = new egl_context_t(dpy, context, config, cnx, version); return c; } |