Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[webview_flutter_tizen] Change ecore_evas engine for web engine #652

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions packages/webview_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## NEXT

* Change ecore_evas engine for web engine.
* Remove some chromium arguments temporary.

## 0.9.0

* Update webivew_flutter to 4.4.2.
Expand Down
19 changes: 17 additions & 2 deletions packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int view_id,
}));
SetTextureId(texture_registrar_->RegisterTexture(texture_variant_.get()));

InitWebView();
if (!InitWebView()) {
LOG_ERROR("Failed to initialize webview.");
return;
}

webview_channel_ = std::make_unique<FlMethodChannel>(
GetPluginRegistrar()->messenger(), GetWebViewChannelName(),
Expand Down Expand Up @@ -285,10 +288,11 @@ void WebView::SetDirection(int direction) {
// TODO: Implement if necessary.
}

void WebView::InitWebView() {
bool WebView::InitWebView() {
char* chromium_argv[] = {
const_cast<char*>("--disable-pinch"),
const_cast<char*>("--js-flags=--expose-gc"),
const_cast<char*>("--disable-web-security"),
const_cast<char*>("--single-process"),
const_cast<char*>("--no-zygote"),
};
Expand All @@ -298,8 +302,17 @@ void WebView::InitWebView() {

ewk_init();
Ecore_Evas* evas = ecore_evas_new("wayland_egl", 0, 0, 1, 1, 0);
if (!evas) {
LOG_ERROR("Failed to create ecore evas instance.");
return false;
}

webview_instance_ = ewk_view_add(ecore_evas_get(evas));
if (!webview_instance_) {
LOG_ERROR("Failed to create ewk view instance.");
return false;
}

ecore_evas_focus_set(evas, true);
ewk_view_focus_set(webview_instance_, true);
EwkInternalApiBinding::GetInstance().view.OffscreenRenderingEnabledSet(
Expand Down Expand Up @@ -346,6 +359,8 @@ void WebView::InitWebView() {
evas_object_show(webview_instance_);

evas_object_data_set(webview_instance_, kEwkInstance, this);

return true;
}

void WebView::HandleWebViewMethodCall(const FlMethodCall& method_call,
Expand Down
2 changes: 1 addition & 1 deletion packages/webview_flutter/tizen/src/webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class WebView : public PlatformView {
std::string GetWebViewControllerChannelName();
std::string GetNavigationDelegateChannelName();

void InitWebView();
bool InitWebView();

static void OnFrameRendered(void* data, Evas_Object* obj, void* event_info);
static void OnLoadStarted(void* data, Evas_Object* obj, void* event_info);
Expand Down