From 72917f6b68d9f9f1c972408fcd936e6363c25c03 Mon Sep 17 00:00:00 2001 From: yangqilin Date: Tue, 8 Oct 2024 15:05:10 +0800 Subject: [PATCH] optimize CPU cycle Signed-off-by: yangqilin --- frameworks/opengl_wrapper/include/thread_private_data_ctl.h | 3 +-- frameworks/opengl_wrapper/src/GLES3/gles3.cpp | 2 +- frameworks/opengl_wrapper/src/thread_private_data_ctl.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frameworks/opengl_wrapper/include/thread_private_data_ctl.h b/frameworks/opengl_wrapper/include/thread_private_data_ctl.h index 6ecb100280..f557dce41d 100644 --- a/frameworks/opengl_wrapper/include/thread_private_data_ctl.h +++ b/frameworks/opengl_wrapper/include/thread_private_data_ctl.h @@ -22,10 +22,9 @@ #include "hook.h" namespace OHOS { struct ThreadPrivateData { - ThreadPrivateData() : error(EGL_SUCCESS), ctx(nullptr), table(nullptr) {} + ThreadPrivateData() : error(EGL_SUCCESS), ctx(nullptr) {} EGLint error; EGLContext ctx; - GlHookTable *table; }; class ThreadPrivateDataCtl { diff --git a/frameworks/opengl_wrapper/src/GLES3/gles3.cpp b/frameworks/opengl_wrapper/src/GLES3/gles3.cpp index a6f021fdd8..e15b1302e7 100644 --- a/frameworks/opengl_wrapper/src/GLES3/gles3.cpp +++ b/frameworks/opengl_wrapper/src/GLES3/gles3.cpp @@ -40,7 +40,7 @@ Func GetEglApi(const char* procname) return nullptr; } static GetGlHookTableFunc g_pfnGetGlHookTable = GetEglApi("GetHookTable"); -static GetGlHookTableKeyFunc g_pfnGetGlHookTableKey = GetEglApi("GetHookTableKey"); +static GetGlHookTableKeyFunc g_pfnGetGlHookTableKey = GetEglApi("GetHookTableKey"); static pthread_key_t g_glHookTableKey = -1; diff --git a/frameworks/opengl_wrapper/src/thread_private_data_ctl.cpp b/frameworks/opengl_wrapper/src/thread_private_data_ctl.cpp index 034a1fe918..10102b509e 100644 --- a/frameworks/opengl_wrapper/src/thread_private_data_ctl.cpp +++ b/frameworks/opengl_wrapper/src/thread_private_data_ctl.cpp @@ -29,7 +29,7 @@ void ThreadPrivateDataCtl::KeyInit() return; } if (pthread_key_create(&tableKey_, nullptr) != 0) { - WLOGE("Failed to creat thread key."); + WLOGE("Failed to create thread key."); return; } WLOGD("pthread_key_create. key = %{public}d", key_);