From c1640a318901c93e54f64b76102b9cbf706e953c Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 23 Oct 2026 14:50:55 +0900 Subject: [PATCH] Remove dead code and unused dependencies - tizen_renderer_egl.cc: drop the tbm_dummy_display fallback. Its only consumer was the NUI_SUPPORT branch removed in #184. Since then a null display skips eglCreateWindowSurface and fails on EGL_NO_SURFACE anyway, after initializing EGL on a dummy display that was never destroyed. A null display now fails fast with an error log. - tizen_window_tcore_wl.cc: stop fetching and freeing `keyname` in the key-down/key-up handlers; the value was never used. - BUILD.gn: drop the common_cpp_isolate_scope dependency; nothing in the Tizen embedder references IsolateScope. No change to the shared libraries' DT_NEEDED set. Verified with arm64 ecore (all profiles + flutter_tizen_unittests) and arm64 tcore (common, tv) builds. --- flutter/shell/platform/tizen/BUILD.gn | 1 - .../platform/tizen/tizen_renderer_egl.cc | 39 ++++++++----------- .../platform/tizen/tizen_window_tcore_wl.cc | 6 --- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/flutter/shell/platform/tizen/BUILD.gn b/flutter/shell/platform/tizen/BUILD.gn index 53d08a5..3dfd152 100644 --- a/flutter/shell/platform/tizen/BUILD.gn +++ b/flutter/shell/platform/tizen/BUILD.gn @@ -217,7 +217,6 @@ template("embedder") { "//flutter/shell/platform/common:common_cpp", "//flutter/shell/platform/common:common_cpp_accessibility", "//flutter/shell/platform/common:common_cpp_input", - "//flutter/shell/platform/common:common_cpp_isolate_scope", "//flutter/shell/platform/common:common_cpp_library_headers", "//flutter/shell/platform/common/client_wrapper", "//flutter/shell/platform/embedder:embedder_headers", diff --git a/flutter/shell/platform/tizen/tizen_renderer_egl.cc b/flutter/shell/platform/tizen/tizen_renderer_egl.cc index df72243..e70c45d 100644 --- a/flutter/shell/platform/tizen/tizen_renderer_egl.cc +++ b/flutter/shell/platform/tizen/tizen_renderer_egl.cc @@ -12,7 +12,6 @@ #endif #include #include -#include #include "flutter/shell/platform/tizen/external_texture_pixel_egl.h" #include "flutter/shell/platform/tizen/external_texture_surface_egl.h" @@ -49,13 +48,12 @@ bool TizenRendererEgl::CreateSurface(void* render_target, void* render_target_display, int32_t width, int32_t height) { - if (render_target_display) { - egl_display_ = eglGetDisplay( - reinterpret_cast(render_target_display)); - } else { - egl_display_ = eglGetDisplay(tbm_dummy_display_create()); + if (!render_target_display) { + FT_LOG(Error) << "No native display to create an EGL display from."; + return false; } - + egl_display_ = eglGetDisplay( + reinterpret_cast(render_target_display)); if (egl_display_ == EGL_NO_DISPLAY) { PrintEGLError(); FT_LOG(Error) << "Could not get EGL display."; @@ -92,24 +90,21 @@ bool TizenRendererEgl::CreateSurface(void* render_target, { const EGLint attribs[] = {EGL_NONE}; - if (render_target_display) { #ifdef USE_TCORE_WL - tizen_core_wl_native_egl_window_h egl_window = nullptr; - if (tizen_core_wl_egl_window_get_native_egl_window( - static_cast(render_target), - &egl_window) != TIZEN_CORE_WL_ERROR_NONE) { - FT_LOG(Error) << "Could not get the native EGL window."; - return false; - } + tizen_core_wl_native_egl_window_h egl_window = nullptr; + if (tizen_core_wl_egl_window_get_native_egl_window( + static_cast(render_target), + &egl_window) != TIZEN_CORE_WL_ERROR_NONE) { + FT_LOG(Error) << "Could not get the native EGL window."; + return false; + } #else - const auto egl_window = ecore_wl2_egl_window_native_get( - static_cast(render_target)); + const auto egl_window = ecore_wl2_egl_window_native_get( + static_cast(render_target)); #endif - egl_surface_ = eglCreateWindowSurface( - egl_display_, egl_config_, - reinterpret_cast(egl_window), attribs); - } - + egl_surface_ = eglCreateWindowSurface( + egl_display_, egl_config_, + reinterpret_cast(egl_window), attribs); if (egl_surface_ == EGL_NO_SURFACE) { FT_LOG(Error) << "Could not create an onscreen window surface."; return false; diff --git a/flutter/shell/platform/tizen/tizen_window_tcore_wl.cc b/flutter/shell/platform/tizen/tizen_window_tcore_wl.cc index 8adde70..25cd652 100644 --- a/flutter/shell/platform/tizen/tizen_window_tcore_wl.cc +++ b/flutter/shell/platform/tizen/tizen_window_tcore_wl.cc @@ -583,8 +583,6 @@ void TizenWindowTcoreWl::RegisterEventHandlers() { return; } - char* keyname = nullptr; - tizen_core_wl_event_key_get_keyname(ev, &keyname); char* keysymbol = nullptr; tizen_core_wl_event_key_get_keysymbol(ev, &keysymbol); char* compose = nullptr; @@ -620,7 +618,6 @@ void TizenWindowTcoreWl::RegisterEventHandlers() { self->view_delegate_->OnKey(keysymbol, compose, compose, modifiers, keycode, dev_identifier, true); } - free(keyname); free(keysymbol); free(compose); free(dev_identifier); @@ -640,8 +637,6 @@ void TizenWindowTcoreWl::RegisterEventHandlers() { return; } - char* keyname = nullptr; - tizen_core_wl_event_key_get_keyname(ev, &keyname); char* keysymbol = nullptr; tizen_core_wl_event_key_get_keysymbol(ev, &keysymbol); char* compose = nullptr; @@ -666,7 +661,6 @@ void TizenWindowTcoreWl::RegisterEventHandlers() { self->view_delegate_->OnKey(keysymbol, compose, compose, modifiers, keycode, nullptr, false); } - free(keyname); free(keysymbol); free(compose); });