Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change minimum Tizen version 5.5 to 6.0 #66

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
api-version: ['5.5', '6.0', '6.5']
api-version: ['6.0', '6.5']
arch: [arm, arm64, x86]
include:
- arch: arm
Expand Down Expand Up @@ -45,29 +45,19 @@ jobs:

- name: Generate Tizen 6.0 sysroot
if: ${{ matrix.api-version == '6.0' }}
run: src/tools/generate_sysroot.py --api-version 6.0 --out src/sysroot-6.0
run: src/tools/generate_sysroot.py --out src/sysroot-6.0

- name: Generate Tizen 6.5 sysroot
if: ${{ matrix.api-version == '6.5' }}
run: src/tools/generate_sysroot.py --api-version 6.5 --out src/sysroot-6.5

- name: Build for Tizen 5.5
if: ${{ matrix.api-version == '5.5' }}
run: |
src/tools/gn \
--target-cpu ${{ matrix.arch }} \
--target-toolchain /usr/lib/llvm-12 \
--target-dir build
ninja -C src/out/build

- name: Build for Tizen 6.0
if: ${{ matrix.api-version == '6.0' }}
run: |
src/tools/gn \
--target-cpu ${{ matrix.arch }} \
--target-toolchain /usr/lib/llvm-12 \
--target-sysroot src/sysroot-6.0/${{ matrix.arch }} \
--api-version 6.0 --system-cxx \
--target-dir build
ninja -C src/out/build

Expand All @@ -78,7 +68,7 @@ jobs:
--target-cpu ${{ matrix.arch }} \
--target-toolchain /usr/lib/llvm-12 \
--target-sysroot src/sysroot-6.5/${{ matrix.arch }} \
--api-version 6.5 --system-cxx \
--api-version 6.5 \
--target-dir build
ninja -C src/out/build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The Flutter embedder for Tizen.
### Notes

- To build an app (TPK) with the embedder generated in the above, copy the output artifacts (`libflutter_tizen*.so`) into the [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen) tool's cached artifacts directory (`flutter/bin/cache/artifacts/engine`) and run `flutter-tizen run` or `flutter-tizen build tpk`.
- To use the target device's `libstdc++.so` instead of the embedder's built-in libc++ (`third_party/libcxx`), provide the `--system-cxx` option to `tools/gn`. Tizen 5.5's `libstdc++.so` is not compatible with C++17, so you cannot use this option for Tizen 5.5.
- To use the embedder's built-in libc++ (`third_party/libcxx`) instead of the target device's `libstdc++.so`, provide the `--no-system-cxx` option to `tools/gn`.
- Building NUI-related code requires a sysroot for Tizen 6.5 or above and the `--api-version 6.5` option.

## Repository structure
Expand Down
46 changes: 14 additions & 32 deletions flutter/shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ template("embedder") {
public = _public_headers

sources = [
"accessibility_bridge_tizen.cc",
"accessibility_settings.cc",
"channels/accessibility_channel.cc",
"channels/app_control.cc",
Expand All @@ -93,8 +94,11 @@ template("embedder") {
"channels/settings_channel.cc",
"channels/text_input_channel.cc",
"channels/window_channel.cc",
"external_texture_pixel_egl.cc",
"external_texture_pixel_evas_gl.cc",
"external_texture_surface_egl.cc",
"external_texture_surface_evas_gl.cc",
"flutter_platform_node_delegate_tizen.cc",
"flutter_project_bundle.cc",
"flutter_tizen.cc",
"flutter_tizen_elementary.cc",
Expand All @@ -106,8 +110,11 @@ template("embedder") {
"tizen_event_loop.cc",
"tizen_input_method_context.cc",
"tizen_renderer.cc",
"tizen_renderer_egl.cc",
"tizen_renderer_evas_gl.cc",
"tizen_view_elementary.cc",
"tizen_vsync_waiter.cc",
"tizen_window_ecore_wl2.cc",
"tizen_window_elementary.cc",
]

Expand All @@ -128,6 +135,7 @@ template("embedder") {
"ecore_imf",
"ecore_imf_evas",
"ecore_input",
"ecore_wl2",
"efl-extension",
"eina",
"elementary",
Expand All @@ -136,30 +144,14 @@ template("embedder") {
"feedback",
"flutter_engine",
"tbm",
"tdm-client",
"tizen-extension-client",
"vconf",
"wayland-client",
"EGL",
"GLESv2",
]

if (target_name != "flutter_tizen_wearable") {
sources += [
"accessibility_bridge_tizen.cc",
"external_texture_pixel_egl.cc",
"external_texture_surface_egl.cc",
"flutter_platform_node_delegate_tizen.cc",
"tizen_renderer_egl.cc",
"tizen_vsync_waiter.cc",
"tizen_window_ecore_wl2.cc",
]

libs += [
"ecore_wl2",
"tdm-client",
"tizen-extension-client",
"EGL",
"GLESv2",
]
}

if (target_name == "flutter_tizen_common") {
sources += [ "channels/tizen_shell.cc" ]

Expand All @@ -172,7 +164,7 @@ template("embedder") {
defines += invoker.defines
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]

if (api_version == "6.5" && target_name != "flutter_tizen_wearable") {
if (api_version == "6.5") {
sources += [
"flutter_tizen_nui.cc",
"tizen_clipboard.cc",
Expand Down Expand Up @@ -203,16 +195,13 @@ template("embedder") {
deps += [
":dart_api_dl",
"//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_library_headers",
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/embedder:embedder_headers",
"//third_party/rapidjson",
]

if (target_name != "flutter_tizen_wearable") {
deps += [ "//flutter/shell/platform/common:common_cpp_accessibility" ]
}
}
}

Expand All @@ -222,12 +211,6 @@ embedder("flutter_tizen_mobile") {
defines = [ "MOBILE_PROFILE" ]
}

embedder("flutter_tizen_wearable") {
target_type = "shared_library"

defines = [ "WEARABLE_PROFILE" ]
}

embedder("flutter_tizen_tv") {
target_type = "shared_library"

Expand Down Expand Up @@ -286,7 +269,6 @@ group("flutter_tizen") {
":flutter_tizen_common",
":flutter_tizen_mobile",
":flutter_tizen_tv",
":flutter_tizen_wearable",
":publish_cpp_client_wrapper",
":publish_headers_tizen",
]
Expand Down
6 changes: 0 additions & 6 deletions flutter/shell/platform/tizen/accessibility_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace flutter {

AccessibilitySettings::AccessibilitySettings(FlutterTizenEngine* engine)
: engine_(engine) {
#ifndef WEARABLE_PROFILE
bool tts_enabled = false;
int ret = system_settings_get_value_bool(
SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, &tts_enabled);
Expand All @@ -29,7 +28,6 @@ AccessibilitySettings::AccessibilitySettings(FlutterTizenEngine* engine)
}
system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS,
OnScreenReaderStateChanged, this);
#endif

#ifdef TV_PROFILE
int high_contrast = 0;
Expand All @@ -46,9 +44,7 @@ AccessibilitySettings::AccessibilitySettings(FlutterTizenEngine* engine)
}

AccessibilitySettings::~AccessibilitySettings() {
#ifndef WEARABLE_PROFILE
system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS);
#endif
#ifdef TV_PROFILE
system_settings_unset_changed_cb(
SYSTEM_SETTINGS_KEY_ACCESSIBILITY_HIGHCONTRAST);
Expand Down Expand Up @@ -76,7 +72,6 @@ void AccessibilitySettings::OnHighContrastStateChanged(
void AccessibilitySettings::OnScreenReaderStateChanged(
system_settings_key_e key,
void* user_data) {
#ifndef WEARABLE_PROFILE
auto* self = static_cast<AccessibilitySettings*>(user_data);

bool enabled = false;
Expand All @@ -90,7 +85,6 @@ void AccessibilitySettings::OnScreenReaderStateChanged(
self->screen_reader_enabled_ = enabled;
self->engine_->SetSemanticsEnabled(enabled);
}
#endif
}

} // namespace flutter
6 changes: 0 additions & 6 deletions flutter/shell/platform/tizen/flutter_tizen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
#endif
#include "flutter/shell/platform/tizen/tizen_window.h"
#ifndef WEARABLE_PROFILE
#include "flutter/shell/platform/tizen/tizen_window_ecore_wl2.h"
#endif
#include "flutter/shell/platform/tizen/tizen_window_elementary.h"

namespace {
Expand Down Expand Up @@ -209,13 +207,9 @@ FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow(
window_properties.focusable, window_properties.top_level,
window_properties.external_output_type);
} else {
#ifndef WEARABLE_PROFILE
window = std::make_unique<flutter::TizenWindowEcoreWl2>(
window_geometry, window_properties.transparent,
window_properties.focusable, window_properties.top_level);
#else
return nullptr;
#endif
}

auto view = std::make_unique<flutter::FlutterTizenView>(
Expand Down
18 changes: 5 additions & 13 deletions flutter/shell/platform/tizen/flutter_tizen_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
#include <string>
#include <vector>

#ifndef WEARABLE_PROFILE
#include "flutter/shell/platform/tizen/accessibility_bridge_tizen.h"
#include "flutter/shell/platform/tizen/flutter_platform_node_delegate_tizen.h"
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"
#endif
#include "flutter/shell/platform/tizen/flutter_tizen_view.h"
#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/system_utils.h"
#include "flutter/shell/platform/tizen/tizen_input_method_context.h"
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"
#include "flutter/shell/platform/tizen/tizen_renderer_evas_gl.h"

namespace flutter {
Expand Down Expand Up @@ -92,12 +90,9 @@ void FlutterTizenEngine::CreateRenderer(
}
},
renderer_.get());
}
#ifndef WEARABLE_PROFILE
else {
} else {
renderer_ = std::make_unique<TizenRendererEgl>();
}
#endif
}

bool FlutterTizenEngine::RunEngine() {
Expand Down Expand Up @@ -205,7 +200,7 @@ bool FlutterTizenEngine::RunEngine() {
if (!project_->custom_dart_entrypoint().empty()) {
args.custom_dart_entrypoint = project_->custom_dart_entrypoint().c_str();
}
#ifndef WEARABLE_PROFILE

args.update_semantics_callback2 = [](const FlutterSemanticsUpdate2* update,
void* user_data) {
auto* engine = static_cast<FlutterTizenEngine*>(user_data);
Expand All @@ -222,7 +217,6 @@ bool FlutterTizenEngine::RunEngine() {
}
};
}
#endif

FlutterRendererConfig renderer_config = GetRendererConfig();

Expand Down Expand Up @@ -268,14 +262,14 @@ bool FlutterTizenEngine::StopEngine() {
plugin_registrar_destruction_callbacks_) {
callback(registrar);
}
#ifndef WEARABLE_PROFILE

{
std::lock_guard<std::mutex> lock(vsync_mutex_);
if (vsync_waiter_) {
vsync_waiter_.reset();
}
}
#endif

FlutterEngineResult result = embedder_api_.Shutdown(engine_);
view_ = nullptr;
engine_ = nullptr;
Expand Down Expand Up @@ -500,7 +494,6 @@ FlutterRendererConfig FlutterTizenEngine::GetRendererConfig() {
return config;
}

#ifndef WEARABLE_PROFILE
void FlutterTizenEngine::DispatchAccessibilityAction(
uint64_t target,
FlutterSemanticsAction action,
Expand Down Expand Up @@ -552,6 +545,5 @@ void FlutterTizenEngine::OnUpdateSemantics(
geometry.height);
window->SetRootNode(root);
}
#endif

} // namespace flutter
Loading