Skip to content

[webview_flutter] Update lightweight web engine binary #246

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

Merged
merged 1 commit into from
Nov 24, 2021
Merged
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: 4 additions & 1 deletion packages/webview_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@
* Update webivew_flutter to 2.1.1

## 0.3.8
* Update webivew_flutter to 2.3.0
* Update webivew_flutter to 2.3.0

## 0.3.9
* Update LWE binary (6bae13cb915bd41c5aac4aaaae72865f20924c03)
2 changes: 1 addition & 1 deletion packages/webview_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_tizen
description: Tizen implementation of the webview plugin
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/webview_flutter
version: 0.3.8
version: 0.3.9

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
22 changes: 18 additions & 4 deletions packages/webview_flutter/tizen/inc/lwe/LWEWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class LWE_EXPORT Settings {
bool NeedsDownloadWebFontsEarly() const;
bool UseHttp2() const;
uint32_t NeedsDownScaleImageResourceLargerThan() const;
bool ScrollbarVisible() const;
bool UseExternalPopup() const;
void SetUserAgentString(const std::string& ua);
void SetCacheMode(int mode);
void SetProxyURL(const std::string& proxyURL);
Expand All @@ -101,6 +103,8 @@ class LWE_EXPORT Settings {
void SetUseHttp2(bool b);
void SetNeedsDownScaleImageResourceLargerThan(
uint32_t demention); // Experimental
void SetScrollbarVisible(bool visible);
void SetUseExternalPopup(bool useExternalPopup);

private:
std::string m_defaultUserAgent;
Expand All @@ -117,6 +121,8 @@ class LWE_EXPORT Settings {
bool m_needsDownloadWebFontsEarly;
bool m_useHttp2; // default value is false
uint32_t m_needsDownScaleImageResourceLargerThan;
bool m_scrollbarVisible;
bool m_useExternalPopup;
};

class LWE_EXPORT ResourceError {
Expand Down Expand Up @@ -149,6 +155,10 @@ class LWE_EXPORT WebContainer {
size_t bufferStride;
};

struct ExternalImageInfo {
void* imageAddress;
};

struct RenderResult {
size_t updatedX;
size_t updatedY;
Expand All @@ -163,6 +173,13 @@ class LWE_EXPORT WebContainer {
void RegisterOnRenderedHandler(
const std::function<void(WebContainer*,
const RenderResult& renderResult)>& cb);

static WebContainer* CreateWithPlatformImage(
unsigned width, unsigned height,
const std::function<ExternalImageInfo(void)>& prepareImageCb,
const std::function<void(WebContainer*, bool needsFlush)>& flushCb,
float devicePixelRatio, const char* defaultFontName, const char* locale,
const char* timezoneID);
// <--- end of function set for render to buffer

// Function set for render with OpenGL
Expand All @@ -174,10 +191,6 @@ class LWE_EXPORT WebContainer {
float devicePixelRatio, const char* defaultFontName, const char* locale,
const char* timezoneID);

struct ExternalImageInfo {
void* imageAddress;
};

static WebContainer* CreateGLWithPlatformImage(
unsigned width, unsigned height,
const std::function<void(WebContainer*)>& onGLMakeCurrent,
Expand All @@ -187,6 +200,7 @@ class LWE_EXPORT WebContainer {
const std::function<void(WebContainer*, bool needsFlush)>& flushCb,
float devicePixelRatio, const char* defaultFontName, const char* locale,
const char* timezoneID);

// <--- end of function set for render with OpenGL

// Function set for headless
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 6 additions & 3 deletions packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ extern "C" size_t LWE_EXPORT createWebViewInstance(
const char* timezoneID,
const std::function<::LWE::WebContainer::ExternalImageInfo(void)>&
prepareImageCb,
const std::function<void(::LWE::WebContainer*, bool isRendered)>&
renderedCb);
const std::function<void(::LWE::WebContainer*, bool needsFlush)>& flushCb,
bool useSWBackend);

template <typename T = flutter::EncodableValue>
class NavigationRequestResult : public flutter::MethodResult<T> {
Expand Down Expand Up @@ -331,6 +331,8 @@ void WebView::ApplySettings(flutter::EncodableMap settings) {
settings.SetUserAgentString(std::get<std::string>(val));
webview_instance_->SetSettings(settings);
}
} else if ("zoomEnabled" == k) {
// NOTE: Not supported by LWE on Tizen.
} else {
throw std::invalid_argument("Unknown WebView setting: " + k);
}
Expand Down Expand Up @@ -788,7 +790,8 @@ void WebView::InitWebView() {
candidate_surface_ = working_surface_;
working_surface_ = nullptr;
}
});
},
false);
#ifndef TV_PROFILE
auto settings = webview_instance_->GetSettings();
settings.SetUserAgentString(
Expand Down