Labs / LVGL / 02 LVGL Basic Knowledge and Concepts

VI. Underlying Rendering and Performance Optimization: The Performance Foundation of GUI

Author: Li Zisheng · Source: FreakStudio open documentation, v1.0 · License: CC BY 4.0

Contents

It handles the underlying logic of graphics rendering, provides hardware acceleration and performance analysis tools, and balances feature richness with hardware resource consumption.

6.1 Drawing Mechanism (Drawing)

With VGL, you don’t need to draw anything manually. Simply create controls such as buttons, labels and arcs, adjust their positions and styles, and VGL will automatically refresh and redraw the parts that require updating.

6.1.1 Core Rendering Approach: Draw to the Buffer First, Then Update the Screen

LVGL does not draw directly on the screen; instead, it first renders content in an internal "drawing buffer", and once rendering is complete, it copies the buffer contents to the screen. This buffer can be smaller than the screen, and LVGL will divide the frame into small segments (tiles) to match the buffer size.

6.1.2 How to refresh the screen? Only update the areas that need to be changed

When there are changes in the UI (such as a button being clicked or an animation playing), LVGL will refresh according to the following steps:

6.1.3 Mask: The Core of Creating Fancy Styles

Masking is the underlying logic for LVGL to draw graphics and text. You can use it without understanding the principle, but it is very useful when customizing styles:

6.1.4 Custom Drawing: Hook Events Help You Tweak Details

If you want to implement special styles (for example, changing the color of a single button in a matrix button independently), you can use LVGL's "draw hook event":

6.2 Profiler

1

LVGL has a built-in profiler, which is specifically designed to troubleshoot performance issues such as low frame rate, laggy performance and cache invalidation that arise as projects grow more complex. It tracks the timestamps of key runtime events including rendering and user input, stores the data in a buffer of configurable size, outputs logs in the Android systrace format, and allows users to visualize and check time consumption via the Perfetto tool;When in use, you need to enable the feature in the configuration file, where you can set the buffer, high-precision timestamp, and custom log output mode. You can also manually add measurement points to the function, and it supports integration with the analyzer built into the operating system. Meanwhile, there are corresponding solutions for common issues such as log parsing failure, displayed time consumption of 0, laggy analysis, and no log output.

6.3 Rendering and GPU Acceleration

LVGL supports multiple rendering solutions, ranging from pure software rendering to hardware GPU acceleration, and is compatible with various platforms (including embedded MCUs, desktop simulators, etc.), with the core goal of improving UI rendering performance and reducing CPU usage.

The renderers / GPUs of LVGL fall into three categories:

The differences are as follows:

Renderer / GPUSupported platformsCore characteristicsRequired hardware / instruction set
Software rendererAll platforms (generic)Pure CPU drawing, best compatibility, average performanceNone (pure software)
SDL rendererDesktop / simulator (PC, Mac, etc.)Hardware-accelerated, smooth for development and debugging, suited to simulatorsSDL library + desktop GPU
Arm-2D GPUARM Cortex-M, all series2D acceleration abstraction layer, with synchronous / asynchronous modes, requires hardware / instruction setCortex-M + Helium/ACI or DMAC-350, etc.
NXP PXP GPUNXP i.MX RT and similar platformsHardware 2D acceleration, reduces CPU usage, optimized for NXP devicesNXP PXP hardware module
DMA2D GPUSTM32 (H7/F7, etc.)Hardware 2D acceleration, memory copy / blending, frees the STM32 CPUSTM32 DMA2D hardware module
NXP VGLite GPUHigh-end NXP i.MX RT and similarHardware 2D/3D acceleration, supports complex graphics, higher performanceNXP VGLite GPU hardware module

Version Record

Version Number

Modifier

Time

Content

v1.0

Li Zisheng

2026/03/23

Initialize the document.