Skip to content

Commit

Permalink
Enable x64(pc) build for tizen shell
Browse files Browse the repository at this point in the history
Signed-off-by: MuHong Byun <[email protected]>
  • Loading branch information
bwikbs committed Jun 23, 2021
1 parent 399c885 commit 010d27a
Show file tree
Hide file tree
Showing 19 changed files with 301 additions and 58 deletions.
2 changes: 1 addition & 1 deletion shell/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ group("platform") {
deps = [ "android" ]
} else if (is_linux) {
deps = []
if (enable_desktop_embeddings) {
if (enable_desktop_embeddings && !embedder_for_pc) {
deps += [ "linux" ]
}
if (build_tizen_shell) {
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 @@ -113,7 +113,7 @@ source_set("common_cpp") {
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
]

if (!build_tizen_shell) {
if (!build_tizen_shell || embedder_for_pc) {
deps += [ "//flutter/shell/platform/embedder:embedder_as_internal_library" ]
}

Expand Down
135 changes: 81 additions & 54 deletions shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,46 @@ _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") {
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-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/feedback",
"$custom_sysroot/usr/include/system",
"$custom_sysroot/usr/include/wayland-extension",
local_prefix = "$custom_sysroot/usr"
if (embedder_for_pc) {
local_prefix = "$custom_sysroot/usr/local"
defines = [ "__X64_SHELL__" ]
include_dirs = [ local_prefix + "/include/eldbus-1" ]
}
include_dirs += [
local_prefix + "/include",
local_prefix + "/include/appfw",
local_prefix + "/include/base",
local_prefix + "/include/dlog",
local_prefix + "/include/ecore-1",
local_prefix + "/include/ecore-evas-1",
local_prefix + "/include/ecore-imf-1",
local_prefix + "/include/ecore-imf-evas-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/evas-1",
local_prefix + "/include/feedback",
local_prefix + "/include/system",
local_prefix + "/include/wayland-extension",

# For Evas_GL.
"$custom_sysroot/usr/include/ecore-con-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",
local_prefix + "/include/ecore-con-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",
]

lib_dirs = [ "$custom_sysroot/usr/lib" ]
lib_dirs = [ local_prefix + "/lib" ]
}

# Template for the embedder build. Used to generate embedders for different
Expand Down Expand Up @@ -105,26 +110,38 @@ template("embedder_for_profile") {
"tizen_renderer.cc",
"touch_event_handler.cc",
]

libs = [
"base-utils-i18n",
"capi-appfw-application",
"capi-base-common",
"capi-system-info",
"capi-system-system-settings",
"dlog",
"ecore",
"ecore_imf",
"ecore_input",
"eina",
"evas",
"EGL",
"feedback",
"GLESv2",
"tbm",
"tdm-client",
"wayland-client",
]
if (!embedder_for_pc) {
libs = [
"base-utils-i18n",
"capi-appfw-application",
"capi-base-common",
"capi-system-info",
"capi-system-system-settings",
"dlog",
"ecore",
"ecore_imf",
"ecore_input",
"eina",
"evas",
"EGL",
"feedback",
"GLESv2",
"tbm",
"tdm-client",
"wayland-client",
]
} else {
libs = [
"ecore",
"ecore_imf",
"ecore_input",
"eina",
"evas",
"EGL",
"GLESv2",
"wayland-client",
]
}

defines = invoker.defines

Expand All @@ -136,14 +153,24 @@ template("embedder_for_profile") {
"elementary",
]

defines += [ "TIZEN_RENDERER_EVAS_GL" ]
} else if (embedder_for_pc) {
sources += [ "tizen_renderer_evas_gl.cc" ]

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

defines += [ "TIZEN_RENDERER_EVAS_GL" ]
} else {
sources += [
"tizen_renderer_ecore_wl2.cc",
"tizen_vsync_waiter.cc",
]

libs += [ "ecore_wl2" ]
if (!embedder_for_pc) {
libs += [ "ecore_wl2" ]
}
}

cflags_cc = [
Expand Down
31 changes: 31 additions & 0 deletions shell/platform/tizen/channels/localization_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

#include "localization_channel.h"
#ifndef __X64_SHELL__

#include <utils_i18n.h>
#include <vector>
Expand Down Expand Up @@ -199,5 +200,35 @@ void LocalizationChannel::DestroyFlutterLocale(FlutterLocale* flutter_locale) {
flutter_locale = nullptr;
}
}
} // namespace flutter
#else
#include <vector>

#include "flutter/shell/platform/tizen/flutter_tizen_engine.h"
#include "flutter/shell/platform/tizen/tizen_log.h"
#include "rapidjson/document.h"
#include "rapidjson/writer.h"

namespace flutter {
LocalizationChannel::LocalizationChannel(FlutterTizenEngine* engine)
: engine_(engine) {
if (!engine_) {
engine_ = nullptr;
}
}

LocalizationChannel::~LocalizationChannel() {}

void LocalizationChannel::SendLocales() {}

void LocalizationChannel::SendPlatformResolvedLocale() {}

FlutterLocale* LocalizationChannel::GetFlutterLocale(const char* locale) {
FlutterLocale* flutter_locale = new FlutterLocale;
flutter_locale->struct_size = sizeof(FlutterLocale);
return flutter_locale;
}

void LocalizationChannel::DestroyFlutterLocale(FlutterLocale* flutter_locale) {}
} // namespace flutter
#endif
40 changes: 40 additions & 0 deletions shell/platform/tizen/channels/platform_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

#include "platform_channel.h"
#ifndef __X64_SHELL__

#include <app.h>
#include <feedback.h>
Expand Down Expand Up @@ -336,3 +337,42 @@ void SetData(const MethodCall<rapidjson::Document>& call,
} // namespace clipboard

} // namespace flutter

#else
#include <map>

#include "flutter/shell/platform/common/json_method_codec.h"
#include "flutter/shell/platform/tizen/tizen_log.h"

namespace flutter {

namespace {
constexpr char kChannelName[] = "flutter/platform";
}

PlatformChannel::PlatformChannel(BinaryMessenger* messenger,
TizenRenderer* renderer)
: channel_(std::make_unique<MethodChannel<rapidjson::Document>>(
messenger,
kChannelName,
&JsonMethodCodec::GetInstance())),
renderer_(renderer) {
channel_->SetMethodCallHandler(
[this](const MethodCall<rapidjson::Document>& call,
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
HandleMethodCall(call, std::move(result));
});
if (!renderer_) {
renderer_ = nullptr;
}
}

PlatformChannel::~PlatformChannel() {}

void PlatformChannel::HandleMethodCall(
const MethodCall<rapidjson::Document>& call,
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
result->NotImplemented();
}
} // namespace flutter
#endif
17 changes: 17 additions & 0 deletions shell/platform/tizen/channels/settings_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "flutter/shell/platform/common/json_message_codec.h"

#ifndef __X64_SHELL__

namespace flutter {

namespace {
Expand Down Expand Up @@ -54,3 +56,18 @@ void SettingsChannel::OnSettingsChangedCallback(system_settings_key_e key,
}

} // namespace flutter

#else
namespace flutter {
namespace {
constexpr char kChannelName[] = "flutter/settings";
} // namespace
SettingsChannel::SettingsChannel(BinaryMessenger* messenger)
: channel_(std::make_unique<BasicMessageChannel<rapidjson::Document>>(
messenger,
kChannelName,
&JsonMessageCodec::GetInstance())) {}

SettingsChannel::~SettingsChannel() {}
} // namespace flutter
#endif
22 changes: 22 additions & 0 deletions shell/platform/tizen/channels/settings_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef EMBEDDER_SETTINGS_CHANNEL_H_
#define EMBEDDER_SETTINGS_CHANNEL_H_

#ifndef __X64_SHELL__

#include <system/system_settings.h>

#include <memory>
Expand All @@ -30,4 +32,24 @@ class SettingsChannel {

} // namespace flutter

#else
#include <memory>

#include "flutter/shell/platform/common/client_wrapper/include/flutter/basic_message_channel.h"
#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
#include "rapidjson/document.h"

namespace flutter {

class SettingsChannel {
public:
explicit SettingsChannel(BinaryMessenger* messenger);
virtual ~SettingsChannel();

private:
std::unique_ptr<BasicMessageChannel<rapidjson::Document>> channel_;
};
#endif
} // namespace flutter

#endif // EMBEDDER_SETTINGS_CHANNEL_H_
1 change: 1 addition & 0 deletions shell/platform/tizen/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
declare_args() {
# Whether to build the Tizen shell.
build_tizen_shell = false
embedder_for_pc = false
}
31 changes: 31 additions & 0 deletions shell/platform/tizen/external_texture_surface_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "flutter/shell/platform/common/public/flutter_texture_registrar.h"

#ifndef __X64_SHELL__

#ifdef TIZEN_RENDERER_EVAS_GL
#undef EFL_BETA_API_SUPPORT
#include <Evas_GL_GLES3_Helpers.h>
Expand Down Expand Up @@ -157,3 +159,32 @@ void ExternalTextureSurfaceGL::OnDestruction() {
}

} // namespace flutter

#else
namespace flutter {
ExternalTextureSurfaceGL::ExternalTextureSurfaceGL(
FlutterDesktopGpuBufferTextureCallback texture_callback,
FlutterDesktopGpuBufferDestructionCallback destruction_callback,
void* user_data)
: ExternalTexture(),
texture_callback_(texture_callback),
destruction_callback_(destruction_callback),
user_data_(user_data) {
if (!texture_callback_ && destruction_callback_ && user_data_) {
user_data_ = nullptr;
}
}

ExternalTextureSurfaceGL::~ExternalTextureSurfaceGL() {}

bool ExternalTextureSurfaceGL::PopulateTexture(
size_t width,
size_t height,
FlutterOpenGLTexture* opengl_texture) {
return true;
}

void ExternalTextureSurfaceGL::OnDestruction() {}
} // namespace flutter

#endif
Loading

0 comments on commit 010d27a

Please sign in to comment.