diff options
author | 2022-09-09 16:31:47 -0600 | |
---|---|---|
committer | 2022-11-14 11:13:41 -0700 | |
commit | 1f0911e6a13ce402c9d9514813b5c7a772735cb4 (patch) | |
tree | d53f95788de4cae2b17104abdc8f2085f62467b0 /libs/gui/SyncFeatures.cpp | |
parent | be0905edb778bbeeed7e264129ea4acdddbe4f20 (diff) |
Add SkiaVk backend to RenderEngine
This CL adds a new backend, SkiaVk, to RenderEngine.
The new functionality is to create a Vulkan device/instance (possibly
protected) and handle flush/waitFence via VkSemaphores fed to
GrBackendSemaphores.
+ make ctors of GLES/Vk RE's private so as to ensure GrContexts are
created
Test: atest librenderengine_test
Bug: 236390072
Change-Id: I69119623b194885bcc4cf2ddc8e592576b713b19
Diffstat (limited to 'libs/gui/SyncFeatures.cpp')
-rw-r--r-- | libs/gui/SyncFeatures.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/gui/SyncFeatures.cpp b/libs/gui/SyncFeatures.cpp index 1a8fc1a00a..2d863c2585 100644 --- a/libs/gui/SyncFeatures.cpp +++ b/libs/gui/SyncFeatures.cpp @@ -36,8 +36,12 @@ SyncFeatures::SyncFeatures() : Singleton<SyncFeatures>(), mHasFenceSync(false), mHasWaitSync(false) { EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); - // This can only be called after EGL has been initialized; otherwise the - // check below will abort. + // eglQueryString can only be called after EGL has been initialized; + // otherwise the check below will abort. If RenderEngine is using SkiaVk, + // EGL will not have been initialized. There's no problem with initializing + // it again here (it is ref counted), and then terminating it later. + EGLBoolean initialized = eglInitialize(dpy, nullptr, nullptr); + LOG_ALWAYS_FATAL_IF(!initialized, "eglInitialize failed"); const char* exts = eglQueryString(dpy, EGL_EXTENSIONS); LOG_ALWAYS_FATAL_IF(exts == nullptr, "eglQueryString failed"); if (strstr(exts, "EGL_ANDROID_native_fence_sync")) { @@ -63,6 +67,8 @@ SyncFeatures::SyncFeatures() : Singleton<SyncFeatures>(), mString.append(" EGL_KHR_wait_sync"); } mString.append("]"); + // Terminate EGL to match the eglInitialize above + eglTerminate(dpy); } bool SyncFeatures::useNativeFenceSync() const { |