diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2009-06-02 13:01:45 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2009-06-02 13:01:45 +0000 |
commit | 30edb722902dff842b5b9544f9b43846b93adc92 (patch) | |
tree | ade17d9dc0ec2985a82a767134d2f22c354d181b /src/32bpp_plotters.c | |
parent | 3d5b21e1473dbdee6c3df66d9ba2a9d657f1b486 (diff) | |
download | libnsfb-30edb722902dff842b5b9544f9b43846b93adc92.tar.gz libnsfb-30edb722902dff842b5b9544f9b43846b93adc92.tar.bz2 |
add cursor support
svn path=/trunk/libnsfb/; revision=7687
Diffstat (limited to 'src/32bpp_plotters.c')
-rw-r--r-- | src/32bpp_plotters.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/32bpp_plotters.c b/src/32bpp_plotters.c index 2456f58..232a000 100644 --- a/src/32bpp_plotters.c +++ b/src/32bpp_plotters.c @@ -322,7 +322,7 @@ glyph8(nsfb_t *nsfb, static bool bitmap(nsfb_t *nsfb, - nsfb_bbox_t *loc, + const nsfb_bbox_t *loc, const nsfb_colour_t *pixel, int bmp_width, int bmp_height, @@ -356,8 +356,9 @@ bitmap(nsfb_t *nsfb, clipped.x1 = x + width; clipped.y1 = y + height; - if (!nsfb_plot_clip_ctx(nsfb, &clipped)) + if (!nsfb_plot_clip_ctx(nsfb, &clipped)) { return true; + } if (height > (clipped.y1 - clipped.y0)) height = (clipped.y1 - clipped.y0); @@ -399,7 +400,29 @@ bitmap(nsfb_t *nsfb, return true; } +static bool readrect(nsfb_t *nsfb, nsfb_bbox_t *rect, nsfb_colour_t *buffer) +{ + uint32_t *pvideo; + int xloop, yloop; + int width; + + if (!nsfb_plot_clip_ctx(nsfb, rect)) { + return true; + } + + width = rect->x1 - rect->x0; + + pvideo = get_xy_loc(nsfb, rect->x0, rect->y0); + for (yloop = rect->y0; yloop < rect->y1; yloop += 1) { + for (xloop = 0; xloop < width; xloop++) { + *buffer = pixel_to_colour(*(pvideo + xloop)); + buffer++; + } + pvideo += (nsfb->linelen >> 2); + } + return true; +} const nsfb_plotter_fns_t _nsfb_32bpp_plotters = { .line = line, @@ -408,6 +431,7 @@ const nsfb_plotter_fns_t _nsfb_32bpp_plotters = { .bitmap = bitmap, .glyph8 = glyph8, .glyph1 = glyph1, + .readrect = readrect, }; /* |