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) {}
26     WrapperHookTable    wrapper;
27     EglHookTable        egl;
28     GlHookTable         gl;
29     bool                isLoad;
30     EGLint              major;
31     EGLint              minor;
32 };
33 
34 extern char const * const gWrapperApiNames[EGL_API_NUM];
35 extern char const * const gEglApiNames[EGL_API_NUM];
36 extern char const * const gGlApiNames1[GL_API_NUM];
37 extern char const * const gGlApiNames2[GL_API_NUM];
38 extern char const * const gGlApiNames3[GL_API_NUM];
39 extern const std::map<std::string, EglWrapperFuncPointer> gExtensionMap;
40 
41 extern GlHookTable gGlHookNoContext;
42 extern EglWrapperDispatchTable gWrapperHook;
43 #if USE_IGRAPHICS_EXTENDS_HOOKS
44 extern GlHookTable g_glHookCSDR;
45 extern GlHookTable g_glHookSingle;
46 #endif
47 
48 using EglWrapperDispatchTablePtr = EglWrapperDispatchTable *;
49 }; // namespace OHOS
50 
51 #endif // FRAMEWORKS_OPENGL_WRAPPER_EGL_DEFS_H
52