Skip to content

Commit

Permalink
[webview_flutter] Update LWE (flutter-tizen#26)
Browse files Browse the repository at this point in the history
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
  • Loading branch information
bwikbs committed Jan 27, 2021
1 parent a438093 commit 6a34ae0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Binary file not shown.
6 changes: 4 additions & 2 deletions packages/webview_flutter/tizen/inc/lwe/LWEWebView.h
Expand Up @@ -169,7 +169,7 @@ class LWE_EXPORT WebContainer {
const std::function<void(WebContainer*, bool mayNeedsSync)>&
onGLSwapBuffers,
const std::function<ExternalImageInfo(void)>& prepareImageCb,
const std::function<void(WebContainer*)>& renderedCb,
const std::function<void(WebContainer*, bool isRendered)>& renderedCb,
float devicePixelRatio, const char* defaultFontName, const char* locale,
const char* timezoneID);
// <--- end of function set for render with OpenGL
Expand Down Expand Up @@ -371,12 +371,14 @@ 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;
};

Expand Down
Expand Up @@ -270,6 +270,6 @@ enum class IdleModeJob {
};

constexpr int IdleModeCheckDefaultIntervalInMS{ 3000 };
}
} // namespace LWE

#endif
Binary file not shown.
11 changes: 7 additions & 4 deletions packages/webview_flutter/tizen/src/webview.cc
Expand Up @@ -24,7 +24,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*)>& renderedCb);
const std::function<void(::LWE::WebContainer*, bool isRendered)>&
renderedCb);

std::string ExtractStringFromMap(const flutter::EncodableValue& arguments,
const char* key) {
Expand Down Expand Up @@ -480,9 +481,11 @@ void WebView::InitWebView() {
}
return result;
},
[this](LWE::WebContainer* c) {
FlutterMarkExternalTextureFrameAvailable(textureRegistrar_,
GetTextureId(), tbmSurface_);
[this](LWE::WebContainer* c, bool isRendered) {
if (isRendered) {
FlutterMarkExternalTextureFrameAvailable(textureRegistrar_,
GetTextureId(), tbmSurface_);
}
tbm_surface_destroy(tbmSurface_);
tbmSurface_ = nullptr;
});
Expand Down

0 comments on commit 6a34ae0

Please sign in to comment.