From 4e7a15171ed0859a51e24c0c876adc702bf519be Mon Sep 17 00:00:00 2001 From: wwyang <137208408@qq.com> Date: Mon, 8 Jul 2024 15:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A4=A7=E5=B0=BA=E5=AF=B8?= =?UTF-8?q?=E5=9B=BE=E7=89=87crash=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wwyang <137208408@qq.com> --- shell/platform/ohos/ohos_external_texture_gl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/platform/ohos/ohos_external_texture_gl.cpp b/shell/platform/ohos/ohos_external_texture_gl.cpp index ad1c4e2d70..4b41c9ede0 100755 --- a/shell/platform/ohos/ohos_external_texture_gl.cpp +++ b/shell/platform/ohos/ohos_external_texture_gl.cpp @@ -374,6 +374,11 @@ void OHOSExternalTextureGL::ProducePixelMapToNativeImage() FML_DLOG(ERROR) << "OHOSExternalTextureGL OH_NativeWindow_NativeWindowHandleOpt err:" << ret; } + int32_t usage = 0; + OH_NativeWindow_NativeWindowHandleOpt(nativeWindow_, GET_USAGE, &usage); + usage |= NATIVEBUFFER_USAGE_CPU_READ; + OH_NativeWindow_NativeWindowHandleOpt(nativeWindow_, SET_USAGE, usage); + if (buffer_ != nullptr) { OH_NativeWindow_NativeWindowAbortBuffer(nativeWindow_, buffer_); buffer_ = nullptr; -- Gitee