Changeset 62018a0 in mainline for uspace/srv/hid/display/cursor.c
- Timestamp:
- 2020-06-24T12:32:04Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8630748
- Parents:
- 2fc1e6d
- git-author:
- Jiri Svoboda <jiri@…> (2020-06-23 18:31:47)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-06-24 12:32:04)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/cursor.c
r2fc1e6d r62018a0 89 89 * @param cursor Cusor to paint 90 90 * @param pos Position to paint at 91 * @param clip Clipping rectangle or @c NULL 91 92 * @return EOK on success or an error code 92 93 */ 93 errno_t ds_cursor_paint(ds_cursor_t *cursor, gfx_coord2_t *pos) 94 errno_t ds_cursor_paint(ds_cursor_t *cursor, gfx_coord2_t *pos, 95 gfx_rect_t *clip) 94 96 { 95 97 gfx_context_t *dgc; … … 98 100 gfx_bitmap_alloc_t alloc; 99 101 gfx_coord2_t dims; 102 gfx_rect_t sclip; 103 gfx_rect_t srect; 100 104 pixelmap_t pixelmap; 101 105 pixel_t pixel; … … 150 154 } 151 155 152 return gfx_bitmap_render(cursor->bitmap, NULL, pos); 156 /* Determine source rectangle */ 157 if (clip == NULL) { 158 srect = cursor->rect; 159 } else { 160 gfx_rect_rtranslate(pos, clip, &sclip); 161 gfx_rect_clip(&cursor->rect, &sclip, &srect); 162 } 163 164 if (!gfx_rect_is_empty(&srect)) { 165 rc = gfx_bitmap_render(cursor->bitmap, &srect, pos); 166 if (rc != EOK) 167 return rc; 168 } 169 170 return EOK; 153 171 error: 154 172 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.