• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_HOOK_H
16 #define FRAMEWORKS_OPENGL_WRAPPER_HOOK_H
17 
18 #include <EGL/egl.h>
19 #include <EGL/eglext.h>
20 #include <GLES3/gl3.h>
21 #include <GLES3/gl31.h>
22 #include <GLES3/gl32.h>
23 #include <GLES2/gl2.h>
24 #include <GLES2/gl2ext.h>
25 #include <GLES/gl.h>
26 #include <GLES/glext.h>
27 
28 namespace OHOS {
29 #undef CALL_HOOK_API
30 #define CALL_HOOK_API(...)
31 #undef CALL_HOOK_API_RET
32 #define CALL_HOOK_API_RET CALL_HOOK_API
33 #undef HOOK_API_ENTRY
34 #define HOOK_API_ENTRY(r, api, ...) r (*(api))(__VA_ARGS__);
35 
36 constexpr int32_t EGL_API_NUM = 100;
37 constexpr int32_t GL_API_NUM = 1000;
38 
39 struct WrapperHookTable {
40     #include "wrapper_hook_entries.in"
41 };
42 
43 struct EglHookTable {
44     #include "egl_hook_entries.in"
45 };
46 
47 struct GlHookTable1 {
48     #include "gl1_hook_entries.in"
49 };
50 
51 struct GlHookTable2 {
52     #include "gl2_hook_entries.in"
53 };
54 
55 struct GlHookTable3 {
56     #include "gl3_hook_entries.in"
57 };
58 
59 struct GlHookTable {
60     GlHookTable1 table1;
61     GlHookTable2 table2;
62     GlHookTable3 table3;
63 };
64 } // namespace OHOS
65 #endif // FRAMEWORKS_OPENGL_WRAPPER_HOOK_H
66