graphics/nxbe: Fix more cursor-related problems. Currently cursor is presented but the system dies due to memory corruption.

This commit is contained in:
Gregory Nutt 2019-04-10 14:59:43 -06:00
parent ad76ca674b
commit b91b2cafd0
2 changed files with 3 additions and 9 deletions

View File

@ -217,8 +217,8 @@ void nxbe_cursor_setimage(FAR struct nxbe_state_s *be,
/* Save the new colors */
nxgl_colorcopy(be->cursor.color1, image->color1);
nxgl_colorcopy(be->cursor.color1, image->color2);
nxgl_colorcopy(be->cursor.color1, image->color3);
nxgl_colorcopy(be->cursor.color2, image->color2);
nxgl_colorcopy(be->cursor.color3, image->color3);
/* Save the new image. This is a reference to an image in user space.
* which we assume will persist while we use it.

View File

@ -84,15 +84,12 @@ static NXGL_PIXEL_T nxbe_map_color(FAR struct nxbe_state_s *be, int plane,
case 1:
return be->cursor.color1[plane];
break;
case 2:
return be->cursor.color2[plane];
break;
case 3:
return be->cursor.color3[plane];
break;
}
}
@ -169,7 +166,7 @@ void NXGL_FUNCNAME(nxglib_cursor_draw, NXGLIB_SUFFIX)
*/
fbmem = (FAR uint8_t *)plane->pinfo.fbmem;
sline = be->cursor.image + sstride * origin.y + (origin.y >> 2);
sline = be->cursor.image + sstride * origin.y + (origin.x >> 2);
dline = (FAR uint8_t *)fbmem + dstride * be->cursor.bounds.pt1.y +
NXGL_SCALEX(be->cursor.bounds.pt1.x);
@ -202,9 +199,6 @@ void NXGL_FUNCNAME(nxglib_cursor_draw, NXGLIB_SUFFIX)
*dest = nxbe_map_color(be, 0, pixel);
}
/* Update to the next column */
col++;
dest++;
/* Was that the last pixel in the byte? */