graphics/nxglib: use putarea for lcd copyrectangle when available

For LCD drivers that implement putarea(), use it to copy the entire
rectangle in a single call instead of per-row putrun() calls. This
avoids the per-row overhead of setting the display window
(CASET+RASET over SPI) for every scanline.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3
2026-04-02 20:11:38 +08:00
committed by simbit18
parent 439ec6c09b
commit bcb1332792
@@ -75,8 +75,18 @@ void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX)
xoffset = dest->pt1.x - origin->x;
sline = (FAR const uint8_t *)src + NXGL_SCALEX(xoffset) +
(dest->pt1.y - origin->y) * srcstride;
#if NXGLIB_BITSPERPIXEL < 8
remainder = NXGL_REMAINDERX(xoffset);
#else
if (pinfo->putarea != NULL)
{
pinfo->putarea(pinfo->dev,
dest->pt1.y, dest->pt2.y,
dest->pt1.x, dest->pt2.x,
sline, srcstride);
return;
}
#endif
/* Copy the image, one row at a time */