text: bblit: remove unused private data

The bit-blitting renderer does not really use the helper structure so
remove it and simplify the code a lot.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
misc: remove log references

The static-* code does not depend on the log subsystem so it should not
include the header nor define some internal logging helpers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
terminal: remove OpenGL drawing stubs

Drawing with OpenGL didn't work, so we can safely remove the stubs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video: drm: adopt new libgbm API

libgbm changed the API (why?) so we need to use get_stride() instead of
get_pitch().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: move font_char_attr to text.h

This way we can now remove all font.h includes. We can rename the
structure later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
font: remove font.h

This header is unused so we can remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
terminal: remove gl.h include

We do not use this header inside of the terminal subsystem so we can
remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
gl: remove GL subsystem

The GL subsystem is no longer used so we can remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
genshader: make shader generation more flexible

The genshader program now takes all input shaders as arguments so we can
easily add new shaders. We also name the constants after the shader file
to be as flexible as possible.

This also moves the generated shaders into the static-kmscon library. The
linker will strip unused symbols, anyway, so we aren't loosing anything
here.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
static: add gl math helpers

These are the same helpers that were previously removed, however, they are
now part of the static-kmscon library and can be stripped away by the
linker.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
llog: mark llog_format as unused

Gcc emits useless warnings when llog_format is not used so mark it as
unused.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
misc: fix rehashing hashtable entries

We need to hash the key instead of the whole entry, otherwise, we have
dead/wrong entries in the hash-table after a rehash-round.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
misc: fix returning false in kmscon_hashtable_find() when invalid

We currently return "true" if the hashtable is invalid which is
irritating. Fix this to be "false".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
gl: add shader helpers

New helper functions for working with OpenGL shaders.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video: drm: implement .blit, .blend and .fill callbacks

This implements the static 2D blitting callbacks for the DRM backend. It
uses OpenGL to push the images with textures through the rendering
pipeline. Please note that this is horribly slow when used like 2D
blitting. However, it is a safe backend and better than nothing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: make bblit backend optional

This allows configuring the bblit backend during kmscon-build. If other
rendering backends are preferred, you can now compile kmscon without the
bblit backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video: drm: reset vertex-attrib-arrays after use

We should reset all used vertex-attrib-arrays, otherwise, we have to reset
them before drawing as we cannot sure that some other renderer left them
on.
As a rule we always assume a reset state similar to our assumption that no
VBO is bound during rendering.

This is a quite bad side-effect from OpenGL being a state-machine. As we
are a library, we cannot make any undocumented assumptions about the
OpenGL state. Therefore, we try to be as strict as possible.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: rework text renderer system

This reworks the text renderer system to make it easier to write backends.
We also allow returning errors during rendering now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: gltex: add OpenGL text renderer

This adds an OpenGL text renderer. It uses textures to store glyph
information and renders the characters by assembling a vertex-list first.
To improve performance, we use texture-atlases.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: fix choosing fallback backend

We didn't correctly choose the fallback backend but instead used the
last-registered backend. Fix this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>