@@ -54,6 +54,7 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
5454 FlutterTextureRegistrar* textureRegistrar, double width,
5555 double height, const std::string initialUrl)
5656 : PlatformView(registrar, viewId),
57+ tbmSurface_(nullptr ),
5758 textureRegistrar_(textureRegistrar),
5859 webViewInstance_(nullptr ),
5960 currentUrl_(initialUrl),
@@ -341,7 +342,7 @@ void WebView::DispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
341342 } else {
342343 webViewInstance_->AddIdleCallback (
343344 [](void * data) {
344- LWE::WebContainer* self = (LWE::WebContainer*)data;
345+ // LWE::WebContainer* self = (LWE::WebContainer*)data;
345346 // self->HideSoftwareKeyboardIfPossible();
346347 },
347348 webViewInstance_);
@@ -436,23 +437,22 @@ void WebView::InitWebView() {
436437 webViewInstance_ = nullptr ;
437438 }
438439 float scaleFactor = 1 ;
439- webViewInstance_ = LWE::WebContainer::Create (
440- width_, height_, scaleFactor, " SamsungOneUI" , " ko-KR" , " Asia/Seoul" );
440+
441+ LWE::WebView* webview = LWE::WebView::Create (nullptr ,0 ,0 ,width_, height_,scaleFactor, " SamsungOneUI" , " ko-KR" , " Asia/Seoul" );
442+ webViewInstance_ = webview->FetchWebContainer ();
441443 webViewInstance_->RegisterPreRenderingHandler (
442444 [this ]() -> LWE::WebContainer::RenderInfo {
443445 LWE::WebContainer::RenderInfo result;
444- {
445- tbmSurface_ =
446- tbm_surface_create (width_, height_, TBM_FORMAT_ARGB8888);
447- tbm_surface_info_s tbmSurfaceInfo;
448- if (tbm_surface_map (tbmSurface_, TBM_SURF_OPTION_WRITE,
449- &tbmSurfaceInfo) == TBM_SURFACE_ERROR_NONE) {
450- result.updatedBufferAddress = tbmSurfaceInfo.planes [0 ].ptr ;
451- result.bufferStride = tbmSurfaceInfo.planes [0 ].stride ;
452- }
446+ tbmSurface_ = tbm_surface_create (width_, height_, TBM_FORMAT_ARGB8888);
447+ tbm_surface_info_s tbmSurfaceInfo;
448+ if (tbm_surface_map (tbmSurface_, TBM_SURF_OPTION_WRITE,
449+ &tbmSurfaceInfo) == TBM_SURFACE_ERROR_NONE) {
450+ result.updatedBufferAddress = (void *)tbmSurface_;
451+ result.bufferStride = 0 ;
453452 }
454453 return result;
455454 });
455+
456456 webViewInstance_->RegisterOnRenderedHandler (
457457 [this ](LWE::WebContainer* c, LWE::WebContainer::RenderResult r) {
458458 FlutterMarkExternalTextureFrameAvailable (textureRegistrar_,
0 commit comments