Changeset 7358f5b in mainline
- Timestamp:
- 2020-09-30T19:13:31Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 38a4b6d
- Parents:
- 57d923e1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfxfont/src/glyph.c
r57d923e1 r7358f5b 274 274 * @param glyph Glyph 275 275 * @param offs Offset in new font bitmap 276 * @param d estNew font bitmap277 * @param d rect Bounding rectangle for @a dest276 * @param dbmp New font bitmap 277 * @param dbrect Bounding rectangle for @a dbmp 278 278 * 279 279 * @return EOK on success or an error code 280 280 */ 281 281 errno_t gfx_glyph_transfer(gfx_glyph_t *glyph, gfx_coord_t offs, 282 gfx_bitmap_t *d est, gfx_rect_t *drect)282 gfx_bitmap_t *dbmp, gfx_rect_t *dbrect) 283 283 { 284 284 pixelmap_t smap; … … 286 286 gfx_bitmap_alloc_t salloc; 287 287 gfx_bitmap_alloc_t dalloc; 288 gfx_rect_t drect; 288 289 gfx_coord_t x, y; 290 gfx_coord2_t off2; 289 291 pixel_t pixel; 290 292 errno_t rc; … … 294 296 return rc; 295 297 296 rc = gfx_bitmap_get_alloc(d est, &dalloc);298 rc = gfx_bitmap_get_alloc(dbmp, &dalloc); 297 299 if (rc != EOK) 298 300 return rc; … … 302 304 smap.data = salloc.pixels; 303 305 304 dmap.width = d rect->p1.x;305 dmap.height = d rect->p1.y;306 dmap.width = dbrect->p1.x; 307 dmap.height = dbrect->p1.y; 306 308 dmap.data = dalloc.pixels; 307 309 308 for (y = drect->p0.y; y < drect->p1.y; y++) { 309 for (x = drect->p0.x; x < drect->p1.x; x++) { 310 /* Compute destination rectangle */ 311 off2.x = offs; 312 off2.y = 0; 313 gfx_rect_translate(&off2, &glyph->rect, &drect); 314 assert(gfx_rect_is_inside(&drect, dbrect)); 315 316 for (y = drect.p0.y; y < drect.p1.y; y++) { 317 for (x = drect.p0.x; x < drect.p1.x; x++) { 310 318 pixel = pixelmap_get_pixel(&smap, x, y); 311 319 pixelmap_put_pixel(&dmap, x + offs, y, pixel);
Note:
See TracChangeset
for help on using the changeset viewer.