HubLensCross-platformTencent/tgfx
// archived 2026-04-27
Tencent

tgfx

Other#Graphics#C++#Rendering#Cross-platform#OpenGL
View on GitHub
1,532

// summary

TGFX is a lightweight, high-performance 2D graphics library designed for modern GPU rendering across multiple platforms. It provides robust support for text, images, and vector graphics while maintaining a smaller binary footprint than traditional alternatives like Skia. The library is widely used in various Tencent products and supports major operating systems including iOS, Android, Windows, and the Web.

// technical analysis

TGFX (Tencent Graphics) is a lightweight, high-performance 2D graphics library engineered for modern GPU acceleration across diverse platforms including mobile, desktop, and web. It was developed to provide a feature-rich alternative to Skia, specifically prioritizing a significantly smaller binary footprint while maintaining robust rendering capabilities for text, images, and vector graphics. The project utilizes a C++17 architecture and employs a modular approach to rendering backends, ensuring cross-platform compatibility through abstraction layers for technologies like OpenGL, WebGL, and emerging support for Metal and Vulkan.

// key highlights

01
Delivers high-performance 2D rendering for text, images, and vector graphics on major platforms including iOS, Android, macOS, Windows, Linux, OpenHarmony, and the Web.
02
Designed as a lightweight alternative to Skia, focusing on minimizing binary size without sacrificing rendering features.
03
Supports a wide array of modern rendering backends, including OpenGL, OpenGL ES, and WebGL, with active development for Metal, Vulkan, and WebGPU.
04
Provides a unified build system using vendor_tools and CMake, allowing developers to easily target specific platforms and generate artifacts like xcframeworks.
05
Includes comprehensive demo projects for all supported platforms, enabling developers to test rendering capabilities and explore API usage through provided test cases.
06
Offers official vcpkg port files to simplify dependency management and integration into existing C++ projects.

// use cases

01
High-performance 2D rendering of text, images, and vector graphics
02
Cross-platform graphics engine for mobile, desktop, and web applications
03
Lightweight alternative to Skia for resource-constrained environments

// getting started

To begin, ensure your environment meets the C++17 requirements and install the necessary build tools like CMake, Ninja, and Node.js. Use the provided 'depsync' tool to synchronize third-party dependencies, then navigate to the specific platform directory (e.g., 'ios/', 'android/', 'web/') to build the demo projects using the provided scripts or IDE configurations. You can also use the 'build_tgfx' command in the root directory to compile the library for your target platform.