diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-12 15:32:17 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-12 15:32:17 +0000 |
commit | be27f4dff3e949b012d7fac9b872fc911123cf3a (patch) | |
tree | 6cd069c304b9ae8a2eca48109f0d72a291abf91f | |
parent | 76ce56250c48af053aa08d0cea613962a75c5cbe (diff) | |
download | libgraphics-be27f4dff3e949b012d7fac9b872fc911123cf3a.tar.gz libgraphics-be27f4dff3e949b012d7fac9b872fc911123cf3a.tar.bz2 libgraphics-be27f4dff3e949b012d7fac9b872fc911123cf3a.zip |
fb: little memdrawing optimization.
-rw-r--r-- | fb.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -364,6 +364,7 @@ framebufctl_memdraw(Framebufctl *ctl, Memimage *dst, char *name, Point off, Poin Raster *r, *r2; Rectangle sr, dr; Memimage *tmp; + uchar *bdata0; qlock(ctl); fb = ctl->getfb(ctl); @@ -403,8 +404,10 @@ framebufctl_memdraw(Framebufctl *ctl, Memimage *dst, char *name, Point off, Poin if(tmp == nil) sysfatal("allocmemimage: %r"); - loadmemimage(tmp, sr, (uchar*)r->data, Dx(fb->r)*Dy(r->r)*4); + bdata0 = tmp->data->bdata; + tmp->data->bdata = (void*)r->data; memimagedraw(dst, rectaddpt(sr, dst->r.min), tmp, ZP, nil, ZP, S); + tmp->data->bdata = bdata0; freememimage(tmp); }else if(rectclip(&sr, dr)){ tmp = allocmemimage(sr, RGBA32); |