Skip to content

Commit c112f7e

Browse files
committed
Enable x64(pc) build for tizen shell
Signed-off-by: MuHong Byun <[email protected]>
1 parent 399c885 commit c112f7e

19 files changed

+302
-58
lines changed

shell/platform/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ group("platform") {
1313
deps = [ "android" ]
1414
} else if (is_linux) {
1515
deps = []
16-
if (enable_desktop_embeddings) {
16+
if (enable_desktop_embeddings && !embedder_for_pc) {
1717
deps += [ "linux" ]
1818
}
1919
if (build_tizen_shell) {

shell/platform/common/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ source_set("common_cpp") {
113113
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
114114
]
115115

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

shell/platform/tizen/BUILD.gn

+82-54
Original file line numberDiff line numberDiff line change
@@ -33,41 +33,47 @@ _public_headers = [
3333
# added to the compiler's search paths. Since we are not using the Tizen CLI
3434
# builder, we have to add them manually.
3535
config("tizen_rootstrap_include_dirs") {
36-
include_dirs = [
37-
"$custom_sysroot/usr/include",
38-
"$custom_sysroot/usr/include/appfw",
39-
"$custom_sysroot/usr/include/base",
40-
"$custom_sysroot/usr/include/dlog",
41-
"$custom_sysroot/usr/include/ecore-1",
42-
"$custom_sysroot/usr/include/ecore-evas-1",
43-
"$custom_sysroot/usr/include/ecore-imf-1",
44-
"$custom_sysroot/usr/include/ecore-imf-evas-1",
45-
"$custom_sysroot/usr/include/ecore-input-1",
46-
"$custom_sysroot/usr/include/ecore-wayland-1",
47-
"$custom_sysroot/usr/include/ecore-wl2-1",
48-
"$custom_sysroot/usr/include/efl-1",
49-
"$custom_sysroot/usr/include/eina-1",
50-
"$custom_sysroot/usr/include/eina-1/eina",
51-
"$custom_sysroot/usr/include/emile-1",
52-
"$custom_sysroot/usr/include/eo-1",
53-
"$custom_sysroot/usr/include/evas-1",
54-
"$custom_sysroot/usr/include/feedback",
55-
"$custom_sysroot/usr/include/system",
56-
"$custom_sysroot/usr/include/wayland-extension",
36+
local_prefix = "$custom_sysroot/usr"
37+
include_dirs = []
38+
if (embedder_for_pc) {
39+
local_prefix = "$custom_sysroot/usr/local"
40+
defines = [ "__X64_SHELL__" ]
41+
include_dirs += [ local_prefix + "/include/eldbus-1" ]
42+
}
43+
include_dirs += [
44+
local_prefix + "/include",
45+
local_prefix + "/include/appfw",
46+
local_prefix + "/include/base",
47+
local_prefix + "/include/dlog",
48+
local_prefix + "/include/ecore-1",
49+
local_prefix + "/include/ecore-evas-1",
50+
local_prefix + "/include/ecore-imf-1",
51+
local_prefix + "/include/ecore-imf-evas-1",
52+
local_prefix + "/include/ecore-input-1",
53+
local_prefix + "/include/ecore-wayland-1",
54+
local_prefix + "/include/ecore-wl2-1",
55+
local_prefix + "/include/efl-1",
56+
local_prefix + "/include/eina-1",
57+
local_prefix + "/include/eina-1/eina",
58+
local_prefix + "/include/emile-1",
59+
local_prefix + "/include/eo-1",
60+
local_prefix + "/include/evas-1",
61+
local_prefix + "/include/feedback",
62+
local_prefix + "/include/system",
63+
local_prefix + "/include/wayland-extension",
5764

5865
# For Evas_GL.
59-
"$custom_sysroot/usr/include/ecore-con-1",
60-
"$custom_sysroot/usr/include/ecore-file-1",
61-
"$custom_sysroot/usr/include/edje-1",
62-
"$custom_sysroot/usr/include/eet-1",
63-
"$custom_sysroot/usr/include/efl-1/interfaces",
64-
"$custom_sysroot/usr/include/efreet-1",
65-
"$custom_sysroot/usr/include/elementary-1",
66-
"$custom_sysroot/usr/include/ethumb-1",
67-
"$custom_sysroot/usr/include/ethumb-client-1",
66+
local_prefix + "/include/ecore-con-1",
67+
local_prefix + "/include/ecore-file-1",
68+
local_prefix + "/include/edje-1",
69+
local_prefix + "/include/eet-1",
70+
local_prefix + "/include/efl-1/interfaces",
71+
local_prefix + "/include/efreet-1",
72+
local_prefix + "/include/elementary-1",
73+
local_prefix + "/include/ethumb-1",
74+
local_prefix + "/include/ethumb-client-1",
6875
]
69-
70-
lib_dirs = [ "$custom_sysroot/usr/lib" ]
76+
lib_dirs = [ local_prefix + "/lib" ]
7177
}
7278

7379
# Template for the embedder build. Used to generate embedders for different
@@ -105,26 +111,38 @@ template("embedder_for_profile") {
105111
"tizen_renderer.cc",
106112
"touch_event_handler.cc",
107113
]
108-
109-
libs = [
110-
"base-utils-i18n",
111-
"capi-appfw-application",
112-
"capi-base-common",
113-
"capi-system-info",
114-
"capi-system-system-settings",
115-
"dlog",
116-
"ecore",
117-
"ecore_imf",
118-
"ecore_input",
119-
"eina",
120-
"evas",
121-
"EGL",
122-
"feedback",
123-
"GLESv2",
124-
"tbm",
125-
"tdm-client",
126-
"wayland-client",
127-
]
114+
if (!embedder_for_pc) {
115+
libs = [
116+
"base-utils-i18n",
117+
"capi-appfw-application",
118+
"capi-base-common",
119+
"capi-system-info",
120+
"capi-system-system-settings",
121+
"dlog",
122+
"ecore",
123+
"ecore_imf",
124+
"ecore_input",
125+
"eina",
126+
"evas",
127+
"EGL",
128+
"feedback",
129+
"GLESv2",
130+
"tbm",
131+
"tdm-client",
132+
"wayland-client",
133+
]
134+
} else {
135+
libs = [
136+
"ecore",
137+
"ecore_imf",
138+
"ecore_input",
139+
"eina",
140+
"evas",
141+
"EGL",
142+
"GLESv2",
143+
"wayland-client",
144+
]
145+
}
128146

129147
defines = invoker.defines
130148

@@ -136,14 +154,24 @@ template("embedder_for_profile") {
136154
"elementary",
137155
]
138156

157+
defines += [ "TIZEN_RENDERER_EVAS_GL" ]
158+
} else if (embedder_for_pc) {
159+
sources += [ "tizen_renderer_evas_gl.cc" ]
160+
161+
libs += [
162+
"ecore_evas",
163+
"elementary",
164+
]
165+
139166
defines += [ "TIZEN_RENDERER_EVAS_GL" ]
140167
} else {
141168
sources += [
142169
"tizen_renderer_ecore_wl2.cc",
143170
"tizen_vsync_waiter.cc",
144171
]
145-
146-
libs += [ "ecore_wl2" ]
172+
if (!embedder_for_pc) {
173+
libs += [ "ecore_wl2" ]
174+
}
147175
}
148176

149177
cflags_cc = [

shell/platform/tizen/channels/localization_channel.cc

+31
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "localization_channel.h"
6+
#ifndef __X64_SHELL__
67

78
#include <utils_i18n.h>
89
#include <vector>
@@ -199,5 +200,35 @@ void LocalizationChannel::DestroyFlutterLocale(FlutterLocale* flutter_locale) {
199200
flutter_locale = nullptr;
200201
}
201202
}
203+
} // namespace flutter
204+
#else
205+
#include <vector>
206+
207+
#include "flutter/shell/platform/tizen/flutter_tizen_engine.h"
208+
#include "flutter/shell/platform/tizen/tizen_log.h"
209+
#include "rapidjson/document.h"
210+
#include "rapidjson/writer.h"
211+
212+
namespace flutter {
213+
LocalizationChannel::LocalizationChannel(FlutterTizenEngine* engine)
214+
: engine_(engine) {
215+
if (!engine_) {
216+
engine_ = nullptr;
217+
}
218+
}
219+
220+
LocalizationChannel::~LocalizationChannel() {}
221+
222+
void LocalizationChannel::SendLocales() {}
223+
224+
void LocalizationChannel::SendPlatformResolvedLocale() {}
225+
226+
FlutterLocale* LocalizationChannel::GetFlutterLocale(const char* locale) {
227+
FlutterLocale* flutter_locale = new FlutterLocale;
228+
flutter_locale->struct_size = sizeof(FlutterLocale);
229+
return flutter_locale;
230+
}
202231

232+
void LocalizationChannel::DestroyFlutterLocale(FlutterLocale* flutter_locale) {}
203233
} // namespace flutter
234+
#endif

shell/platform/tizen/channels/platform_channel.cc

+40
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "platform_channel.h"
6+
#ifndef __X64_SHELL__
67

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

338339
} // namespace flutter
340+
341+
#else
342+
#include <map>
343+
344+
#include "flutter/shell/platform/common/json_method_codec.h"
345+
#include "flutter/shell/platform/tizen/tizen_log.h"
346+
347+
namespace flutter {
348+
349+
namespace {
350+
constexpr char kChannelName[] = "flutter/platform";
351+
}
352+
353+
PlatformChannel::PlatformChannel(BinaryMessenger* messenger,
354+
TizenRenderer* renderer)
355+
: channel_(std::make_unique<MethodChannel<rapidjson::Document>>(
356+
messenger,
357+
kChannelName,
358+
&JsonMethodCodec::GetInstance())),
359+
renderer_(renderer) {
360+
channel_->SetMethodCallHandler(
361+
[this](const MethodCall<rapidjson::Document>& call,
362+
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
363+
HandleMethodCall(call, std::move(result));
364+
});
365+
if (!renderer_) {
366+
renderer_ = nullptr;
367+
}
368+
}
369+
370+
PlatformChannel::~PlatformChannel() {}
371+
372+
void PlatformChannel::HandleMethodCall(
373+
const MethodCall<rapidjson::Document>& call,
374+
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
375+
result->NotImplemented();
376+
}
377+
} // namespace flutter
378+
#endif

shell/platform/tizen/channels/settings_channel.cc

+17
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

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

9+
#ifndef __X64_SHELL__
10+
911
namespace flutter {
1012

1113
namespace {
@@ -54,3 +56,18 @@ void SettingsChannel::OnSettingsChangedCallback(system_settings_key_e key,
5456
}
5557

5658
} // namespace flutter
59+
60+
#else
61+
namespace flutter {
62+
namespace {
63+
constexpr char kChannelName[] = "flutter/settings";
64+
} // namespace
65+
SettingsChannel::SettingsChannel(BinaryMessenger* messenger)
66+
: channel_(std::make_unique<BasicMessageChannel<rapidjson::Document>>(
67+
messenger,
68+
kChannelName,
69+
&JsonMessageCodec::GetInstance())) {}
70+
71+
SettingsChannel::~SettingsChannel() {}
72+
} // namespace flutter
73+
#endif

shell/platform/tizen/channels/settings_channel.h

+22
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef EMBEDDER_SETTINGS_CHANNEL_H_
66
#define EMBEDDER_SETTINGS_CHANNEL_H_
77

8+
#ifndef __X64_SHELL__
9+
810
#include <system/system_settings.h>
911

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

3133
} // namespace flutter
3234

35+
#else
36+
#include <memory>
37+
38+
#include "flutter/shell/platform/common/client_wrapper/include/flutter/basic_message_channel.h"
39+
#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
40+
#include "rapidjson/document.h"
41+
42+
namespace flutter {
43+
44+
class SettingsChannel {
45+
public:
46+
explicit SettingsChannel(BinaryMessenger* messenger);
47+
virtual ~SettingsChannel();
48+
49+
private:
50+
std::unique_ptr<BasicMessageChannel<rapidjson::Document>> channel_;
51+
};
52+
} // namespace flutter
53+
#endif
54+
3355
#endif // EMBEDDER_SETTINGS_CHANNEL_H_

shell/platform/tizen/config.gni

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
declare_args() {
66
# Whether to build the Tizen shell.
77
build_tizen_shell = false
8+
embedder_for_pc = false
89
}

shell/platform/tizen/external_texture_surface_gl.cc

+31
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

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

9+
#ifndef __X64_SHELL__
10+
911
#ifdef TIZEN_RENDERER_EVAS_GL
1012
#undef EFL_BETA_API_SUPPORT
1113
#include <Evas_GL_GLES3_Helpers.h>
@@ -157,3 +159,32 @@ void ExternalTextureSurfaceGL::OnDestruction() {
157159
}
158160

159161
} // namespace flutter
162+
163+
#else
164+
namespace flutter {
165+
ExternalTextureSurfaceGL::ExternalTextureSurfaceGL(
166+
FlutterDesktopGpuBufferTextureCallback texture_callback,
167+
FlutterDesktopGpuBufferDestructionCallback destruction_callback,
168+
void* user_data)
169+
: ExternalTexture(),
170+
texture_callback_(texture_callback),
171+
destruction_callback_(destruction_callback),
172+
user_data_(user_data) {
173+
if (!texture_callback_ && destruction_callback_ && user_data_) {
174+
user_data_ = nullptr;
175+
}
176+
}
177+
178+
ExternalTextureSurfaceGL::~ExternalTextureSurfaceGL() {}
179+
180+
bool ExternalTextureSurfaceGL::PopulateTexture(
181+
size_t width,
182+
size_t height,
183+
FlutterOpenGLTexture* opengl_texture) {
184+
return true;
185+
}
186+
187+
void ExternalTextureSurfaceGL::OnDestruction() {}
188+
} // namespace flutter
189+
190+
#endif

0 commit comments

Comments
 (0)