1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef FRAMEWORKS_OPENGL_WRAPPER_EGL_DEFS_H 16 #define FRAMEWORKS_OPENGL_WRAPPER_EGL_DEFS_H 17 18 #include <map> 19 20 #include "egl_wrapper_entry.h" 21 #include "../hook.h" 22 namespace OHOS { 23 struct EglWrapperDispatchTable { EglWrapperDispatchTableEglWrapperDispatchTable24 inline EglWrapperDispatchTable() noexcept : isLoad(false) {} 25 WrapperHookTable wrapper; 26 EglHookTable egl; 27 GlHookTable gl; 28 bool isLoad; 29 EGLint major; 30 EGLint minor; 31 }; 32 33 extern char const * const gWrapperApiNames[EGL_API_NUM]; 34 extern char const * const gEglApiNames[EGL_API_NUM]; 35 extern char const * const gGlApiNames1[GL_API_NUM]; 36 extern char const * const gGlApiNames2[GL_API_NUM]; 37 extern char const * const gGlApiNames3[GL_API_NUM]; 38 extern const std::map<std::string, EglWrapperFuncPointer> gExtensionMap; 39 40 extern GlHookTable gGlHookNoContext; 41 extern EglWrapperDispatchTable gWrapperHook; 42 43 using EglWrapperDispatchTablePtr = EglWrapperDispatchTable *; 44 }; // namespace OHOS 45 #endif // FRAMEWORKS_OPENGL_WRAPPER_EGL_DEFS_H 46