Skip to content
Draft
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
3 changes: 3 additions & 0 deletions build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ declare_args() {

# Use the system libstdc++ without building third_party/libcxx from source.
use_system_cxx = false

# Use tizen-core-wl API instead of ecore.
use_tcore = false
}

_default_configs = [
Expand Down
80 changes: 64 additions & 16 deletions flutter/shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ config("flutter_tizen_config") {
"${sysroot_path}/usr/include/appfw",
"${sysroot_path}/usr/include/base",
"${sysroot_path}/usr/include/dlog",
"${sysroot_path}/usr/include/ecore-1",
"${sysroot_path}/usr/include/ecore-imf-1",
"${sysroot_path}/usr/include/ecore-input-1",
"${sysroot_path}/usr/include/ecore-wayland-1",
"${sysroot_path}/usr/include/ecore-wl2-1",
"${sysroot_path}/usr/include/efl-1",
"${sysroot_path}/usr/include/eina-1",
"${sysroot_path}/usr/include/eina-1/eina",
"${sysroot_path}/usr/include/eo-1",
"${sysroot_path}/usr/include/feedback",
"${sysroot_path}/usr/include/system",
"${sysroot_path}/usr/include/tzsh",
Expand All @@ -32,6 +23,28 @@ config("flutter_tizen_config") {
"${sysroot_path}/usr/lib/glib-2.0/include",
]

# tcore-specific includes
if (use_tcore) {
include_dirs += [
"${sysroot_path}/usr/include/tizen-core",
"${sysroot_path}/usr/include/tizen-core-imf",
"${sysroot_path}/usr/include/tizen-core-wl",
]
} else {
# ecore-specific includes
include_dirs += [
"${sysroot_path}/usr/include/ecore-1",
"${sysroot_path}/usr/include/ecore-imf-1",
"${sysroot_path}/usr/include/ecore-input-1",
"${sysroot_path}/usr/include/ecore-wayland-1",
"${sysroot_path}/usr/include/ecore-wl2-1",
"${sysroot_path}/usr/include/efl-1",
"${sysroot_path}/usr/include/eina-1",
"${sysroot_path}/usr/include/eina-1/eina",
"${sysroot_path}/usr/include/eo-1",
]
}

cflags_cc = [
"-Wno-newline-eof",
"-Wno-macro-redefined",
Expand Down Expand Up @@ -90,14 +103,26 @@ template("embedder") {
"logger.cc",
"system_utils.cc",
"tizen_event_loop.cc",
"tizen_input_method_context.cc",
"tizen_renderer.cc",
"tizen_renderer_egl.cc",
"tizen_renderer_gl.cc",
"tizen_vsync_waiter.cc",
"tizen_window_ecore_wl2.cc",
"tizen_window_util.cc",
]

# Select window implementation based on use_tcore
if (use_tcore) {
sources += [
"tizen_input_method_context_tcore.cc",
"tizen_window_tcore_wl.cc",
]
} else {
sources += [
"tizen_input_method_context.cc",
"tizen_window_ecore_wl2.cc",
]
}

lib_dirs = [ "//engine/${target_cpu}" ]

libs = [
Expand All @@ -110,11 +135,7 @@ template("embedder") {
"capi-system-info",
"capi-system-system-settings",
"dlog",
"ecore",
"ecore_imf",
"ecore_input",
"ecore_wl2",
"eina",
"glib-2.0",
"gio-2.0",
"feedback",
"flutter_engine",
Expand All @@ -127,6 +148,23 @@ template("embedder") {
"GLESv2",
]

# tcore-specific or ecore-specific libraries
if (use_tcore) {
libs += [
"tizen-core",
"tizen-core-imf",
"tizen-core-wl",
]
} else {
libs += [
"ecore",
"ecore_imf",
"ecore_input",
"ecore_wl2",
"eina",
]
}

if (target_name == "flutter_tizen_common" ||
target_name == "flutter_tizen_common_experimental") {
sources += [ "channels/tizen_shell.cc" ]
Expand All @@ -140,6 +178,11 @@ template("embedder") {
defines += invoker.defines
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]

# Add USE_TCORE_WL define when using tcore
if (use_tcore) {
defines += [ "USE_TCORE_WL" ]
}

if (target_name == "flutter_tizen_mobile_experimental" ||
target_name == "flutter_tizen_tv_experimental" ||
target_name == "flutter_tizen_common_experimental") {
Expand Down Expand Up @@ -236,10 +279,15 @@ executable("flutter_tizen_unittests") {
"flutter_tizen_engine_unittest.cc",
"flutter_tizen_texture_registrar_unittests.cc",
"flutter_tizen_view_unittests.cc",
"tizen_event_loop_unittests.cc",
]

ldflags = [ "-Wl,--unresolved-symbols=ignore-in-shared-libs" ]

if (use_tcore) {
defines = [ "USE_TCORE_WL" ]
}

configs += [ ":flutter_tizen_config" ]

deps += [
Expand Down
4 changes: 4 additions & 0 deletions flutter/shell/platform/tizen/channels/input_panel_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
#include "flutter/shell/platform/common/client_wrapper/include/flutter/event_stream_handler_functions.h"
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h"
#include "flutter/shell/platform/tizen/logger.h"
#ifdef USE_TCORE_WL
#include "flutter/shell/platform/tizen/tizen_input_method_context_tcore.h"
#else
#include "flutter/shell/platform/tizen/tizen_input_method_context.h"
#endif

namespace {

Expand Down
2 changes: 1 addition & 1 deletion flutter/shell/platform/tizen/channels/key_mapping.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ std::map<uint32_t, uint32_t> kScanCodeToGtkKeyCode = {
{0x0000024d, 269025069}, // launchScreenSaver
};

std::map<int, int> kEcoreModifierToGtkModifier = {
std::map<int, int> kModifierToGtkModifier = {
{0x0001, 1 << 0}, // SHIFT -> modifierShift
{0x0002, 1 << 2}, // CTRL -> modifierControl
{0x0004, 1 << 3}, // ALT -> modifierMod1
Expand Down
10 changes: 5 additions & 5 deletions flutter/shell/platform/tizen/channels/key_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
// legacy RawKeyboard API is removed from the framework in the future.
extern std::map<uint32_t, uint32_t> kScanCodeToGtkKeyCode;

// Maps Ecore modifiers to GTK modifiers.
// Maps Tizen modifier bitmask values to GTK modifiers.
//
// The values are originally defined in:
// - efl/Ecore_Input.h
// - flutter/raw_keyboard_linux.dart (GtkKeyHelper)
// The modifier bitmask values match tizen_core_wl_modifier_e.
// The GTK modifier values are from flutter/raw_keyboard_linux.dart
// (GtkKeyHelper).
//
// Provided only for backward compatibility. This will be removed after the
// legacy RawKeyboard API is removed from the framework in the future.
extern std::map<int, int> kEcoreModifierToGtkModifier;
extern std::map<int, int> kModifierToGtkModifier;

// Maps XKB scan codes to Flutter's physical key codes.
//
Expand Down
2 changes: 1 addition & 1 deletion flutter/shell/platform/tizen/channels/keyboard_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void KeyboardChannel::SendChannelEvent(const char* key,
}

int gtk_modifiers = 0;
for (auto element : kEcoreModifierToGtkModifier) {
for (auto element : kModifierToGtkModifier) {
if (element.first & modifiers) {
gtk_modifiers |= element.second;
}
Expand Down
4 changes: 4 additions & 0 deletions flutter/shell/platform/tizen/channels/text_input_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
#include "flutter/shell/platform/common/client_wrapper/include/flutter/method_channel.h"
#include "flutter/shell/platform/common/text_input_model.h"
#ifdef USE_TCORE_WL
#include "flutter/shell/platform/tizen/tizen_input_method_context_tcore.h"
#else
#include "flutter/shell/platform/tizen/tizen_input_method_context.h"
#endif
#include "rapidjson/document.h"

namespace flutter {
Expand Down
1 change: 0 additions & 1 deletion flutter/shell/platform/tizen/channels/window_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "flutter/shell/platform/tizen/channels/encodable_value_holder.h"
#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/tizen_window.h"
#include "flutter/shell/platform/tizen/tizen_window_ecore_wl2.h"

namespace flutter {

Expand Down
13 changes: 13 additions & 0 deletions flutter/shell/platform/tizen/flutter_tizen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/public/flutter_platform_view.h"
#include "flutter/shell/platform/tizen/tizen_window.h"
#ifdef USE_TCORE_WL
#include "flutter/shell/platform/tizen/tizen_window_tcore_wl.h"
#else
#include "flutter/shell/platform/tizen/tizen_window_ecore_wl2.h"
#endif

namespace {

Expand Down Expand Up @@ -208,12 +212,21 @@ FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow(

std::unique_ptr<flutter::TizenWindow> window;

#ifdef USE_TCORE_WL
window = std::make_unique<flutter::TizenWindowTcoreWl>(
window_geometry, window_properties.transparent,
window_properties.focusable, window_properties.top_level,
window_properties.pointing_device_support,
window_properties.floating_menu_support, window_properties.window_handle,
window_properties.renderer_type == kEVulkan);
#else
window = std::make_unique<flutter::TizenWindowEcoreWl2>(
window_geometry, window_properties.transparent,
window_properties.focusable, window_properties.top_level,
window_properties.pointing_device_support,
window_properties.floating_menu_support, window_properties.window_handle,
window_properties.renderer_type == kEVulkan);
#endif

auto view = std::make_unique<flutter::FlutterTizenView>(
flutter::kImplicitViewId, std::move(window),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <Ecore.h>
#include <system_info.h>

#include "flutter/shell/platform/tizen/flutter_tizen_display_monitor.h"
Expand All @@ -29,12 +28,7 @@ void FlutterTizenDisplayMonitor::UpdateDisplays() {
display.display_id = 0;
display.single_display = true;

double fps = ecore_animator_frametime_get();
if (fps <= 0.0) {
display.refresh_rate = 0.0;
} else {
display.refresh_rate = 1 / fps;
}
display.refresh_rate = 60.0;

int32_t width = 0, height = 0, dpi = 0;
FlutterTizenView* view = engine_->view();
Expand Down
4 changes: 4 additions & 0 deletions flutter/shell/platform/tizen/flutter_tizen_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
#include "flutter/shell/platform/tizen/flutter_tizen_view.h"
#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/system_utils.h"
#ifdef USE_TCORE_WL
#include "flutter/shell/platform/tizen/tizen_input_method_context_tcore.h"
#else
#include "flutter/shell/platform/tizen/tizen_input_method_context.h"
#endif
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"

#ifdef FLUTTER_TIZEN_EXPERIMENTAL
Expand Down
5 changes: 0 additions & 5 deletions flutter/shell/platform/tizen/flutter_tizen_engine_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "flutter/shell/platform/tizen/flutter_tizen_engine.h"

#include <Ecore.h>

#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"
#include "flutter/shell/platform/tizen/testing/engine_modifier.h"
#include "gtest/gtest.h"
Expand All @@ -14,9 +12,6 @@ namespace flutter {
namespace testing {

class FlutterTizenEngineTest : public ::testing::Test {
public:
FlutterTizenEngineTest() { ecore_init(); }

protected:
void SetUp() {
FlutterDesktopEngineProperties engine_prop = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "flutter/shell/platform/tizen/flutter_tizen_texture_registrar.h"

#include <Ecore.h>

#include <iostream>

#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"
Expand All @@ -17,9 +15,6 @@ namespace flutter {
namespace testing {

class FlutterTizenTextureRegistrarTest : public ::testing::Test {
public:
FlutterTizenTextureRegistrarTest() { ecore_init(); }

protected:
void SetUp() {
FlutterDesktopEngineProperties engine_prop = {};
Expand Down
4 changes: 0 additions & 4 deletions flutter/shell/platform/tizen/flutter_tizen_view_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "flutter/shell/platform/tizen/flutter_tizen_view.h"

#include <Ecore.h>

#include <vector>

#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"
Expand Down Expand Up @@ -47,7 +45,6 @@ class TestTizenView : public TizenWindow {
};

TEST(FlutterTizenViewTest, SendsAndRequestsViewFocus) {
ecore_init();
{
FlutterDesktopEngineProperties properties = {};
properties.assets_path = "/foo/flutter_assets";
Expand Down Expand Up @@ -110,7 +107,6 @@ TEST(FlutterTizenViewTest, SendsAndRequestsViewFocus) {
view.OnFocusChangeRequest(request);
EXPECT_FALSE(tizen_view_ptr->activated);
}
ecore_shutdown();
}

} // namespace
Expand Down
4 changes: 3 additions & 1 deletion flutter/shell/platform/tizen/public/flutter_tizen.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ FLUTTER_EXPORT void FlutterDesktopViewDestroy(FlutterDesktopViewRef view);

// Returns a native UI toolkit handle for manipulation in host application.
//
// Cast the returned void* to Ecore_Wl2_Window*.
// Cast the returned void*:
// - default (ecore_wl2) : to Ecore_Wl2_Window*
// - --use-tcore build : to tizen_core_wl_window_h
// @warning This API is a work-in-progress and may change.
FLUTTER_EXPORT void* FlutterDesktopViewGetNativeHandle(
FlutterDesktopViewRef view);
Expand Down
Loading
Loading