Teeui layout and rendering
This patch includes a new written-from-scratch layout and rendering
engine for minimal UIs for restricted runtime environments, e.g.,
Trusted Executionenvironments (TEEs), such as Trusty.
* A layout language that allows specification of dimensions and
absolute and relative positions in pixels (px), millimeters (mm), or
density independent pixels (dp). The latter are commonly used by
UX designers. The layout language is a DSL that is understood by a
modern C++ compiler (C++17). During instantiation of the layout the,
device specific, conversion factors need to be provided. The size of
the instantiated layout is known at compile time so that it can be
instantiated on the stack or the bss section of the program without
dynamic allocation at runtime. With the exception of font rendering,
all layout and rendering steps are performed without dynamic memory
allocation as well.
* The teeui library includes a label element. The label element is for
positioning and rendering text. Within a label element, text can be
left and right justified and vertically top or center aligned. As of
now, the font renderer is based on libfreetype. libteeui includes
code for decoding utf8 code points and code for computing the
bounding box of text, as well as for breaking text on word
* The teeui library includes a button element. It can currently draw a
colored box with rounded corners. The radius of the corners can be
configured, and the to-be-rounded corners can be toggled individually.
Currently, the button supports drawing of a set of convex objects.
The teeui library also provides algorithms to compute the
intersection of convex objects. This is currently used to compute the
area of a pixel covered by an object for antialiased rasterization.
This is wildly inefficient, and leaves room for optimization. But it
produces very good results.
Test: Tests come in following commits.
11 files changed