Skip to content

Commit b2c0685

Browse files
swift-kimxiaowei-guanbwikbsbbrto21seungsoo47
committed
[Tizen] Cherrypicks from flutter-1.22-candidate.12-tizen
* Fix memory corruption issue (flutter-tizen#2) * Exit application method is replaced by 'ui_app_exit' (flutter-tizen#3) * Fix launch failure in sleep mode (flutter-tizen#4) * Fix scorll issue (flutter-tizen#6) * Changed EGL settings to support more Tizen devices (flutter-tizen#5) * Add touch events of platform view channel for tizen (flutter-tizen#8) * Resize egl window when software keyboard is shown (flutter-tizen#7) * Fix texture being not released issue (flutter-tizen#9) * Remove tizen_tools dependency and update BUILD.gn (flutter-tizen#11) * Refactor tizen surface (flutter-tizen#10) * Fix a crash in stop phase of Tizen engine (flutter-tizen#12) * Fix a crash during app shutdown (flutter-tizen#13) * Fix a crash when TizenVsyncWaiter is destroyed. (flutter-tizen#15) * Implement key events for tizen webview (flutter-tizen#14) * Change method name starting with lower case (flutter-tizen#16) * Remove not used code (flutter-tizen#18) * Introduce assertion macros (flutter-tizen#17) * Minor update to Misc (flutter-tizen#19) * Add azure-pipelines.yml (flutter-tizen#20) * Clean-up channel view resource upon exiting app (flutter-tizen#22) * Call a method to set imf_context in platform view channel (flutter-tizen#24) * Support Tizen 4.0 (flutter-tizen#23) * Fix a focused platform view bug (flutter-tizen#27) * Support screen rotations for Tizen 4.0 and Tizen 6.0 (flutter-tizen#28) * Separate the embedder from the engine (flutter-tizen#29) * Add profile build to the CI script (flutter-tizen#30) * Share egl context to egl resource context (flutter-tizen#31) * Implement message queue to handle vblank request (flutter-tizen#32) * Fix a platform view bug (flutter-tizen#33) * Convert timestamp to correct unit (flutter-tizen#35) * Send locales to flutter including default locale (flutter-tizen#38) * Enable FontConfig to improve font fallbacks (flutter-tizen#40) Co-authored-by: Xiaowei Guan <[email protected]> Co-authored-by: MuHong Byun <[email protected]> Co-authored-by: Boram Bae <[email protected]> Co-authored-by: Seungsoo Lee <[email protected]> Co-authored-by: Hakkyu Kim <[email protected]>
1 parent 4951cf8 commit b2c0685

37 files changed

+1851
-838
lines changed

azure-pipelines.yml

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Azure Pipelines YAML pipeline.
2+
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema
3+
name: ninja
4+
5+
trigger:
6+
- flutter-*-tizen
7+
pr:
8+
- flutter-*-tizen
9+
10+
jobs:
11+
- job: build
12+
strategy:
13+
matrix:
14+
tizen-arm-release:
15+
arch: arm
16+
mode: release
17+
targetTriple: armv7l-tizen-linux-gnueabi
18+
tizen-arm-profile:
19+
arch: arm
20+
mode: profile
21+
targetTriple: armv7l-tizen-linux-gnueabi
22+
tizen-arm-debug:
23+
arch: arm
24+
mode: debug
25+
targetTriple: armv7l-tizen-linux-gnueabi
26+
tizen-x86-debug:
27+
arch: x86
28+
mode: debug
29+
targetTriple: i586-tizen-linux-gnueabi
30+
pool:
31+
name: Default
32+
demands: agent.os -equals Linux
33+
timeoutInMinutes: 60
34+
cancelTimeoutInMinutes: 1
35+
variables:
36+
- name: buildroot
37+
value: $(Pipeline.Workspace)/src
38+
steps:
39+
- checkout: self
40+
path: src/flutter
41+
- bash: |
42+
git reset --hard HEAD
43+
gclient sync -D
44+
sed -i 's/"-Wno-non-c-typedef-for-linkage",//g' build/config/compiler/BUILD.gn
45+
displayName: Prepare for build
46+
workingDirectory: $(buildroot)
47+
failOnStderr: true
48+
- bash: |
49+
flutter/tools/gn \
50+
--target-os linux \
51+
--linux-cpu $(arch) \
52+
--target-toolchain `pwd`/tizen_tools/toolchains \
53+
--target-sysroot `pwd`/tizen_tools/sysroot/$(arch) \
54+
--target-triple $(targetTriple) \
55+
--runtime-mode $(mode) \
56+
--enable-fontconfig \
57+
--embedder-for-target \
58+
--disable-desktop-embeddings \
59+
--build-tizen-shell \
60+
--out-dir output/default
61+
ninja -C output/default/out/linux_$(mode)_$(arch)
62+
displayName: Build
63+
workingDirectory: $(buildroot)
64+
failOnStderr: true
65+
- bash: |
66+
flutter/tools/gn \
67+
--target-os linux \
68+
--linux-cpu $(arch) \
69+
--target-toolchain `pwd`/tizen_tools/toolchains \
70+
--target-sysroot `pwd`/tizen_tools/sysroot/$(arch)_40 \
71+
--target-triple $(targetTriple) \
72+
--runtime-mode $(mode) \
73+
--enable-fontconfig \
74+
--embedder-for-target \
75+
--disable-desktop-embeddings \
76+
--build-tizen-shell \
77+
--tizen-sdk-4 \
78+
--out-dir output/tizen40
79+
ninja -C output/tizen40/out/linux_$(mode)_$(arch)
80+
displayName: Build for Tizen 4.0
81+
workingDirectory: $(buildroot)
82+
failOnStderr: true
83+
- bash: |
84+
OUTDIR=$(Build.StagingDirectory)
85+
cp default/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR
86+
cp tizen40/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR/libflutter_tizen40.so
87+
cp tizen40/out/linux_$(mode)_$(arch)/libflutter_engine.so $OUTDIR
88+
displayName: Copy artifacts
89+
workingDirectory: $(buildroot)/output
90+
failOnStderr: true
91+
- publish: $(Build.StagingDirectory)
92+
artifact: $(System.JobName)
93+
- job: release
94+
dependsOn: build
95+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
96+
pool:
97+
name: Default
98+
demands: agent.os -equals Linux
99+
workspace:
100+
clean: outputs
101+
variables:
102+
- name: upstreamVersion
103+
value: 2f0af3715217a0c2ada72c717d4ed9178d68f6ed
104+
steps:
105+
- checkout: self
106+
path: src/flutter
107+
- download: current
108+
- bash: |
109+
mkdir -p common/client_wrapper
110+
ROOT=$(Pipeline.Workspace)/src/flutter/shell/platform
111+
cp $ROOT/common/cpp/client_wrapper/*.{h,cc} common/client_wrapper
112+
rm common/client_wrapper/{*_unittests.*,engine_method_result.cc}
113+
cp -r $ROOT/common/cpp/public common
114+
cp -r $ROOT/common/cpp/client_wrapper/include common/client_wrapper
115+
cp $ROOT/tizen/public/*.h common/public
116+
cp $ROOT/tizen/LICENSE .
117+
displayName: Copy headers
118+
workingDirectory: $(Build.BinariesDirectory)
119+
failOnStderr: true
120+
- bash: |
121+
cp $(Pipeline.Workspace)/src/third_party/icu/flutter/icudtl.dat common
122+
mv $(Pipeline.Workspace)/tizen-* .
123+
for platform in linux windows darwin; do
124+
for mode in release profile; do
125+
curl -o tmp.zip https://storage.googleapis.com/flutter_infra/flutter/$(upstreamVersion)/android-arm-$mode/$platform-x64.zip 2> /dev/null
126+
unzip tmp.zip -d tizen-arm-$mode/$platform-x64 && rm tmp.zip
127+
done
128+
zip -r $(Build.StagingDirectory)/$platform-x64.zip *
129+
rm -r tizen-arm-*/$platform-x64
130+
done
131+
displayName: Create releases
132+
workingDirectory: $(Build.BinariesDirectory)
133+
failOnStderr: true
134+
- publish: $(Build.StagingDirectory)
135+
artifact: release

shell/platform/BUILD.gn

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import("//build/fuchsia/sdk.gni")
66
import("//flutter/shell/platform/config.gni")
7+
import("//flutter/shell/platform/tizen/config.gni")
78

89
group("platform") {
910
if (is_mac || is_ios) {
@@ -15,6 +16,9 @@ group("platform") {
1516
if (enable_desktop_embeddings) {
1617
deps += [ "linux" ]
1718
}
19+
if (build_tizen_shell) {
20+
deps += [ "tizen" ]
21+
}
1822
} else if (is_win) {
1923
deps = []
2024
if (enable_desktop_embeddings) {

shell/platform/common/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ source_set("common_cpp") {
111111
deps = [
112112
":common_cpp_library_headers",
113113
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
114-
"//flutter/shell/platform/embedder:embedder_as_internal_library",
114+
# "//flutter/shell/platform/embedder:embedder_as_internal_library",
115115
]
116116

117117
public_deps = [

shell/platform/tizen/BUILD.gn

+50-38
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,28 @@
22
# Copyright 2013 The Flutter Authors. All rights reserved.
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
5+
import("//flutter/shell/platform/tizen/config.gni")
56

6-
_public_headers = [ "public/flutter_tizen.h" ]
7+
group("tizen") {
8+
deps = [ ":flutter_tizen_library" ]
9+
}
10+
11+
shared_library("flutter_tizen_library") {
12+
output_name = "flutter_tizen"
13+
14+
ldflags = [ "-Wl,-rpath,\$ORIGIN" ]
15+
16+
deps = [ ":flutter_tizen" ]
717

8-
# Any files that are built by clients (client_wrapper code, library headers for
9-
# implementations using this shared code, etc.) include the public headers
10-
# assuming they are in the include path. This configuration should be added to
11-
# any such code that is also built by GN to make the includes work.
12-
config("relative_flutter_tizen_headers") {
13-
include_dirs = [ "public" ]
18+
public_configs = [ "//flutter:config" ]
1419
}
1520

16-
# The headers are a separate source set since the client wrapper is allowed
17-
# to depend on the public headers, but none of the rest of the code.
1821
source_set("flutter_tizen_headers") {
19-
public = _public_headers
22+
public = [
23+
"public/flutter_platform_view.h",
24+
"public/flutter_texture_registrar.h",
25+
"public/flutter_tizen.h",
26+
]
2027

2128
public_deps =
2229
[ "//flutter/shell/platform/common/cpp:common_cpp_library_headers" ]
@@ -43,8 +50,7 @@ source_set("flutter_tizen") {
4350
"key_event_handler.cc",
4451
"tizen_embedder_engine.cc",
4552
"tizen_event_loop.cc",
46-
"tizen_surface.cc",
47-
"tizen_surface_gl.cc",
53+
"tizen_renderer.cc",
4854
"tizen_vsync_waiter.cc",
4955
"touch_event_handler.cc",
5056
]
@@ -57,30 +63,33 @@ source_set("flutter_tizen") {
5763
"//flutter/shell/platform/common/cpp:common_cpp",
5864
"//flutter/shell/platform/common/cpp:common_cpp_input",
5965
"//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper",
60-
"//flutter/shell/platform/embedder:embedder_as_internal_library",
66+
"//flutter/shell/platform/embedder:flutter_engine",
6167
"//third_party/rapidjson",
6268
]
6369

6470
include_dirs = [
65-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include",
66-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/base",
67-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/dlog",
68-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-1",
69-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-evas-1",
70-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-imf-1",
71-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-imf-evas-1",
72-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-input-1",
73-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-wl2-1",
74-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/efl-1",
75-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/eina-1",
76-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/eina-1/eina",
77-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/emile-1",
78-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/eo-1",
79-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/evas-1",
80-
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/system",
71+
"$custom_sysroot/usr/include",
72+
"$custom_sysroot/usr/include/appfw",
73+
"$custom_sysroot/usr/include/base",
74+
"$custom_sysroot/usr/include/dlog",
75+
"$custom_sysroot/usr/include/ecore-1",
76+
"$custom_sysroot/usr/include/ecore-evas-1",
77+
"$custom_sysroot/usr/include/ecore-imf-1",
78+
"$custom_sysroot/usr/include/ecore-imf-evas-1",
79+
"$custom_sysroot/usr/include/ecore-input-1",
80+
"$custom_sysroot/usr/include/ecore-wayland-1",
81+
"$custom_sysroot/usr/include/ecore-wl2-1",
82+
"$custom_sysroot/usr/include/efl-1",
83+
"$custom_sysroot/usr/include/eina-1",
84+
"$custom_sysroot/usr/include/eina-1/eina",
85+
"$custom_sysroot/usr/include/emile-1",
86+
"$custom_sysroot/usr/include/eo-1",
87+
"$custom_sysroot/usr/include/evas-1",
88+
"$custom_sysroot/usr/include/system",
89+
"$custom_sysroot/usr/include/wayland-extension"
8190
]
8291

83-
lib_dirs = [ "//third_party/tizen_tools/sysroot/$target_cpu/usr/lib" ]
92+
lib_dirs = [ root_out_dir, "$custom_sysroot/usr/lib" ]
8493

8594
cflags_cc = [
8695
"-Wno-newline-eof",
@@ -89,26 +98,29 @@ source_set("flutter_tizen") {
8998

9099
libs = [
91100
"base-utils-i18n",
101+
"capi-appfw-application",
92102
"capi-system-info",
93103
"capi-system-system-settings",
94104
"dlog",
95105
"ecore",
96106
"ecore_imf",
97107
"ecore_input",
98-
"ecore_wl2",
108+
"eina",
99109
"EGL",
100110
"evas",
111+
"flutter_engine",
101112
"GLESv2",
102113
"tbm",
103114
"tdm-client",
104115
"wayland-client",
105116
]
106-
}
107-
108-
copy("publish_headers_tizen") {
109-
sources = _public_headers
110-
outputs = [ "$root_out_dir/{{source_file_part}}" ]
111117

112-
# The Tizen header assumes the presence of the common headers.
113-
deps = [ "//flutter/shell/platform/common/cpp:publish_headers" ]
118+
if (tizen_sdk_4) {
119+
sources += [ "tizen_renderer_ecore_wl.cc" ]
120+
libs += [ "ecore_wayland", "wayland-egl" ]
121+
defines = [ "FLUTTER_TIZEN_4" ]
122+
} else {
123+
sources += [ "tizen_renderer_ecore_wl2.cc" ]
124+
libs += [ "ecore_wl2" ]
125+
}
114126
}

shell/platform/tizen/channels/key_event_channel.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <map>
88

9-
#include "flutter/shell/platform/tizen/logger.h"
9+
#include "flutter/shell/platform/tizen/tizen_log.h"
1010

1111
static constexpr char kChannelName[] = "flutter/keyevent";
1212

@@ -221,7 +221,7 @@ KeyEventChannel::KeyEventChannel(flutter::BinaryMessenger* messenger)
221221
KeyEventChannel::~KeyEventChannel() {}
222222

223223
void KeyEventChannel::SendKeyEvent(Ecore_Event_Key* key, bool is_down) {
224-
LoggerD("code: %d, name: %s, mods: %d, type: %s", key->keycode, key->keyname,
224+
FT_LOGD("code: %d, name: %s, mods: %d, type: %s", key->keycode, key->keyname,
225225
key->modifiers, is_down ? kKeyDown : kKeyUp);
226226

227227
int gtk_keycode = 0;

shell/platform/tizen/channels/lifecycle_channel.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "lifecycle_channel.h"
66

7-
#include "flutter/shell/platform/tizen/logger.h"
7+
#include "flutter/shell/platform/tizen/tizen_log.h"
88

99
static constexpr char kChannelName[] = "flutter/lifecycle";
1010
static constexpr char kInactive[] = "AppLifecycleState.inactive";
@@ -29,21 +29,21 @@ void LifecycleChannel::SendLifecycleMessage(const char message[]) {
2929
}
3030

3131
void LifecycleChannel::AppIsInactive() {
32-
LoggerD("send app lifecycle state inactive.");
32+
FT_LOGD("send app lifecycle state inactive.");
3333
SendLifecycleMessage(kInactive);
3434
}
3535

3636
void LifecycleChannel::AppIsResumed() {
37-
LoggerD("send app lifecycle state resumed.");
37+
FT_LOGD("send app lifecycle state resumed.");
3838
SendLifecycleMessage(kResumed);
3939
}
4040

4141
void LifecycleChannel::AppIsPaused() {
42-
LoggerD("send app lifecycle state paused.");
42+
FT_LOGD("send app lifecycle state paused.");
4343
SendLifecycleMessage(kPaused);
4444
}
4545

4646
void LifecycleChannel::AppIsDetached() {
47-
LoggerD("send app lifecycle state detached.");
47+
FT_LOGD("send app lifecycle state detached.");
4848
SendLifecycleMessage(kDetached);
4949
}

0 commit comments

Comments
 (0)