summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/EglManager.cpp
diff options
context:
space:
mode:
authorAlec Mouri <alecmouri@google.com>2020-06-29 16:54:21 -0700
committerAlec Mouri <alecmouri@google.com>2020-08-27 22:02:27 +0000
commitc1942afbff65a606d2adb7f8df8491b73c373ad6 (patch)
tree499a5b97cb61baa5f28070b404de47774131024f /libs/hwui/renderthread/EglManager.cpp
parent704c2bb2414ea39ddbf4656ba35b311963b01f11 (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 Test: Manually inject log statements to verify the extension is correctly visible. Change-Id: Idaa872778afc13e86bdea918da8631b4747fe9c1 (cherry picked from commit 49d87e5c077fed85c48341be65e9eaff98654bef) Merged-In: Idaa872778afc13e86bdea918da8631b4747fe9c1
Diffstat (limited to 'libs/hwui/renderthread/EglManager.cpp')
-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() {