19th: Three kinds of weapons to improve the performance of Soui application rendering

Source: Internet
Author: User
Tags skia

Soui is a set of 100% open source, Directui-based client development frameworks.

UI based on Directui design while UI rendering can be stunning, rendering efficiency is an important issue relative to the form of one window handle per control in a traditional Win32 application.

Three types of weapons are available in the Soui system to improve rendering efficiency:

The first weapon: choose a more efficient rendering engine

The rendering engine provides the ability to draw text, geometry, and images on the cache. In the Soui system, the rendering engine is a standalone module that does not rely on other modules in the Soui system.

The Soui system has built-in rendering modules based on the Skia and GDI two frameworks (Skia is the rendering engine used in Google Chrome and Android). The intuitive comparison uses the fluency of the animations in two different rendering engines to know that the Skia-based rendering engine is much faster than GDI-based. (GDI may be slow because the alpha channel is not supported in GDI native, and performance is lost when using AlphaBlend to simulate alpha in the implementation process)

If users feel that the built-in rendering engine is not enough to meet their needs, they can also choose to implement a new rendering engine, such as DIRECT2D, Cairo, Agg and other rendering engines.

Second weapon: Draw cache

The rendered content in a window is often fixed, especially when the window size is constant. The content rendered in the window may be obtained by complex calculations (like the nine GONGCE, stretching, etc.), and if each refresh is recalculated, the rendering efficiency may decrease, especially when the window is still relatively large.

To solve this problem, in the Soui system, we provide a cache property for Swindow, cache= "1", the content drawn in the window will be automatically cached, the next time the refresh, automatically extract the data from the cache, thus greatly accelerating the drawing process.

Third weapon: Non-background mixing technology

The Directui effect is dependent on the interplay between the various Windows (AlphaBlend), but sometimes a window may have its own fixed background, or the foreground will completely cover the window without the need for a background. If this window refreshes very frequently, then each refresh notifies all levels of the parent window refresh to get a background to do the blending will be a great performance loss (such as a video playback window).

To solve this problem, the Soui system (ver:1.3.0.1) implements a new property for Swindow: Bkgndblend, which defaults to "1", which represents the use of background blending when refreshing. If the property is "0", the window refreshes itself directly without requesting the parent window to refresh the background and ultimately improve the rendering efficiency of the UI.

19th: Three kinds of weapons to improve the performance of Soui application rendering

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.