Skip to content

Commit 85d450e

Browse files
authored
Support vulkan backend (#110)
1 parent 4b06d21 commit 85d450e

File tree

9 files changed

+1212
-36
lines changed

9 files changed

+1212
-36
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,17 @@ jobs:
7272
- uses: actions/upload-artifact@v4
7373
with:
7474
name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}
75-
path: src/out/build/libflutter_tizen*.so
75+
path: |
76+
src/out/build/libflutter_tizen_common.so
77+
src/out/build/libflutter_tizen_mobile.so
78+
src/out/build/libflutter_tizen_tv.so
79+
if-no-files-found: error
80+
81+
- uses: actions/upload-artifact@v4
82+
with:
83+
name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_experimental
84+
path: |
85+
src/out/build/libflutter_tizen*_experimental.so
7686
if-no-files-found: error
7787

7888
- uses: actions/upload-artifact@v4
@@ -85,7 +95,17 @@ jobs:
8595
if: ${{ github.event_name == 'push' }}
8696
with:
8797
name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_symbols
88-
path: src/out/build/so.unstripped/libflutter_tizen*.so
98+
path: |
99+
src/out/build/so.unstripped/libflutter_tizen_common.so
100+
src/out/build/so.unstripped/libflutter_tizen_mobile.so
101+
src/out/build/so.unstripped/libflutter_tizen_tv.so
102+
if-no-files-found: error
103+
104+
- uses: actions/upload-artifact@v4
105+
if: ${{ github.event_name == 'push' }}
106+
with:
107+
name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_experimental_symbols
108+
path: src/out/build/so.unstripped/libflutter_tizen*_experimental.so
89109
if-no-files-found: error
90110

91111
- uses: actions/upload-artifact@v4

flutter/shell/platform/tizen/BUILD.gn

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ template("embedder") {
140140
"GLESv2",
141141
]
142142

143-
if (target_name == "flutter_tizen_common") {
143+
if (target_name == "flutter_tizen_common" ||
144+
target_name == "flutter_tizen_common_experimental") {
144145
sources += [ "channels/tizen_shell.cc" ]
145146

146147
libs += [
@@ -152,6 +153,14 @@ template("embedder") {
152153
defines += invoker.defines
153154
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]
154155

156+
if (target_name == "flutter_tizen_mobile_experimental" ||
157+
target_name == "flutter_tizen_tv_experimental" ||
158+
target_name == "flutter_tizen_common_experimental") {
159+
defines += [ "FLUTTER_TIZEN_EXPERIMENTAL" ]
160+
sources += [ "tizen_renderer_vulkan.cc" ]
161+
libs += [ "vulkan" ]
162+
}
163+
155164
if (api_version != "6.0") {
156165
sources += [
157166
"flutter_tizen_nui.cc",
@@ -201,18 +210,36 @@ embedder("flutter_tizen_mobile") {
201210
defines = [ "MOBILE_PROFILE" ]
202211
}
203212

213+
embedder("flutter_tizen_mobile_experimental") {
214+
target_type = "shared_library"
215+
216+
defines = [ "MOBILE_PROFILE" ]
217+
}
218+
204219
embedder("flutter_tizen_tv") {
205220
target_type = "shared_library"
206221

207222
defines = [ "TV_PROFILE" ]
208223
}
209224

225+
embedder("flutter_tizen_tv_experimental") {
226+
target_type = "shared_library"
227+
228+
defines = [ "TV_PROFILE" ]
229+
}
230+
210231
embedder("flutter_tizen_common") {
211232
target_type = "shared_library"
212233

213234
defines = [ "COMMON_PROFILE" ]
214235
}
215236

237+
embedder("flutter_tizen_common_experimental") {
238+
target_type = "shared_library"
239+
240+
defines = [ "COMMON_PROFILE" ]
241+
}
242+
216243
embedder("flutter_tizen_source") {
217244
target_type = "source_set"
218245

@@ -257,8 +284,11 @@ copy("publish_headers_tizen") {
257284
group("flutter_tizen") {
258285
deps = [
259286
":flutter_tizen_common",
287+
":flutter_tizen_common_experimental",
260288
":flutter_tizen_mobile",
289+
":flutter_tizen_mobile_experimental",
261290
":flutter_tizen_tv",
291+
":flutter_tizen_tv_experimental",
262292
":publish_cpp_client_wrapper",
263293
":publish_headers_tizen",
264294
]

flutter/shell/platform/tizen/flutter_tizen.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow(
205205
window_geometry, window_properties.transparent,
206206
window_properties.focusable, window_properties.top_level,
207207
window_properties.pointing_device_support,
208-
window_properties.floating_menu_support, window_properties.window_handle);
208+
window_properties.floating_menu_support, window_properties.window_handle,
209+
window_properties.renderer_type == kEVulkan);
209210

210211
auto view = std::make_unique<flutter::FlutterTizenView>(
211212
flutter::kImplicitViewId, std::move(window),

flutter/shell/platform/tizen/flutter_tizen_engine.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
#include "flutter/shell/platform/tizen/tizen_input_method_context.h"
1919
#include "flutter/shell/platform/tizen/tizen_renderer_egl.h"
2020

21+
#ifdef FLUTTER_TIZEN_EXPERIMENTAL
22+
#include "flutter/shell/platform/tizen/tizen_renderer_vulkan.h"
23+
#endif
24+
2125
#ifdef NUI_SUPPORT
2226
#include "flutter/shell/platform/tizen/tizen_renderer_nui_gl.h"
2327
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
@@ -95,6 +99,12 @@ std::unique_ptr<TizenRenderer> FlutterTizenEngine::CreateRenderer(
9599
#endif
96100
return std::make_unique<TizenRendererEgl>(
97101
view_->tizen_view(), project_->HasArgument("--enable-impeller"));
102+
case FlutterDesktopRendererType::kEVulkan:
103+
#ifdef FLUTTER_TIZEN_EXPERIMENTAL
104+
return std::make_unique<TizenRendererVulkan>(view_->tizen_view());
105+
#else
106+
return nullptr;
107+
#endif
98108
}
99109
}
100110

flutter/shell/platform/tizen/public/flutter_tizen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ typedef struct FlutterDesktopView* FlutterDesktopViewRef;
2828
typedef enum {
2929
// The renderer based on EGL.
3030
kEGL,
31+
// The renderer based on Vulkan.
32+
kEVulkan
3133
} FlutterDesktopRendererType;
3234

3335
typedef enum {

0 commit comments

Comments
 (0)