Skip to content

Commit

Permalink
Minimum tizen shell for x64(pc) (flutter-tizen#125)
Browse files Browse the repository at this point in the history
* Enable x64(pc) build for tizen shell

Signed-off-by: MuHong Byun <[email protected]>

Use enable_desktop_embeddings instead of embedder_for_pc

Signed-off-by: MuHong Byun <[email protected]>

Co-authored-by: Swift Kim <[email protected]>

Add flutter_tizen_engine TC

Signed-off-by: MuHong Byun <[email protected]>

Add basic shell for test

Signed-off-by: MuHong Byun <[email protected]>

Introduce mock_engine for unittest

* copied from linux port ('/shell/platform/linux/testing/mock_engine.cc')

Signed-off-by: MuHong Byun <[email protected]>

Apply review's comment

Signed-off-by: MuHong Byun <[email protected]>

Code clean-up && Apply review's comment

Signed-off-by: MuHong Byun <[email protected]>

Clean up shell/platform/tizen/BUILD.gn

Signed-off-by: MuHong Byun <[email protected]>

Clean up shell/platform/tizen/BUILD.gn flutter-tizen#2

Signed-off-by: MuHong Byun <[email protected]>

Add EvasGL Helper for x64 shell build

* This file is the same file as Evas_GL_GLES3_Helpers.h in tizen.

Signed-off-by: MuHong Byun <[email protected]>

Fix minor thing

* Change ecore lib path at X64 shell
* Refactor log function dummy
* Apply review's comment

Signed-off-by: MuHong Byun <[email protected]>

* Add stubs for LocalizationChannel and PlatformChannel

* Add SettingsChannel stub

* Remove ExternalTexturePixelGL and ExternalTextureSurfaceGL from destkop shell depdendencies

* Fix minor thing

* Add log stub

Signed-off-by: MuHong Byun <[email protected]>

* Apply review's comment

Signed-off-by: MuHong Byun <[email protected]>

* Apply review's comment flutter-tizen#2

Signed-off-by: MuHong Byun <[email protected]>

Co-authored-by: Swift Kim <[email protected]>
  • Loading branch information
bwikbs and swift-kim committed Nov 14, 2021
1 parent 420d970 commit ff9c421
Show file tree
Hide file tree
Showing 23 changed files with 1,610 additions and 70 deletions.
5 changes: 5 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import("//flutter/common/config.gni")
import("//flutter/shell/platform/config.gni")
import("//flutter/shell/platform/glfw/config.gni")
import("//flutter/shell/platform/tizen/config.gni")
import("//flutter/testing/testing.gni")
import("//third_party/dart/build/dart/copy_tree.gni")

Expand Down Expand Up @@ -192,6 +193,10 @@ group("flutter") {
public_deps +=
[ "//flutter/shell/platform/glfw:flutter_glfw_unittests" ]
}
if (build_tizen_shell) {
public_deps +=
[ "//flutter/shell/platform/tizen:flutter_tizen_unittests" ]
}
}

if (is_mac) {
Expand Down
5 changes: 2 additions & 3 deletions shell/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ group("platform") {
deps = [ "android" ]
} else if (is_linux) {
deps = []
if (enable_desktop_embeddings) {
deps += [ "linux" ]
}
if (build_tizen_shell) {
deps += [ "tizen" ]
} else if (enable_desktop_embeddings) {
deps += [ "linux" ]
}
} else if (is_win) {
deps = []
Expand Down
2 changes: 2 additions & 0 deletions shell/platform/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# found in the LICENSE file.

import("//flutter/common/config.gni")
import("//flutter/shell/platform/config.gni")
import("//flutter/shell/platform/tizen/config.gni")
import("//flutter/testing/testing.gni")

Expand Down Expand Up @@ -182,6 +183,7 @@ if (enable_unittests) {
":common_cpp_switches",
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/testing",
]

Expand Down
261 changes: 197 additions & 64 deletions shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# found in the LICENSE file.

import("//flutter/shell/platform/common/client_wrapper/publish.gni")
import("//flutter/shell/platform/config.gni")
import("//flutter/shell/platform/tizen/config.gni")
import("//flutter/testing/testing.gni")

# Sets the rpath of dependent targets (shared libs) to $ORIGIN.
# We assume that the flutter_engine library exists next to the embedder library
Expand All @@ -24,6 +26,29 @@ source_set("flutter_engine") {
deps = [ "//flutter/shell/platform/embedder:flutter_engine" ]
}

_flutter_tizen_source = [
"channels/key_event_channel.cc",
"channels/lifecycle_channel.cc",
"channels/navigation_channel.cc",
"channels/platform_view_channel.cc",
"channels/text_input_channel.cc",
"flutter_tizen.cc",
"flutter_tizen_engine.cc",
"flutter_tizen_texture_registrar.cc",
"key_event_handler.cc",
"tizen_event_loop.cc",
"tizen_renderer.cc",
"touch_event_handler.cc",
]

_libs_minimum = [
"ecore",
"ecore_imf",
"ecore_input",
"eina",
"wayland-client",
]

_public_headers = [
"public/flutter_platform_view.h",
"public/flutter_tizen.h",
Expand All @@ -33,42 +58,54 @@ _public_headers = [
# added to the compiler's search paths. Since we are not using the Tizen CLI
# builder, we have to add them manually.
config("tizen_rootstrap_include_dirs") {
local_prefix = "$custom_sysroot/usr"

if (enable_desktop_embeddings && target_cpu == "x64") {
defines = [ "__X64_SHELL__" ]
local_prefix += "/local"
}

include_dirs = [
"$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-imf-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/feedback",
"$custom_sysroot/usr/include/system",
"$custom_sysroot/usr/include/wayland-extension",
local_prefix + "/include",
local_prefix + "/include/appfw",
local_prefix + "/include/base",
local_prefix + "/include/dlog",
local_prefix + "/include/ecore-1",
local_prefix + "/include/ecore-imf-1",
local_prefix + "/include/ecore-input-1",
local_prefix + "/include/ecore-wayland-1",
local_prefix + "/include/ecore-wl2-1",
local_prefix + "/include/efl-1",
local_prefix + "/include/eina-1",
local_prefix + "/include/eina-1/eina",
local_prefix + "/include/emile-1",
local_prefix + "/include/eo-1",
local_prefix + "/include/feedback",
local_prefix + "/include/system",
local_prefix + "/include/wayland-extension",
]

# Contain headers that the Evas_GL renderer depends on.
include_dirs += [
"$custom_sysroot/usr/include/ecore-con-1",
"$custom_sysroot/usr/include/ecore-evas-1",
"$custom_sysroot/usr/include/ecore-file-1",
"$custom_sysroot/usr/include/edje-1",
"$custom_sysroot/usr/include/eet-1",
"$custom_sysroot/usr/include/efl-1/interfaces",
"$custom_sysroot/usr/include/efreet-1",
"$custom_sysroot/usr/include/elementary-1",
"$custom_sysroot/usr/include/ethumb-1",
"$custom_sysroot/usr/include/ethumb-client-1",
"$custom_sysroot/usr/include/evas-1",
local_prefix + "/include/ecore-con-1",
local_prefix + "/include/ecore-evas-1",
local_prefix + "/include/ecore-file-1",
local_prefix + "/include/edje-1",
local_prefix + "/include/eet-1",
local_prefix + "/include/efl-1/interfaces",
local_prefix + "/include/efreet-1",
local_prefix + "/include/elementary-1",
local_prefix + "/include/ethumb-1",
local_prefix + "/include/ethumb-client-1",
local_prefix + "/include/evas-1",
]

lib_dirs = [ "$custom_sysroot/usr/lib" ]
if (enable_desktop_embeddings && target_cpu == "x64") {
include_dirs += [ local_prefix + "/include/eldbus-1" ]
lib_dirs = [ local_prefix + "/lib/x86_64-linux-gnu" ]
} else {
lib_dirs = [ local_prefix + "/lib" ]
}
}

# Template for the embedder build. Used to generate embedders for different
Expand All @@ -86,48 +123,37 @@ template("embedder_for_profile") {
shared_library("flutter_tizen_${target_name}") {
public = _public_headers

sources = [
"channels/key_event_channel.cc",
"channels/lifecycle_channel.cc",
sources = _flutter_tizen_source
sources += [
"channels/localization_channel.cc",
"channels/navigation_channel.cc",
"channels/platform_channel.cc",
"channels/platform_view_channel.cc",
"channels/settings_channel.cc",
"channels/text_input_channel.cc",
"external_texture_pixel_gl.cc",
"external_texture_surface_gl.cc",
"flutter_tizen.cc",
"flutter_tizen_engine.cc",
"flutter_tizen_texture_registrar.cc",
"key_event_handler.cc",
"tizen_event_loop.cc",
"tizen_log.cc",
"tizen_renderer.cc",
"touch_event_handler.cc",
]

libs = [
"base-utils-i18n",
"capi-appfw-application",
"capi-base-common",
"capi-system-system-settings",
"dlog",
"ecore",
"ecore_imf",
"ecore_input",
"eina",
"EGL",
"feedback",
"GLESv2",
"tbm",
"tdm-client",
"wayland-client",
]
libs = _libs_minimum

if (!enable_desktop_embeddings) {
libs += [
"base-utils-i18n",
"capi-appfw-application",
"capi-base-common",
"capi-system-info",
"capi-system-system-settings",
"dlog",
"feedback",
"tbm",
"tdm-client",
"EGL",
"GLESv2",
]
}

defines = invoker.defines

if (use_evas_gl_renderer) {
if (use_evas_gl_renderer || enable_desktop_embeddings) {
sources += [ "tizen_renderer_evas_gl.cc" ]

libs += [
Expand Down Expand Up @@ -167,6 +193,11 @@ template("embedder_for_profile") {
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//third_party/rapidjson",
]

if (enable_desktop_embeddings) {
deps +=
[ "//flutter/shell/platform/embedder:embedder_as_internal_library" ]
}
}
}

Expand All @@ -188,6 +219,102 @@ embedder_for_profile("common") {
defines = [ "COMMON_PROFILE" ]
}

test_fixtures("flutter_tizen_fixtures") {
fixtures = []
}

template("embedder_executable") {
forward_variables_from(invoker, [ "unit_test" ])

if (!defined(unit_test)) {
unit_test = false
}

executable("${target_name}") {
if (unit_test) {
testonly = true
}

public = _public_headers

sources = _flutter_tizen_source
sources += [
"channels/localization_channel_stub.cc",
"channels/platform_channel_stub.cc",
"channels/settings_channel_stub.cc",
"tizen_log_stub.cc",
"tizen_renderer_evas_gl.cc",
]

if (defined(invoker.sources)) {
sources += invoker.sources
}

libs = _libs_minimum

libs += [
"ecore_evas",
"elementary",
"evas",
]

defines = [ "TIZEN_RENDERER_EVAS_GL" ]

cflags_cc = [
"-Wno-newline-eof",
"-Wno-macro-redefined",
]

public_configs = [ "//flutter:config" ]

configs += [
":tizen_rootstrap_include_dirs",
"//flutter/shell/platform/common:desktop_library_implementation",
]

deps = [
"//flutter/runtime:libdart",
"//flutter/shell/platform/common:common_cpp",
"//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 (defined(invoker.deps)) {
deps += invoker.deps
}

if (defined(invoker.public_deps)) {
public_deps = invoker.public_deps
}
}
}

embedder_executable("flutter_tizen_unittests") {
unit_test = true

sources = [
"flutter_tizen_engine_unittest.cc",
"testing/mock_engine.cc",
]

public_deps = [ "//third_party/googletest:gtest" ]

deps = [
":flutter_tizen_fixtures",
"//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/testing",
]
}

embedder_executable("flutter_tizen_shell") {
sources = [ "flutter_tizen_shell.cc" ]

public_deps = [ ":flutter_engine" ]
}

publish_client_wrapper_core("publish_cpp_client_wrapper") {
visibility = [ ":*" ]
}
Expand Down Expand Up @@ -216,11 +343,17 @@ copy("copy_icu") {
group("tizen") {
deps = [
":copy_icu",
":flutter_tizen_common",
":flutter_tizen_mobile",
":flutter_tizen_tv",
":flutter_tizen_wearable",
":publish_cpp_client_wrapper",
":publish_headers_tizen",
]
if (enable_desktop_embeddings) {
deps += [ ":flutter_tizen_shell" ]
} else {
deps += [
":flutter_tizen_common",
":flutter_tizen_mobile",
":flutter_tizen_tv",
":flutter_tizen_wearable",
]
}
}
1 change: 1 addition & 0 deletions shell/platform/tizen/channels/localization_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "localization_channel.h"

#include <utils_i18n.h>

#include <vector>

#include "flutter/shell/platform/tizen/flutter_tizen_engine.h"
Expand Down
Loading

0 comments on commit ff9c421

Please sign in to comment.