Understand Android 2D/3D graphics Architecture

Source: Internet
Author: User

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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.