Changeset efca2e4 in mainline for uspace/lib/gfxfont/src/glyph_bmp.c


Ignore:
Timestamp:
2020-09-25T17:40:47Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd65f4f7
Parents:
16357ec
git-author:
Jiri Svoboda <jiri@…> (2020-09-24 19:40:35)
git-committer:
Jiri Svoboda <jiri@…> (2020-09-25 17:40:47)
Message:

Clear glyph using Ctrl-X

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfxfont/src/glyph_bmp.c

    r16357ec refca2e4  
    229229}
    230230
     231/** Clear glyph bitmap
     232 *
     233 * @param bmp Glyph bitmap
     234 *
     235 * @return EOK on sucesss, ENOMEM if out of memory
     236 */
     237errno_t gfx_glyph_bmp_clear(gfx_glyph_bmp_t *bmp)
     238{
     239        int *npixels;
     240
     241        /* Allocate new pixel array */
     242        npixels = calloc(sizeof(int), 1);
     243        if (npixels == NULL)
     244                return ENOMEM;
     245
     246        /* Switch new and old data */
     247        free(bmp->pixels);
     248        bmp->pixels = npixels;
     249        bmp->rect.p0.x = 0;
     250        bmp->rect.p0.y = 0;
     251        bmp->rect.p1.x = 0;
     252        bmp->rect.p1.y = 0;
     253
     254        return EOK;
     255}
     256
    231257/** Extend glyph bitmap to cover a patricular pixel.
    232258 *
Note: See TracChangeset for help on using the changeset viewer.