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 { 24 enum { GLESV1_INDEX = 0, GLESV2_INDEX = 1 }; EglWrapperDispatchTableEglWrapperDispatchTable25 inline EglWrapperDispatchTable() noexcept : isLoad(false), useMesa(false) {} 26 WrapperHookTable wrapper; 27 EglHookTable egl; 28 GlHookTable gl; 29 bool isLoad; 30 bool useMesa; 31 EGLint major; 32 EGLint minor; 33 }; 34 35 extern char const * const gWrapperApiNames[EGL_API_NUM]; 36 extern char const * const gEglApiNames[EGL_API_NUM]; 37 extern char const * const gGlApiNames1[GLES_API_NUM]; 38 extern char const * const gGlApiNames2[GLES_API_NUM]; 39 extern char const * const gGlApiNames3[GLES_API_NUM]; 40 #ifdef OPENGL_WRAPPER_ENABLE_GL4 41 extern char const * const gGlApiNames4[OPENGL_API_NUM]; 42 #endif 43 extern const std::map<std::string, EglWrapperFuncPointer> gExtensionMap; 44 45 extern GlHookTable gGlHookNoContext; 46 extern EglWrapperDispatchTable gWrapperHook; 47 #if USE_IGRAPHICS_EXTENDS_HOOKS 48 extern GlHookTable g_glHookCSDR; 49 extern GlHookTable g_glHookSingle; 50 #endif 51 52 using EglWrapperDispatchTablePtr = EglWrapperDispatchTable *; 53 }; // namespace OHOS 54 55 #endif // FRAMEWORKS_OPENGL_WRAPPER_EGL_DEFS_H 56