diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-09-12 15:23:15 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-09-12 15:23:15 +0200 |
commit | 2df4fc0d31ac534f35efb71e0e8cc6909bc2a571 (patch) | |
tree | 37e65803e026f97ed30c8aa0c6524fec9f0349fc /src/uterm_video.c | |
parent | 87c99634381562660ee5f7d35cf773c46b134f85 (diff) |
uterm: video: add *_display_fake_blend(v) requests
Instead of requiring to use uterm_screen objects we now add a
fake_blendv() request directly to the display object. We rename it to
"fake_blend" instead of just "blend" so we can later implement real
blending.
This reuses the existing infrastructure. But the fake_blendv is the way to
go so we rename the existing functions to "fake_*" either.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/uterm_video.c')
-rw-r--r-- | src/uterm_video.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/uterm_video.c b/src/uterm_video.c index 5b09465..24c5b4f 100644 --- a/src/uterm_video.c +++ b/src/uterm_video.c @@ -412,6 +412,41 @@ int uterm_display_swap(struct uterm_display *disp) return VIDEO_CALL(disp->ops->swap, 0, disp); } +int uterm_display_fake_blend(struct uterm_display *disp, + const struct uterm_video_buffer *buf, + unsigned int x, unsigned int y, + uint8_t fr, uint8_t fg, uint8_t fb, + uint8_t br, uint8_t bg, uint8_t bb) +{ + struct uterm_video_blend_req req; + + if (!disp) + return -EINVAL; + + memset(&req, 0, sizeof(req)); + req.buf = buf; + req.x = x; + req.y = y; + req.fr = fr; + req.fg = fg; + req.fb = fb; + req.br = br; + req.bg = bg; + req.bb = bb; + + return VIDEO_CALL(disp->ops->fake_blendv, -EOPNOTSUPP, disp, &req, 1); +} + +int uterm_display_fake_blendv(struct uterm_display *disp, + const struct uterm_video_blend_req *req, + size_t num) +{ + if (!disp) + return -EINVAL; + + return VIDEO_CALL(disp->ops->fake_blendv, -EOPNOTSUPP, disp, req, num); +} + int uterm_video_new(struct uterm_video **out, struct ev_eloop *eloop, unsigned int type, |