In Android, The egl/gles library is not directly linked at runtime, but is selectively loaded according to configuration during the first use. More specifically, the libegl. So file contains a "Loader" that will try to load the hardware graphics library or the software graphics library (libagl ). Loader'sSource codeLocation: frameworks/base/openl/libs/EGL/loader. cpp. The library to load depends on the configuration file/system/lib/EGL. cfg, which has the following form:
0 1 <Name>
0 0 android
The first digit is the display number, which must be 0 because The egl/eles library does not support other values.
If the second digit is 0, it indicates the hardware library, and 0 indicates the software graphics library. If there is a hardware graphics library, it must be placed in front of the corresponding row of the software graphics library.
The third domain is the shared library suffix, which is called libegl _ <Name>. so, libglesv1_c _ <Name>. so and libglesv2 _ <Name>. so, these libraries must be placed under/system/lib/EGL. Android is reserved for the system software graphics library.
For example, in the emulator project, the content of EGL. cfg is:
0 1 emulation
0 0 android
The first line represents the hardware graphics library, and the second line represents the software graphics library.