Loading libs/gui/SyncFeatures.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -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")) { Loading @@ -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 { Loading libs/renderengine/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ cc_defaults { "libsync", "libui", "libutils", "libvulkan", ], static_libs: [ Loading Loading @@ -97,6 +98,7 @@ filegroup { "skia/ColorSpaces.cpp", "skia/SkiaRenderEngine.cpp", "skia/SkiaGLRenderEngine.cpp", "skia/SkiaVkRenderEngine.cpp", "skia/debug/CaptureTimer.cpp", "skia/debug/CommonPool.cpp", "skia/debug/SkiaCapture.cpp", Loading libs/renderengine/RenderEngine.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "threaded/RenderEngineThreaded.h" #include "skia/SkiaGLRenderEngine.h" #include "skia/SkiaVkRenderEngine.h" namespace android { namespace renderengine { Loading @@ -37,6 +38,9 @@ std::unique_ptr<RenderEngine> RenderEngine::create(const RenderEngineCreationArg case RenderEngineType::SKIA_GL: ALOGD("RenderEngine with SkiaGL Backend"); return renderengine::skia::SkiaGLRenderEngine::create(args); case RenderEngineType::SKIA_VK: ALOGD("RenderEngine with SkiaVK Backend"); return renderengine::skia::SkiaVkRenderEngine::create(args); case RenderEngineType::SKIA_GL_THREADED: { ALOGD("Threaded RenderEngine with SkiaGL Backend"); return renderengine::threaded::RenderEngineThreaded::create( Loading @@ -45,6 +49,13 @@ std::unique_ptr<RenderEngine> RenderEngine::create(const RenderEngineCreationArg }, args.renderEngineType); } case RenderEngineType::SKIA_VK_THREADED: ALOGD("Threaded RenderEngine with SkiaVK Backend"); return renderengine::threaded::RenderEngineThreaded::create( [args]() { return android::renderengine::skia::SkiaVkRenderEngine::create(args); }, args.renderEngineType); case RenderEngineType::GLES: default: ALOGD("RenderEngine with GLES Backend"); Loading libs/renderengine/benchmark/RenderEngineBench.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ std::string RenderEngineTypeName(RenderEngine::RenderEngineType type) { return "skiaglthreaded"; case RenderEngine::RenderEngineType::SKIA_GL: return "skiagl"; case RenderEngine::RenderEngineType::SKIA_VK: return "skiavk"; case RenderEngine::RenderEngineType::SKIA_VK_THREADED: return "skiavkthreaded"; case RenderEngine::RenderEngineType::GLES: case RenderEngine::RenderEngineType::THREADED: LOG_ALWAYS_FATAL("GLESRenderEngine is deprecated - why time it?"); Loading libs/renderengine/include/renderengine/RenderEngine.h +12 −3 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ public: THREADED = 2, SKIA_GL = 3, SKIA_GL_THREADED = 4, SKIA_VK = 5, SKIA_VK_THREADED = 6, }; static std::unique_ptr<RenderEngine> create(const RenderEngineCreationArgs& args); Loading Loading @@ -170,9 +172,16 @@ public: virtual void cleanupPostRender() = 0; virtual void cleanFramebufferCache() = 0; // Returns the priority this context was actually created with. Note: this may not be // the same as specified at context creation time, due to implementation limits on the // number of contexts that can be created at a specific priority level in the system. // Returns the priority this context was actually created with. Note: this // may not be the same as specified at context creation time, due to // implementation limits on the number of contexts that can be created at a // specific priority level in the system. // // This should return a valid EGL context priority enum as described by // https://registry.khronos.org/EGL/extensions/IMG/EGL_IMG_context_priority.txt // or // https://registry.khronos.org/EGL/extensions/NV/EGL_NV_context_priority_realtime.txt virtual int getContextPriority() = 0; // Returns true if blur was requested in the RenderEngineCreationArgs and the implementation Loading Loading
libs/gui/SyncFeatures.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -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")) { Loading @@ -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 { Loading
libs/renderengine/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ cc_defaults { "libsync", "libui", "libutils", "libvulkan", ], static_libs: [ Loading Loading @@ -97,6 +98,7 @@ filegroup { "skia/ColorSpaces.cpp", "skia/SkiaRenderEngine.cpp", "skia/SkiaGLRenderEngine.cpp", "skia/SkiaVkRenderEngine.cpp", "skia/debug/CaptureTimer.cpp", "skia/debug/CommonPool.cpp", "skia/debug/SkiaCapture.cpp", Loading
libs/renderengine/RenderEngine.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "threaded/RenderEngineThreaded.h" #include "skia/SkiaGLRenderEngine.h" #include "skia/SkiaVkRenderEngine.h" namespace android { namespace renderengine { Loading @@ -37,6 +38,9 @@ std::unique_ptr<RenderEngine> RenderEngine::create(const RenderEngineCreationArg case RenderEngineType::SKIA_GL: ALOGD("RenderEngine with SkiaGL Backend"); return renderengine::skia::SkiaGLRenderEngine::create(args); case RenderEngineType::SKIA_VK: ALOGD("RenderEngine with SkiaVK Backend"); return renderengine::skia::SkiaVkRenderEngine::create(args); case RenderEngineType::SKIA_GL_THREADED: { ALOGD("Threaded RenderEngine with SkiaGL Backend"); return renderengine::threaded::RenderEngineThreaded::create( Loading @@ -45,6 +49,13 @@ std::unique_ptr<RenderEngine> RenderEngine::create(const RenderEngineCreationArg }, args.renderEngineType); } case RenderEngineType::SKIA_VK_THREADED: ALOGD("Threaded RenderEngine with SkiaVK Backend"); return renderengine::threaded::RenderEngineThreaded::create( [args]() { return android::renderengine::skia::SkiaVkRenderEngine::create(args); }, args.renderEngineType); case RenderEngineType::GLES: default: ALOGD("RenderEngine with GLES Backend"); Loading
libs/renderengine/benchmark/RenderEngineBench.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ std::string RenderEngineTypeName(RenderEngine::RenderEngineType type) { return "skiaglthreaded"; case RenderEngine::RenderEngineType::SKIA_GL: return "skiagl"; case RenderEngine::RenderEngineType::SKIA_VK: return "skiavk"; case RenderEngine::RenderEngineType::SKIA_VK_THREADED: return "skiavkthreaded"; case RenderEngine::RenderEngineType::GLES: case RenderEngine::RenderEngineType::THREADED: LOG_ALWAYS_FATAL("GLESRenderEngine is deprecated - why time it?"); Loading
libs/renderengine/include/renderengine/RenderEngine.h +12 −3 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ public: THREADED = 2, SKIA_GL = 3, SKIA_GL_THREADED = 4, SKIA_VK = 5, SKIA_VK_THREADED = 6, }; static std::unique_ptr<RenderEngine> create(const RenderEngineCreationArgs& args); Loading Loading @@ -170,9 +172,16 @@ public: virtual void cleanupPostRender() = 0; virtual void cleanFramebufferCache() = 0; // Returns the priority this context was actually created with. Note: this may not be // the same as specified at context creation time, due to implementation limits on the // number of contexts that can be created at a specific priority level in the system. // Returns the priority this context was actually created with. Note: this // may not be the same as specified at context creation time, due to // implementation limits on the number of contexts that can be created at a // specific priority level in the system. // // This should return a valid EGL context priority enum as described by // https://registry.khronos.org/EGL/extensions/IMG/EGL_IMG_context_priority.txt // or // https://registry.khronos.org/EGL/extensions/NV/EGL_NV_context_priority_realtime.txt virtual int getContextPriority() = 0; // Returns true if blur was requested in the RenderEngineCreationArgs and the implementation Loading