diff --git a/packages/webview_flutter/tizen/inc/lwe/LWEWebView.h b/packages/webview_flutter/tizen/inc/lwe/LWEWebView.h index 59dc7b954..445d1469a 100644 --- a/packages/webview_flutter/tizen/inc/lwe/LWEWebView.h +++ b/packages/webview_flutter/tizen/inc/lwe/LWEWebView.h @@ -69,6 +69,7 @@ class LWE_EXPORT Settings { void GetBaseForegroundColor(unsigned char& r, unsigned char& g, unsigned char& b, unsigned char& a) const; bool NeedsDownloadWebFontsEarly() const; + uint32_t NeedsDownScaleImageResourceLargerThan() const; void SetUserAgentString(const std::string& ua); void SetCacheMode(int mode); void SetProxyURL(const std::string& proxyURL); @@ -82,6 +83,8 @@ class LWE_EXPORT Settings { void SetIdleModeJob(IdleModeJob j); void SetIdleModeCheckIntervalInMS(uint32_t intervalInMS); void SetNeedsDownloadWebFontsEarly(bool b); + void SetNeedsDownScaleImageResourceLargerThan( + uint32_t demention); // Experimental private: std::string m_defaultUserAgent; @@ -96,6 +99,7 @@ class LWE_EXPORT Settings { IdleModeJob m_idleModeJob; // default value is IdleModeJob::IdleModeFull uint32_t m_idleModeCheckIntervalInMS; // default value is 3000(ms) bool m_needsDownloadWebFontsEarly; + uint32_t m_needsDownScaleImageResourceLargerThan; }; class LWE_EXPORT ResourceError { @@ -353,14 +357,12 @@ class LWE_EXPORT WebView { virtual void Focus(); virtual void Blur(); + virtual WebContainer* FetchWebContainer() = 0; protected: WebView(void* impl) : m_impl(impl) { } - - virtual WebContainer* FetchWebContainer() = 0; - void* m_impl; }; diff --git a/packages/webview_flutter/tizen/lib/libflutter_linux_tizen.so b/packages/webview_flutter/tizen/lib/libflutter_linux_tizen.so new file mode 100644 index 000000000..d9b7ae8ef Binary files /dev/null and b/packages/webview_flutter/tizen/lib/libflutter_linux_tizen.so differ diff --git a/packages/webview_flutter/tizen/lib/liblightweight-web-engine.so b/packages/webview_flutter/tizen/lib/liblightweight-web-engine.so old mode 100644 new mode 100755 index 8057f6168..d23f992ad Binary files a/packages/webview_flutter/tizen/lib/liblightweight-web-engine.so and b/packages/webview_flutter/tizen/lib/liblightweight-web-engine.so differ diff --git a/packages/webview_flutter/tizen/src/webview.cc b/packages/webview_flutter/tizen/src/webview.cc index e28f99b88..1e17f611d 100644 --- a/packages/webview_flutter/tizen/src/webview.cc +++ b/packages/webview_flutter/tizen/src/webview.cc @@ -54,6 +54,7 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId, FlutterTextureRegistrar* textureRegistrar, double width, double height, const std::string initialUrl) : PlatformView(registrar, viewId), + tbmSurface_(nullptr), textureRegistrar_(textureRegistrar), webViewInstance_(nullptr), currentUrl_(initialUrl), @@ -341,7 +342,7 @@ void WebView::DispatchKeyDownEvent(Ecore_Event_Key* keyEvent) { } else { webViewInstance_->AddIdleCallback( [](void* data) { - LWE::WebContainer* self = (LWE::WebContainer*)data; + // LWE::WebContainer* self = (LWE::WebContainer*)data; // self->HideSoftwareKeyboardIfPossible(); }, webViewInstance_); @@ -436,23 +437,22 @@ void WebView::InitWebView() { webViewInstance_ = nullptr; } float scaleFactor = 1; - webViewInstance_ = LWE::WebContainer::Create( - width_, height_, scaleFactor, "SamsungOneUI", "ko-KR", "Asia/Seoul"); + + LWE::WebView* webview = LWE::WebView::Create(nullptr,0,0,width_, height_,scaleFactor, "SamsungOneUI", "ko-KR", "Asia/Seoul"); + webViewInstance_ = webview->FetchWebContainer(); webViewInstance_->RegisterPreRenderingHandler( [this]() -> LWE::WebContainer::RenderInfo { LWE::WebContainer::RenderInfo result; - { - tbmSurface_ = - tbm_surface_create(width_, height_, TBM_FORMAT_ARGB8888); - tbm_surface_info_s tbmSurfaceInfo; - if (tbm_surface_map(tbmSurface_, TBM_SURF_OPTION_WRITE, - &tbmSurfaceInfo) == TBM_SURFACE_ERROR_NONE) { - result.updatedBufferAddress = tbmSurfaceInfo.planes[0].ptr; - result.bufferStride = tbmSurfaceInfo.planes[0].stride; - } + tbmSurface_ = tbm_surface_create(width_, height_, TBM_FORMAT_ARGB8888); + tbm_surface_info_s tbmSurfaceInfo; + if (tbm_surface_map(tbmSurface_, TBM_SURF_OPTION_WRITE, + &tbmSurfaceInfo) == TBM_SURFACE_ERROR_NONE) { + result.updatedBufferAddress = (void*)tbmSurface_; + result.bufferStride = 0; } return result; }); + webViewInstance_->RegisterOnRenderedHandler( [this](LWE::WebContainer* c, LWE::WebContainer::RenderResult r) { FlutterMarkExternalTextureFrameAvailable(textureRegistrar_,