diff options
author | Alec Mouri <alecmouri@google.com> | 2020-06-29 16:54:21 -0700 |
---|---|---|
committer | Ady Abraham <adyabr@google.com> | 2020-11-30 19:21:42 -0800 |
commit | 337b621b36738dd898a9e9b5b3e8027d07bf75d9 (patch) | |
tree | f5010aec822f119efca52dd271fc826b5fb8626f /libs/hwui | |
parent | 040919bef59e999584cea8cac358aee7e0aaa901 (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)
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/renderthread/EglManager.cpp | 9 |
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() { |