From 751b29cc3704a7a6a7140c8f2241e6114d8f89c3 Mon Sep 17 00:00:00 2001 From: Hidenori Matsubayashi Date: Mon, 7 Aug 2023 12:02:59 +0000 Subject: [PATCH] cmake: add ENABLE_EGL_ASYNC_BUFFER_SWAPPING option This change adds ENABLE_EGL_ASYNC_BUFFER_SWAPPING not to sync compositor redraw (vblank). Related issue #220 Signed-off-by: Hidenori Matsubayashi --- CMakeLists.txt | 1 + cmake/build.cmake | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 723556b..4e7f069 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ option(USE_DIRTY_REGION_MANAGEMENT "Use Flutter dirty region management" ON) option(USE_GLES3 "Use OpenGL ES3 (default is OpenGL ES2)" OFF) option(ENABLE_EGL_ALPHA_COMPONENT_OF_COLOR_BUFFER "Enable alpha component of the EGL color buffer" ON) option(ENABLE_VSYNC "Enable embedder vsync" ON) +option(ENABLE_EGL_ASYNC_BUFFER_SWAPPING "Do not sync to compositor redraw (eglSwapInterval 0)" OFF) option(BUILD_ELINUX_SO "Build .so file of elinux embedder" OFF) option(ENABLE_ELINUX_EMBEDDER_LOG "Enable logger of eLinux embedder" ON) option(FLUTTER_RELEASE "Build Flutter Engine with release mode" OFF) diff --git a/cmake/build.cmake b/cmake/build.cmake index cde9cc9..56eda14 100644 --- a/cmake/build.cmake +++ b/cmake/build.cmake @@ -118,6 +118,13 @@ if(ENABLE_VSYNC) ) endif() +# Do not sync to compositor redraw (eglSwapInterval 0). +if(ENABLE_EGL_ASYNC_BUFFER_SWAPPING) + add_definitions( + -DENABLE_EGL_ASYNC_BUFFER_SWAPPING + ) +endif() + # Enable alpha component of the egl color buffer. if(ENABLE_EGL_ALPHA_COMPONENT_OF_COLOR_BUFFER) add_definitions(