mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 01:39:44 +08:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user