Changeset c79545e in mainline for uspace/srv/hid/display/seat.c
- Timestamp:
- 2020-01-19T10:00:11Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2012fe0
- Parents:
- 946a666
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/seat.c
r946a666 rc79545e 139 139 * @param len Cross length 140 140 * @param w Cross extra width 141 * @param br Brightness (0 to 65535)141 * @param color Color 142 142 * 143 143 * @return EOK on success or an error code 144 144 */ 145 145 static errno_t ds_seat_draw_cross(ds_seat_t *seat, gfx_coord_t len, 146 gfx_coord_t w, uint16_t br) 147 { 148 gfx_color_t *color = NULL; 146 gfx_coord_t w, gfx_color_t *color) 147 { 149 148 gfx_context_t *gc; 150 149 gfx_rect_t rect, r0; … … 154 153 if (gc == NULL) 155 154 return EOK; 156 157 rc = gfx_color_new_rgb_i16(br, br, br, &color);158 if (rc != EOK)159 goto error;160 155 161 156 rc = gfx_set_color(gc, color); … … 183 178 goto error; 184 179 185 gfx_color_delete(color);186 180 return EOK; 187 181 error: 188 if (color != NULL)189 gfx_color_delete(color);190 182 return rc; 191 183 } … … 201 193 { 202 194 errno_t rc; 203 204 rc = ds_seat_draw_cross(seat, 8, 1, 0); 195 gfx_color_t *black = NULL; 196 gfx_color_t *white; 197 198 rc = gfx_color_new_rgb_i16(0, 0, 0, &black); 199 if (rc != EOK) 200 goto error; 201 202 rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &white); 203 if (rc != EOK) 204 goto error; 205 206 rc = ds_seat_draw_cross(seat, 8, 1, shown ? black : 207 seat->display->bg_color); 205 208 if (rc != EOK) 206 209 return rc; 207 210 208 rc = ds_seat_draw_cross(seat, 8, 0, shown ? 65535 : 0); 211 rc = ds_seat_draw_cross(seat, 8, 0, shown ? white : 212 seat->display->bg_color); 209 213 if (rc != EOK) 210 214 return rc; 211 215 212 216 return EOK; 217 error: 218 if (black != NULL) 219 gfx_color_delete(black); 220 return rc; 213 221 } 214 222
Note:
See TracChangeset
for help on using the changeset viewer.