From 312a63c48229f2007bfe1d7779317eac371371b4 Mon Sep 17 00:00:00 2001 From: yihuiyang Date: Thu, 16 Jan 2025 11:00:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E5=B5=8C=E5=85=A5ohosview=E5=8E=9F=E7=94=9F=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=BA=94=E7=94=A8=E7=AA=97=E5=8F=A3=E6=97=B6=E5=8F=91?= =?UTF-8?q?=E7=94=9FANR=E9=97=AA=E9=80=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yihuiyang --- shell/platform/ohos/platform_view_ohos.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/shell/platform/ohos/platform_view_ohos.cpp b/shell/platform/ohos/platform_view_ohos.cpp index 00ff616599..0185b1fc41 100644 --- a/shell/platform/ohos/platform_view_ohos.cpp +++ b/shell/platform/ohos/platform_view_ohos.cpp @@ -178,21 +178,9 @@ void PlatformViewOHOS::NotifySurfaceWindowChanged( } void PlatformViewOHOS::NotifyChanged(const SkISize& size) { - LOGI("PlatformViewOHOS NotifyChanged enter"); - if (ohos_surface_) { - fml::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetRasterTaskRunner(), // - [&latch, surface = ohos_surface_.get(), size, this]() { - if (GetDestroyed()) { - LOGW("NotifyChanged, GetDestroyed is true, ignore this call."); - } else { - surface->OnScreenSurfaceResize(size); - } - latch.Signal(); - }); - latch.Wait(); - } + //Do nothing to avoid ANR + //Because SetViewportMetrics has notified window size change event + return; } bool PlatformViewOHOS::GetDestroyed() { -- Gitee From d800df8b2973b0ed2ed7b879ca3738b76f392d4e Mon Sep 17 00:00:00 2001 From: yihuiyang Date: Thu, 16 Jan 2025 11:36:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yihuiyang --- shell/platform/ohos/platform_view_ohos.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shell/platform/ohos/platform_view_ohos.cpp b/shell/platform/ohos/platform_view_ohos.cpp index 0185b1fc41..5aa79c30c7 100644 --- a/shell/platform/ohos/platform_view_ohos.cpp +++ b/shell/platform/ohos/platform_view_ohos.cpp @@ -178,9 +178,10 @@ void PlatformViewOHOS::NotifySurfaceWindowChanged( } void PlatformViewOHOS::NotifyChanged(const SkISize& size) { - //Do nothing to avoid ANR - //Because SetViewportMetrics has notified window size change event - return; + //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; } bool PlatformViewOHOS::GetDestroyed() { -- Gitee