First, understand the egl function call of Android, first obtain display (corresponding to the display), then select a supported config (this is supported by the video card), and then create WindowSurface, you also need to create a context (context is equivalent to the opengl state machine), and then you can call the drawing function of gl to draw a picture on the Surface. after the work is complete, you need to release the resources of Context and windowSurace.
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + expires/OqrbUbGliR0wuc2 + expires + 74bX308O1vc/uv6133/bavPC9wPgo8cD48aW1nIHNyYz0 = "http://www.2cto.com/uploadfile/Collfiles/20140501/20140501090137124.png" alt = "\">
If no hardware is available, the software simulates the gl function. It is worth noting that Andoid has optimized copybit.
2D Rendering
In the past, Android used skia to generate 2D images. Later (4.1 Jellybean) used opengl to improve performance (because gpu can be used), but the previous skia soft architecture was still retained.
When USE_OPENGL_RENDER: = true is enabled during compilation, hardware acceleration is enabled (enabled by default), which is the implementation of libhwui. so hardware acceleration.
Create a Surface like 3D, create a Context, and call the gl function for rendering...
The above two architectures have rendered the Surface (whether GPU-rendered or simulated by the cpu), and SurfaceFlinger called the opengl function at the final screen upload. It can also be divided into gpu hardware screen-on, or cpu Simulation