A simple drawing library and some wayland ports
mforney at mforney.org
Fri Jul 26 01:02:34 PDT 2013
A while back I was interested in porting dmenu and st to wayland.
However, the available rendering stack (cairo + pango + glib +
opengl/pixman) seemed a bit overkill to me when all I needed was two
simple operations, "fill rectangle with color" and "draw monochrome text
So I ended up writing a simple drawing library called wld which
implements these two operations. Right now there are two backends, one
that uses pixman, and one for Intel GPUs which uses the BLT engine
(using a library I wrote called libintelbatch). The intel backend is
only tested with my (rather old now) GEN5 laptop, but shouldn't be hard
to get working with newer chips. Also, the pixman renderer should work
wld uses FreeType for rendering text, and currently only supports
monochrome output, but this may change in the future (should be trivial
with the pixman backend, probably more complicated with the intel one).
wld does not actually require wayland to be installed (so it can be used
for rendering in other contexts). However, with wayland, it can create
buffers using the wl_shm or wl_drm interfaces. It can also optionally
track damage for you and copy it from the front buffer and/or submit it
My wayland ports (using wld) of st and dmenu are available here (in the
dmenu ideally requires some sort of panel wayland protocol extension
(otherwise it spawns randomly about the screen). I mocked up an
example, and added support to my dmenu port in the wayland-panel
branch. However, I have not implemented support of panel.xml in weston.
Anyway, I hope you find this interesting. wld was done for my own
personal use, but maybe other projects along the same lines as st and
dmenu may find it useful. If you'd like to try dmenu or st under
wayland, but aren't interested in wld, it should be pretty
straightforward to make my ports use cairo or whatever instead.
Comments and questions are welcome!
Michael Forney <mforney at mforney.org>
More information about the wayland-devel