From 1365649e7e78c723f77b9e480bc6dcd3a87066d7 Mon Sep 17 00:00:00 2001 From: cjand <1747143535@qq.com> Date: Mon, 14 Oct 2024 17:31:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E8=83=8C=E6=99=AF=E5=B0=8F=E4=BA=8E=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=A4=A7=E5=B0=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cjand <1747143535@qq.com> --- shell/platform/ohos/ohos_external_texture_gl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shell/platform/ohos/ohos_external_texture_gl.cpp b/shell/platform/ohos/ohos_external_texture_gl.cpp index 05c8449bf5..911ea153cf 100755 --- a/shell/platform/ohos/ohos_external_texture_gl.cpp +++ b/shell/platform/ohos/ohos_external_texture_gl.cpp @@ -398,10 +398,8 @@ void OHOSExternalTextureGL::ProduceColorToBackGroundImage(int32_t width, int32_t uint32_t* destAddr = static_cast(mappedAddr); uint32_t value = 0xFFFFFFFF; - for (int32_t x = 0; x < handle->width; x++) { - for (int32_t y = 0; y < handle->height; y++) { - *destAddr++ = value; - } + for (int32_t x = 0; x < handle->size / 4; x++) { + *destAddr++ = value; } // munmap after use -- Gitee From db01d3f9874763f075bfbeb560446ac3ca874a66 Mon Sep 17 00:00:00 2001 From: cjand <1747143535@qq.com> Date: Mon, 14 Oct 2024 17:47:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E8=83=8C=E6=99=AF=E5=B0=8F=E4=BA=8E=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=A4=A7=E5=B0=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cjand <1747143535@qq.com> --- shell/platform/ohos/ohos_external_texture_gl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/platform/ohos/ohos_external_texture_gl.cpp b/shell/platform/ohos/ohos_external_texture_gl.cpp index 911ea153cf..ec1414a700 100755 --- a/shell/platform/ohos/ohos_external_texture_gl.cpp +++ b/shell/platform/ohos/ohos_external_texture_gl.cpp @@ -38,6 +38,7 @@ constexpr const char *CHARACTER_STRING_WHITESPACE = " "; constexpr const char *EGL_EXT_PLATFORM_WAYLAND = "EGL_EXT_platform_wayland"; constexpr const char *EGL_KHR_PLATFORM_WAYLAND = "EGL_KHR_platform_wayland"; constexpr const char *EGL_GET_PLATFORM_DISPLAY_EXT = "eglGetPlatformDisplayEXT"; +constexpr uint32_t WHITE_COLOR = 0xFFFFFFFF; static int PixelMapToWindowFormat(PIXEL_FORMAT pixel_format) { @@ -396,10 +397,9 @@ void OHOSExternalTextureGL::ProduceColorToBackGroundImage(int32_t width, int32_t } uint32_t* destAddr = static_cast(mappedAddr); - uint32_t value = 0xFFFFFFFF; - for (int32_t x = 0; x < handle->size / 4; x++) { - *destAddr++ = value; + for (int32_t x = 0; x < handle->size / PIXEL_SIZE; x++) { + *destAddr++ = WHITE_COLOR; } // munmap after use -- Gitee