Skip to content

Commit

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

Co-authored-by: Xiaowei Guan <xiaowei.guan@samsung.com>
Co-authored-by: MuHong Byun <mh.byun@samsung.com>
Co-authored-by: Boram Bae <boram21.bae@samsung.com>
Co-authored-by: Seungsoo Lee <seungsoo47.lee@samsung.com>
Co-authored-by: Hakkyu Kim <43136596+HakkyuKim@users.noreply.github.com>
  • Loading branch information
6 people committed Feb 7, 2022
1 parent 6b45285 commit ecae61d
Show file tree
Hide file tree
Showing 37 changed files with 1,851 additions and 838 deletions.
135 changes: 135 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Azure Pipelines YAML pipeline.
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema
name: ninja

trigger:
- flutter-*-tizen
pr:
- flutter-*-tizen

jobs:
- job: build
strategy:
matrix:
tizen-arm-release:
arch: arm
mode: release
targetTriple: armv7l-tizen-linux-gnueabi
tizen-arm-profile:
arch: arm
mode: profile
targetTriple: armv7l-tizen-linux-gnueabi
tizen-arm-debug:
arch: arm
mode: debug
targetTriple: armv7l-tizen-linux-gnueabi
tizen-x86-debug:
arch: x86
mode: debug
targetTriple: i586-tizen-linux-gnueabi
pool:
name: Default
demands: agent.os -equals Linux
timeoutInMinutes: 60
cancelTimeoutInMinutes: 1
variables:
- name: buildroot
value: $(Pipeline.Workspace)/src
steps:
- checkout: self
path: src/flutter
- bash: |
git reset --hard HEAD
gclient sync -D
sed -i 's/"-Wno-non-c-typedef-for-linkage",//g' build/config/compiler/BUILD.gn
displayName: Prepare for build
workingDirectory: $(buildroot)
failOnStderr: true
- bash: |
flutter/tools/gn \
--target-os linux \
--linux-cpu $(arch) \
--target-toolchain `pwd`/tizen_tools/toolchains \
--target-sysroot `pwd`/tizen_tools/sysroot/$(arch) \
--target-triple $(targetTriple) \
--runtime-mode $(mode) \
--enable-fontconfig \
--embedder-for-target \
--disable-desktop-embeddings \
--build-tizen-shell \
--out-dir output/default
ninja -C output/default/out/linux_$(mode)_$(arch)
displayName: Build
workingDirectory: $(buildroot)
failOnStderr: true
- bash: |
flutter/tools/gn \
--target-os linux \
--linux-cpu $(arch) \
--target-toolchain `pwd`/tizen_tools/toolchains \
--target-sysroot `pwd`/tizen_tools/sysroot/$(arch)_40 \
--target-triple $(targetTriple) \
--runtime-mode $(mode) \
--enable-fontconfig \
--embedder-for-target \
--disable-desktop-embeddings \
--build-tizen-shell \
--tizen-sdk-4 \
--out-dir output/tizen40
ninja -C output/tizen40/out/linux_$(mode)_$(arch)
displayName: Build for Tizen 4.0
workingDirectory: $(buildroot)
failOnStderr: true
- bash: |
OUTDIR=$(Build.StagingDirectory)
cp default/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR
cp tizen40/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR/libflutter_tizen40.so
cp tizen40/out/linux_$(mode)_$(arch)/libflutter_engine.so $OUTDIR
displayName: Copy artifacts
workingDirectory: $(buildroot)/output
failOnStderr: true
- publish: $(Build.StagingDirectory)
artifact: $(System.JobName)
- job: release
dependsOn: build
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
pool:
name: Default
demands: agent.os -equals Linux
workspace:
clean: outputs
variables:
- name: upstreamVersion
value: 2f0af3715217a0c2ada72c717d4ed9178d68f6ed
steps:
- checkout: self
path: src/flutter
- download: current
- bash: |
mkdir -p common/client_wrapper
ROOT=$(Pipeline.Workspace)/src/flutter/shell/platform
cp $ROOT/common/cpp/client_wrapper/*.{h,cc} common/client_wrapper
rm common/client_wrapper/{*_unittests.*,engine_method_result.cc}
cp -r $ROOT/common/cpp/public common
cp -r $ROOT/common/cpp/client_wrapper/include common/client_wrapper
cp $ROOT/tizen/public/*.h common/public
cp $ROOT/tizen/LICENSE .
displayName: Copy headers
workingDirectory: $(Build.BinariesDirectory)
failOnStderr: true
- bash: |
cp $(Pipeline.Workspace)/src/third_party/icu/flutter/icudtl.dat common
mv $(Pipeline.Workspace)/tizen-* .
for platform in linux windows darwin; do
for mode in release profile; do
curl -o tmp.zip https://storage.googleapis.com/flutter_infra/flutter/$(upstreamVersion)/android-arm-$mode/$platform-x64.zip 2> /dev/null
unzip tmp.zip -d tizen-arm-$mode/$platform-x64 && rm tmp.zip
done
zip -r $(Build.StagingDirectory)/$platform-x64.zip *
rm -r tizen-arm-*/$platform-x64
done
displayName: Create releases
workingDirectory: $(Build.BinariesDirectory)
failOnStderr: true
- publish: $(Build.StagingDirectory)
artifact: release
4 changes: 4 additions & 0 deletions shell/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import("//build/fuchsia/sdk.gni")
import("//flutter/shell/platform/config.gni")
import("//flutter/shell/platform/tizen/config.gni")

group("platform") {
if (is_mac || is_ios) {
Expand All @@ -15,6 +16,9 @@ group("platform") {
if (enable_desktop_embeddings) {
deps += [ "linux" ]
}
if (build_tizen_shell) {
deps += [ "tizen" ]
}
} else if (is_win) {
deps = []
if (enable_desktop_embeddings) {
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ source_set("common_cpp") {
deps = [
":common_cpp_library_headers",
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
# "//flutter/shell/platform/embedder:embedder_as_internal_library",
]

public_deps = [
Expand Down
88 changes: 50 additions & 38 deletions shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/shell/platform/tizen/config.gni")

_public_headers = [ "public/flutter_tizen.h" ]
group("tizen") {
deps = [ ":flutter_tizen_library" ]
}

shared_library("flutter_tizen_library") {
output_name = "flutter_tizen"

ldflags = [ "-Wl,-rpath,\$ORIGIN" ]

deps = [ ":flutter_tizen" ]

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

# The headers are a separate source set since the client wrapper is allowed
# to depend on the public headers, but none of the rest of the code.
source_set("flutter_tizen_headers") {
public = _public_headers
public = [
"public/flutter_platform_view.h",
"public/flutter_texture_registrar.h",
"public/flutter_tizen.h",
]

public_deps =
[ "//flutter/shell/platform/common/cpp:common_cpp_library_headers" ]
Expand All @@ -43,8 +50,7 @@ source_set("flutter_tizen") {
"key_event_handler.cc",
"tizen_embedder_engine.cc",
"tizen_event_loop.cc",
"tizen_surface.cc",
"tizen_surface_gl.cc",
"tizen_renderer.cc",
"tizen_vsync_waiter.cc",
"touch_event_handler.cc",
]
Expand All @@ -57,30 +63,33 @@ source_set("flutter_tizen") {
"//flutter/shell/platform/common/cpp:common_cpp",
"//flutter/shell/platform/common/cpp:common_cpp_input",
"//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:flutter_engine",
"//third_party/rapidjson",
]

include_dirs = [
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/base",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/dlog",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-evas-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-imf-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-imf-evas-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-input-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-wl2-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/efl-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/eina-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/eina-1/eina",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/emile-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/eo-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/evas-1",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/system",
"$custom_sysroot/usr/include",
"$custom_sysroot/usr/include/appfw",
"$custom_sysroot/usr/include/base",
"$custom_sysroot/usr/include/dlog",
"$custom_sysroot/usr/include/ecore-1",
"$custom_sysroot/usr/include/ecore-evas-1",
"$custom_sysroot/usr/include/ecore-imf-1",
"$custom_sysroot/usr/include/ecore-imf-evas-1",
"$custom_sysroot/usr/include/ecore-input-1",
"$custom_sysroot/usr/include/ecore-wayland-1",
"$custom_sysroot/usr/include/ecore-wl2-1",
"$custom_sysroot/usr/include/efl-1",
"$custom_sysroot/usr/include/eina-1",
"$custom_sysroot/usr/include/eina-1/eina",
"$custom_sysroot/usr/include/emile-1",
"$custom_sysroot/usr/include/eo-1",
"$custom_sysroot/usr/include/evas-1",
"$custom_sysroot/usr/include/system",
"$custom_sysroot/usr/include/wayland-extension"
]

lib_dirs = [ "//third_party/tizen_tools/sysroot/$target_cpu/usr/lib" ]
lib_dirs = [ root_out_dir, "$custom_sysroot/usr/lib" ]

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

libs = [
"base-utils-i18n",
"capi-appfw-application",
"capi-system-info",
"capi-system-system-settings",
"dlog",
"ecore",
"ecore_imf",
"ecore_input",
"ecore_wl2",
"eina",
"EGL",
"evas",
"flutter_engine",
"GLESv2",
"tbm",
"tdm-client",
"wayland-client",
]
}

copy("publish_headers_tizen") {
sources = _public_headers
outputs = [ "$root_out_dir/{{source_file_part}}" ]

# The Tizen header assumes the presence of the common headers.
deps = [ "//flutter/shell/platform/common/cpp:publish_headers" ]
if (tizen_sdk_4) {
sources += [ "tizen_renderer_ecore_wl.cc" ]
libs += [ "ecore_wayland", "wayland-egl" ]
defines = [ "FLUTTER_TIZEN_4" ]
} else {
sources += [ "tizen_renderer_ecore_wl2.cc" ]
libs += [ "ecore_wl2" ]
}
}
4 changes: 2 additions & 2 deletions shell/platform/tizen/channels/key_event_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <map>

#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/tizen_log.h"

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

Expand Down Expand Up @@ -221,7 +221,7 @@ KeyEventChannel::KeyEventChannel(flutter::BinaryMessenger* messenger)
KeyEventChannel::~KeyEventChannel() {}

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

int gtk_keycode = 0;
Expand Down
10 changes: 5 additions & 5 deletions shell/platform/tizen/channels/lifecycle_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "lifecycle_channel.h"

#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/tizen_log.h"

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

void LifecycleChannel::AppIsInactive() {
LoggerD("send app lifecycle state inactive.");
FT_LOGD("send app lifecycle state inactive.");
SendLifecycleMessage(kInactive);
}

void LifecycleChannel::AppIsResumed() {
LoggerD("send app lifecycle state resumed.");
FT_LOGD("send app lifecycle state resumed.");
SendLifecycleMessage(kResumed);
}

void LifecycleChannel::AppIsPaused() {
LoggerD("send app lifecycle state paused.");
FT_LOGD("send app lifecycle state paused.");
SendLifecycleMessage(kPaused);
}

void LifecycleChannel::AppIsDetached() {
LoggerD("send app lifecycle state detached.");
FT_LOGD("send app lifecycle state detached.");
SendLifecycleMessage(kDetached);
}
Loading

0 comments on commit ecae61d

Please sign in to comment.