TGFX (Tencent Graphics) renders text, images, and vector content on modern GPUs across mobile, desktop, and Web targets. It was built as PAG’s default engine and targets a smaller binary than comparable engines.
Overview
TGFX is a lightweight 2D graphics library oriented toward GPU-backed rendering of text, bitmaps, and vector artwork. It is designed to run on iOS, Android, macOS, Windows, Linux, OpenHarmony, and Web browsers, and can be embedded in products such as PAG, Hippy, Tencent Docs, and video editing apps.
Rendering backends include OpenGL, OpenGL ES, WebGL, Vulkan, WebGPU, and in-progress Metal support. The website describes coverage for bitmaps, vectors, text, blend modes, filters, picture recording, PDF, SVG, wide-gamut color, and 3D transforms, with a layer module that supports display lists, dirty-region updates, and tile caching for large scene graphs.
The project ships platform demos that exercise shapes, images, and text, and documents integration paths for Android NDK, Xcode on iOS and macOS, Emscripten for WebAssembly, Linux with software GPU emulation, and Windows with Visual Studio or CLion. A unified GPU abstraction wraps Metal, Vulkan, WebGPU, and OpenGL with minimal runtime overhead.
Compared with Skia in project messaging, TGFX emphasizes a smaller core rendering footprint while aligning on many 2D features. Optional visualization tooling helps capture frames and inspect layer trees during performance work.
Key features
- GPU text and vector rendering
- PDF and SVG support
- Layer display list module
- Multiple GPU backend options
- WebAssembly and WebGPU builds
- Filters and blend modes
- PAG animation engine integration
- Cross-platform demo projects
Use cases
- Mobile app 2D UI rendering
- Animation playback in PAG
- Web canvas graphics
- Video editor graphics stacks
- Replacing heavier 2D engines