[Pin to top] new graphics improvement in Android 4.3

Source: Internet
Author: User
In the next version of Android, I think it is 4.3. What improvements will be made to the graphic performance? Chet Haase and Romain guy, graphics experts from the android team, gave us some information on the performance of Android graphics in the Google Io 2013 speech. The speech covers improved architecture performance, performance analysis tool Improvement and Application optimization suggestions, written in this article based on the speech content, hope to do Android graphics performance research friends help. Android graphics performance-YouTube: http://www.youtube.com/watch? V = vqzfaec9npa Android graphics performance-Slides: http://www.curious-creature.org/2013/05/17/android-sessions-at-google-io-2013/ why your Android apps suck: http://rogeryi.wordpress.com/2013/03/26/why-your-android-apps-suck/ my article Article I made a basic analysis on the android graphics subsystem and compared and evaluated its architecture, which can serve as a background for subsequent content. Android displaylist Mechanism Analysis: http://rogeryi.wordpress.com/2012/11/19/android-displaylist-introductio/ This article briefly analyzes the android displaylist mechanism. How to Use systrace For performance analysis: http://rogeryi.wordpress.com/2012/11/30/android-systrace-in-4_1/ introduces the use of the performance analysis tool systrace. The Architecture performance improvement Drawing Instruction shuffling and merging Android 4.3 will rearrange the Drawing Instruction on the UI interface and merge the Drawing Instruction of the same type, this reduces the number of gldrawxxx commands sent to the GPU and avoids frequent changes to the status of the GL drawing assembly line (such as switching different shader, etc.), and maximizes the use of GPU to accelerate the drawing speed. The speech demonstrates an example in which the UI interface includes two checkbox icons and text, the 9-patch background and text of the two buttons, if they are arranged in the order of the UI components of the interface, the draw sequence should be: 1. Draw checkbox Icon 2, draw checkbox text "include metadata" 3, draw checkbox icon 4, and draw checkbox text "maximize compatibility" 5, draw the 9-patch background 6 of the button, draw the button text "save" 7, and draw the 9-patch Background 8 of the button, the drawing above the button text "cancel" includes 8 Drawing commands and 7 shader changes. After re-sorting, it becomes: 1. Draw checkbox Icon 2, draw checkbox icon 3, draw 9-patch background 4 of the button, and draw 9-patch BACKGROUND 5 of the button, draw the checkbox text "include metadata" 6, draw the checkbox text "maximize compatibility" 7, draw the button text "save" 8, and draw the button text "cancel"

The optimized drawing includes 8 Drawing commands and 2 shader changes. After merging, it becomes: 1. Draw two checkbox icons 2, and draw 9-patch background 3 of two buttons, to draw four texts, the further optimized rendering requires only three drawing commands and two shader changes. Multi-thread Rendering

The thread architecture of the android GUI framework has not changed, in the same way, it is still drawn in the main thread (the disadvantages of drawing in the main thread rather than a separate rendering thread can be referred to my article why your Android apps suck ). Only some time-consuming rendering, such as the generation of shadow and path effect, can be accelerated through multi-thread concurrency. The number of specific threads is related to the number of CPU cores. Support for non-rectangular cropping HW canvas finally supports non-rectangular cropping. However, considering compatibility issues, it is estimated that no one dares to use it ...... The developer tool overdraw shows that it is actually 4.2 ready. It is quite useful for developers who know whether their applications are over-drawn. The ideal situation is that there is no overdraw, pixels in each region only need to be drawn once. Blue indicates overdraw at a time. This means that pixels in the blue region are drawn twice, Green indicates twice, red indicates three times, and deep red indicates four times. Of course, it is difficult to avoid overdraw once or twice. In particular, the interface contains some complex combinations and translucent blending effects. However, developers can use this information to analyze which overdraw can actually be avoided, in the final optimization recommendations, Chet Haase and Romain guy also use an actual example to demonstrate how an application can optimize overdraw. Gfxinfo can output the time consumed by the last 120 frames. Draw indicates the time consumed by displaylist generation, process indicates the time consumed by displaylist execution, and execute indicates the time consumed by window swap buffers, the new version allows you to directly display the information in the application window, making it easier. In the new version, systrace can be started directly without being set in the developer options, java APIs are also made public for developers to analyze their own methods (in fact, versions 4.1 and 4.2 can also call non-public APIs ).

 

Related Article

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.