summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2020-06-29 16:54:21 -0700
committer Alec Mouri <alecmouri@google.com> 2020-08-19 22:07:30 +0000
commit665f91bdaac08c19dd154ca35ce17060f088deb9 (patch)
treea585ade2563c8ec673d5f308212ade0bd5efebdc
parent1706f9c22fc66763aba2adeddefdb1ca93772310 (diff)
Correctly expose EGL_ANDROID_native_fence_sync to hwui
When we moved off of gui/SyncFeatures for retrieving this extension, we accidentally didn't include the eglQueryStringImplementationANDROID path for retrieving extensions. Fortunately this extension is only used for TextureView synchronization, but we should still use the extension when available. Bug: 159921224 Bug: 161767307 Test: Manually inject log statements to verify the extension is correctly visible. Change-Id: Idaa872778afc13e86bdea918da8631b4747fe9c1 Merged-In: Idaa872778afc13e86bdea918da8631b4747fe9c1 (cherry picked from commit 49d87e5c077fed85c48341be65e9eaff98654bef)
-rw-r--r--libs/hwui/renderthread/EglManager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index 5e0471c08d67..7982ab664c1b 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -208,8 +208,12 @@ EGLConfig EglManager::loadFP16Config(EGLDisplay display, SwapBehavior swapBehavi
return config;
}
+extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name);
+
void EglManager::initExtensions() {
auto extensions = StringUtils::split(eglQueryString(mEglDisplay, EGL_EXTENSIONS));
+ auto extensionsAndroid =
+ StringUtils::split(eglQueryStringImplementationANDROID(mEglDisplay, EGL_EXTENSIONS));
// For our purposes we don't care if EGL_BUFFER_AGE is a result of
// EGL_EXT_buffer_age or EGL_KHR_partial_update as our usage is covered
@@ -228,9 +232,12 @@ void EglManager::initExtensions() {
EglExtensions.displayP3 = extensions.has("EGL_EXT_gl_colorspace_display_p3_passthrough");
EglExtensions.contextPriority = extensions.has("EGL_IMG_context_priority");
EglExtensions.surfacelessContext = extensions.has("EGL_KHR_surfaceless_context");
- EglExtensions.nativeFenceSync = extensions.has("EGL_ANDROID_native_fence_sync");
EglExtensions.fenceSync = extensions.has("EGL_KHR_fence_sync");
EglExtensions.waitSync = extensions.has("EGL_KHR_wait_sync");
+
+ // EGL_ANDROID_native_fence_sync is not exposed to applications, so access
+ // this through the private Android-specific query instead.
+ EglExtensions.nativeFenceSync = extensionsAndroid.has("EGL_ANDROID_native_fence_sync");
}
bool EglManager::hasEglContext() {