@@ -54,6 +54,7 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
54
54
FlutterTextureRegistrar* textureRegistrar, double width,
55
55
double height, const std::string initialUrl)
56
56
: PlatformView(registrar, viewId),
57
+ tbmSurface_(nullptr ),
57
58
textureRegistrar_(textureRegistrar),
58
59
webViewInstance_(nullptr ),
59
60
currentUrl_(initialUrl),
@@ -341,7 +342,7 @@ void WebView::DispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
341
342
} else {
342
343
webViewInstance_->AddIdleCallback (
343
344
[](void * data) {
344
- LWE::WebContainer* self = (LWE::WebContainer*)data;
345
+ // LWE::WebContainer* self = (LWE::WebContainer*)data;
345
346
// self->HideSoftwareKeyboardIfPossible();
346
347
},
347
348
webViewInstance_);
@@ -436,23 +437,22 @@ void WebView::InitWebView() {
436
437
webViewInstance_ = nullptr ;
437
438
}
438
439
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 ();
441
443
webViewInstance_->RegisterPreRenderingHandler (
442
444
[this ]() -> LWE::WebContainer::RenderInfo {
443
445
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 ;
453
452
}
454
453
return result;
455
454
});
455
+
456
456
webViewInstance_->RegisterOnRenderedHandler (
457
457
[this ](LWE::WebContainer* c, LWE::WebContainer::RenderResult r) {
458
458
FlutterMarkExternalTextureFrameAvailable (textureRegistrar_,
0 commit comments