Skip to content

Commit

Permalink
[webview_flutter] Optimize tbm allocation (#42)
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 Mar 3, 2021
1 parent 7059ce2 commit 791511e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/webview_flutter/tizen/src/webview.cc
Expand Up @@ -739,17 +739,20 @@ void WebView::InitWebView() {
0, 0, width_, height_, scaleFactor, "SamsungOneUI", "ko-KR", "Asia/Seoul",
[this]() -> LWE::WebContainer::ExternalImageInfo {
LWE::WebContainer::ExternalImageInfo result;
tbmSurface_ = tbm_surface_create(width_, height_, TBM_FORMAT_ARGB8888);
if (!tbmSurface_) {
tbmSurface_ =
tbm_surface_create(width_, height_, TBM_FORMAT_ARGB8888);
}
result.imageAddress = (void*)tbmSurface_;
return result;
},
[this](LWE::WebContainer* c, bool isRendered) {
if (isRendered) {
FlutterMarkExternalTextureFrameAvailable(textureRegistrar_,
GetTextureId(), tbmSurface_);
tbm_surface_destroy(tbmSurface_);
tbmSurface_ = nullptr;
}
tbm_surface_destroy(tbmSurface_);
tbmSurface_ = nullptr;
});
#ifndef TV_PROFILE
auto settings = webViewInstance_->GetSettings();
Expand Down

0 comments on commit 791511e

Please sign in to comment.