From 0793de2c0cd98fa9e35a20564e5f3441cd101ba1 Mon Sep 17 00:00:00 2001 From: wangtian Date: Fri, 21 Feb 2025 17:34:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8B=89=E4=BC=B8=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=90=8Eview=E4=B8=8D=E5=88=B7=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangtian --- shell/platform/ohos/platform_view_ohos.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/shell/platform/ohos/platform_view_ohos.cpp b/shell/platform/ohos/platform_view_ohos.cpp index d164be8830..20ac8faaa5 100644 --- a/shell/platform/ohos/platform_view_ohos.cpp +++ b/shell/platform/ohos/platform_view_ohos.cpp @@ -169,10 +169,18 @@ void PlatformViewOHOS::NotifySurfaceWindowChanged( } void PlatformViewOHOS::NotifyChanged(const SkISize& size) { - //Do nothing, because SetViewportMetrics has notified window size change event - //If raster thread post task, Synchronization signal block application main thread - //(https://gitee.com/openharmony-sig/flutter_engine/issues/IBI4PK?from=project-issue) - return; + LOGI("PlatformViewOHOS NotifyChanged enter"); + if (ohos_surface_) { + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetRasterTaskRunner(), + [surface = ohos_surface_.get(), size, this]() { + if (GetDestroyed()) { + LOGW("NotifyChanged, GetDestroyed is true, ignore this call."); + } else { + ohos_surface_.get()->OnScreenSurfaceResize(size); + } + }); + } } bool PlatformViewOHOS::GetDestroyed() { -- Gitee