diff options
author | Billy Biggs <vektor@dumbterm.net> | 2005-08-10 22:03:00 +0000 |
---|---|---|
committer | Billy Biggs <vektor@dumbterm.net> | 2005-08-10 22:03:00 +0000 |
commit | b25c1203d8d313d9b44f29e4b0d1329dddd42dbe (patch) | |
tree | 2c93b23d9be0f7b6796913643ab90552b2939432 /pixman | |
parent | 58c51ff1378ce749b78a2edac622100c8873efb8 (diff) |
Add support for filling 1bpp images (used to clear A1 masks).
Diffstat (limited to 'pixman')
-rw-r--r-- | pixman/ChangeLog | 5 | ||||
-rw-r--r-- | pixman/src/icrect.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/pixman/ChangeLog b/pixman/ChangeLog index f2cc05f4..c81dd990 100644 --- a/pixman/ChangeLog +++ b/pixman/ChangeLog @@ -1,3 +1,8 @@ +2005-08-11 Billy Biggs <vektor@dumbterm.net> + + * src/icrect.c: (pixman_fill_rect_1bpp), (pixman_color_rects): + Add support for filling 1bpp images (used to clear A1 masks). + 2005-08-10 Billy Biggs <vektor@dumbterm.net> reviewed by: cworth and Jeff Muizelaar at various stages diff --git a/pixman/src/icrect.c b/pixman/src/icrect.c index ac62d3ae..bd110713 100644 --- a/pixman/src/icrect.c +++ b/pixman/src/icrect.c @@ -31,6 +31,25 @@ typedef void (*FillFunc) (pixman_image_t *dst, static void +pixman_fill_rect_1bpp (pixman_image_t *dst, + int16_t xDst, + int16_t yDst, + uint16_t width, + uint16_t height, + pixman_bits_t *pixel) +{ + char value = *pixel ? 0xff : 0; + char *line; + + line = (char *)dst->pixels->data + + xDst + yDst * dst->pixels->stride; + while (height-- > 0) { + memset (line, value, (width + 7) / 8); + line += dst->pixels->stride; + } +} + +static void pixman_fill_rect_8bpp (pixman_image_t *dst, int16_t xDst, int16_t yDst, @@ -174,6 +193,8 @@ pixman_color_rects (pixman_image_t *dst, func = pixman_fill_rect_8bpp; else if (dst->pixels->bpp == 32) func = pixman_fill_rect_32bpp; + else if (dst->pixels->bpp == 1) + func = pixman_fill_rect_1bpp; else func = pixman_fill_rect_general; |