FastUIDraw
FastUIDraw

Purpose

FastUIDraw is a library that provides a higher performance Canvas interface. It is designed so that it always draws using a GPU.

In contrast to many common implementations of Canvas drawing, FastUIDraw has that changes in clipping are very cheap and optimized for GPU's. In addition, FastUIDraw has, with the GL backend, very few pipeline states. Indeed an API trace of an application using FastUIDraw will see only a handful of draw calls per frame, even under high Canvas state trashing, and high clip state changes. Indeed, for the GL backend, only one Canvas state change invokes a pipeline state change: changing the blend mode.

The class to execute drawing is fastuidraw::Painter which supplies the expected standard drawing features: stroking and filling paths, drawing text, applying a brush (image and/or gradient), blending (including all Porter-Duff modes), a 3x3 transformation allowing for perspective drawing, clipping in by a rectangle or filled path and clipping out by a filled path.

In addition, FastUIDraw gives an application the ability to make their own shaders for custom drawing.

Concepts

If one needs to create its own custom way of drawing, one needs to know the drawing concepts in FastUIDraw. There are three distinct ingredients of drawing in FastUIDraw:

The GL/GLES backends of FastUIDraw represents shaders as portions of GLSL shader code, see the classes fastuidraw::glsl::PainterItemShaderGLSL, fastuidraw::glsl::PainterBlendShaderGLSL and fastuidraw::glsl::PainterBrushShaderGLSL for the shader class types and their interfaces.

Examples