Skip to content

Commit 3d21ac7

Browse files
authored
Enable Evas GL renderer for all profiles (#312)
For devices other than wearable, we can use either ElmFlutterView or EcoreWl2Window, depending on apps. This commit is to avoid being device dependent. Remove the use_evas_gl_renderer build flag and use the WEARABLE_PROFILE macro if necessary. Before creating the engine, the embedding can select the renderer type in the engine property. At runtime, it selects an appropriate renderer and external texture according to the renderer type and renders to it.
1 parent 06ddbce commit 3d21ac7

33 files changed

+365
-399
lines changed

shell/platform/tizen/BUILD.gn

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,15 @@ config("rootstrap_include_dirs") {
8585
]
8686
}
8787

88-
config("evas_gl_renderer") {
89-
defines = [ "TIZEN_RENDERER_EVAS_GL" ]
90-
}
91-
9288
# Template for the embedder build. Used to generate embedders for different
9389
# device profiles.
9490
#
95-
# If use_evas_gl_renderer is provided as true, the Evas_GL renderer is used,
96-
# otherwise the Ecore_Wl2 renderer is used.
91+
# If the target profile is wearable, only the Evas GL renderer is supported.
92+
# Otherwise, both the Evas GL and EGL renderers are supported.
9793
template("embedder") {
9894
forward_variables_from(invoker,
9995
[
10096
"target_type",
101-
"use_evas_gl_renderer",
10297
"defines",
10398
])
10499

@@ -120,10 +115,10 @@ template("embedder") {
120115
"channels/settings_channel.cc",
121116
"channels/text_input_channel.cc",
122117
"channels/window_channel.cc",
123-
"external_texture_pixel_gl.cc",
124-
"external_texture_surface_gl.cc",
118+
"external_texture_surface_evas_gl.cc",
125119
"flutter_project_bundle.cc",
126120
"flutter_tizen.cc",
121+
"flutter_tizen_elementary.cc",
127122
"flutter_tizen_engine.cc",
128123
"flutter_tizen_texture_registrar.cc",
129124
"flutter_tizen_view.cc",
@@ -132,6 +127,9 @@ template("embedder") {
132127
"tizen_event_loop.cc",
133128
"tizen_input_method_context.cc",
134129
"tizen_renderer.cc",
130+
"tizen_renderer_evas_gl.cc",
131+
"tizen_view_elementary.cc",
132+
"tizen_window_elementary.cc",
135133
]
136134

137135
if (target_name != "flutter_tizen_wearable") {
@@ -152,12 +150,14 @@ template("embedder") {
152150
"capi-ui-efl-util",
153151
"dlog",
154152
"ecore",
153+
"ecore_evas",
155154
"ecore_imf",
156155
"ecore_imf_evas",
157156
"ecore_input",
158157
"efl-extension",
159158
"eina",
160159
"elementary",
160+
"evas",
161161
"feedback",
162162
"tbm",
163163
"tdm-client",
@@ -187,24 +187,9 @@ template("embedder") {
187187
"//flutter:config",
188188
]
189189

190-
if (use_evas_gl_renderer) {
191-
sources += [
192-
"flutter_tizen_elementary.cc",
193-
"tizen_renderer_evas_gl.cc",
194-
"tizen_view_elementary.cc",
195-
"tizen_window_elementary.cc",
196-
]
197-
198-
libs += [
199-
"ecore_evas",
200-
"elementary",
201-
"evas",
202-
]
203-
204-
public_configs += [ ":evas_gl_renderer" ]
205-
} else {
190+
if (target_name != "flutter_tizen_wearable") {
206191
sources += [
207-
"flutter_tizen_ecore.cc",
192+
"external_texture_surface_egl.cc",
208193
"tizen_renderer_egl.cc",
209194
"tizen_vsync_waiter.cc",
210195
"tizen_window_ecore_wl2.cc",
@@ -235,35 +220,30 @@ template("embedder") {
235220

236221
embedder("flutter_tizen_mobile") {
237222
target_type = "shared_library"
238-
use_evas_gl_renderer = false
239223

240224
defines = [ "MOBILE_PROFILE" ]
241225
}
242226

243227
embedder("flutter_tizen_wearable") {
244228
target_type = "shared_library"
245-
use_evas_gl_renderer = true
246229

247230
defines = [ "WEARABLE_PROFILE" ]
248231
}
249232

250233
embedder("flutter_tizen_tv") {
251234
target_type = "shared_library"
252-
use_evas_gl_renderer = false
253235

254236
defines = [ "TV_PROFILE" ]
255237
}
256238

257239
embedder("flutter_tizen_common") {
258240
target_type = "shared_library"
259-
use_evas_gl_renderer = false
260241

261242
defines = [ "COMMON_PROFILE" ]
262243
}
263244

264245
embedder("flutter_tizen_source") {
265246
target_type = "source_set"
266-
use_evas_gl_renderer = false
267247

268248
defines = []
269249
}

shell/platform/tizen/channels/window_channel.cc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ void WindowChannel::HandleMethodCall(
4343
map[EncodableValue("height")] = EncodableValue(geometry.height);
4444
result->Success(EncodableValue(map));
4545
} else if (method_name == "setWindowGeometry") {
46-
#ifdef TIZEN_RENDERER_EVAS_GL
47-
FT_LOG(Error) << "setWindowGeometry is not supported on Evas GL.";
48-
result->NotImplemented();
49-
#else
5046
const auto* arguments = std::get_if<EncodableMap>(method_call.arguments());
5147
if (!arguments) {
5248
result->Error("Invalid arguments");
@@ -58,14 +54,16 @@ void WindowChannel::HandleMethodCall(
5854
EncodableValueHolder<int32_t> height(arguments, "height");
5955

6056
TizenGeometry geometry = window_->GetGeometry();
61-
window_->SetGeometry({
62-
x ? *x : geometry.left,
63-
y ? *y : geometry.top,
64-
width ? *width : geometry.width,
65-
height ? *height : geometry.height,
66-
});
67-
result->Success();
68-
#endif
57+
if (window_->SetGeometry({
58+
x ? *x : geometry.left,
59+
y ? *y : geometry.top,
60+
width ? *width : geometry.width,
61+
height ? *height : geometry.height,
62+
})) {
63+
result->Success();
64+
} else {
65+
result->NotImplemented();
66+
}
6967
} else if (method_name == "getScreenGeometry") {
7068
TizenGeometry geometry = window_->GetScreenGeometry();
7169
EncodableMap map;

shell/platform/tizen/external_texture.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,17 @@
1111
#include "flutter/shell/platform/common/public/flutter_texture_registrar.h"
1212
#include "flutter/shell/platform/embedder/embedder.h"
1313

14-
#ifdef TIZEN_RENDERER_EVAS_GL
15-
#include <Evas_GL.h>
16-
#else
17-
#include <GLES2/gl2.h>
18-
#endif
19-
2014
namespace flutter {
2115

2216
enum class ExternalTextureExtensionType { kNone, kNativeSurface, kDmaBuffer };
2317

2418
struct ExternalTextureGLState {
25-
GLuint gl_texture;
19+
uint32_t gl_texture;
2620
ExternalTextureExtensionType gl_extension;
2721
};
2822

2923
static std::atomic_long next_texture_id = {1};
3024

31-
// An adaptation class of flutter engine and external texture interface.
3225
class ExternalTexture {
3326
public:
3427
ExternalTexture(ExternalTextureExtensionType gl_extension =

shell/platform/tizen/external_texture_pixel_gl.cc

Lines changed: 0 additions & 77 deletions
This file was deleted.

shell/platform/tizen/external_texture_pixel_gl.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)