This is an automated email from the ASF dual-hosted git repository.
simbit18 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new bcb13327925 graphics/nxglib: use putarea for lcd copyrectangle when
available
bcb13327925 is described below
commit bcb133279259216c1509cfc4b986c81c536e59fc
Author: wangjianyu3 <[email protected]>
AuthorDate: Thu Apr 2 20:11:38 2026 +0800
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 <[email protected]>
---
graphics/nxglib/lcd/nxglib_copyrectangle.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/graphics/nxglib/lcd/nxglib_copyrectangle.c
b/graphics/nxglib/lcd/nxglib_copyrectangle.c
index 0631f9e0a69..952bda3f212 100644
--- a/graphics/nxglib/lcd/nxglib_copyrectangle.c
+++ b/graphics/nxglib/lcd/nxglib_copyrectangle.c
@@ -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 */