diff options
author | rodri <rgl@antares-labs.eu> | 2024-02-27 11:29:06 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-02-27 11:29:06 +0000 |
commit | e0baf147d655409b721e41b0e3effabd39a96b34 (patch) | |
tree | ddfe6bbcaa5651650e8ff1f6e0b3b4dcc0bf07ee /fb.c | |
parent | c0bc9d332f3ab51a43d5e3d0da2d5a32e938b1d2 (diff) | |
download | libgraphics-e0baf147d655409b721e41b0e3effabd39a96b34.tar.gz libgraphics-e0baf147d655409b721e41b0e3effabd39a96b34.tar.bz2 libgraphics-e0baf147d655409b721e41b0e3effabd39a96b34.zip |
have separate routines for drawing and memdrawing.
Diffstat (limited to 'fb.c')
-rw-r--r-- | fb.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -9,7 +9,18 @@ #include "internal.h" static void -framebufctl_draw(Framebufctl *ctl, Memimage *dst) +framebufctl_draw(Framebufctl *ctl, Image *dst) +{ + Framebuf *fb; + + fb = ctl->fb[ctl->idx]; + lock(&ctl->swplk); + loadimage(dst, rectaddpt(fb->r, dst->r.min), byteaddr(fb->cb, fb->r.min), bytesperline(fb->r, fb->cb->depth)*Dy(fb->r)); + unlock(&ctl->swplk); +} + +static void +framebufctl_memdraw(Framebufctl *ctl, Memimage *dst) { lock(&ctl->swplk); memimagedraw(dst, dst->r, ctl->fb[ctl->idx]->cb, ZP, nil, ZP, SoverD); @@ -67,6 +78,7 @@ mkfbctl(Rectangle r) fc->fb[0] = mkfb(r); fc->fb[1] = mkfb(r); fc->draw = framebufctl_draw; + fc->memdraw = framebufctl_memdraw; fc->swap = framebufctl_swap; fc->reset = framebufctl_reset; return fc; |