2 ** Copyright 2009, The Android Open Source Project
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
8 ** http://www.apache.org/licenses/LICENSE-2.0
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
17 #ifndef ANDROID_EGL_LOADER_H
18 #define ANDROID_EGL_LOADER_H
24 #include <utils/Errors.h>
25 #include <utils/Singleton.h>
26 #include <utils/String8.h>
28 #include <gui/GraphicsEnv.h>
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
36 struct egl_connection_t;
38 class Loader : public Singleton<Loader>
40 friend class Singleton<Loader>;
42 typedef __eglMustCastToProperFunctionPointerType (*getProcAddressType)(
51 explicit driver_t(void* gles);
53 status_t set(void* hnd, int32_t api);
57 getProcAddressType getProcAddress;
60 decltype(android_getDriverNamespace)* mGetDriverNamespace;
65 void* open(egl_connection_t* cnx);
66 status_t close(void* driver);
70 void *load_driver(const char* kind, egl_connection_t* cnx, uint32_t mask);
72 static __attribute__((noinline))
73 void init_api(void* dso,
74 char const * const * api,
75 __eglMustCastToProperFunctionPointerType* curr,
76 getProcAddressType getProcAddress);
79 // ----------------------------------------------------------------------------
80 }; // namespace android
81 // ----------------------------------------------------------------------------
83 #endif /* ANDROID_EGL_LOADER_H */