Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/6ca908a192427f2269b77...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/6ca908a192427f2269b778d...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/6ca908a192427f2269b778d6f...
The branch, master has been updated
via 6ca908a192427f2269b778d6f2b4be72656378e3 (commit)
from b50743a2538b95c172999796d9b6ebae0538673c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=6ca908a192427f2269b...
commit 6ca908a192427f2269b778d6f2b4be72656378e3
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Use libnsfb's tiled bitmap function, instead of tiling ourselves.
diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c
index da80a13..c2d73ac 100644
--- a/framebuffer/framebuffer.c
+++ b/framebuffer/framebuffer.c
@@ -172,13 +172,14 @@ framebuffer_plot_bitmap(int x, int y,
struct bitmap *bitmap, colour bg,
bitmap_flags_t flags)
{
- int xf,yf;
nsfb_bbox_t loc;
nsfb_bbox_t clipbox;
bool repeat_x = (flags & BITMAPF_REPEAT_X);
bool repeat_y = (flags & BITMAPF_REPEAT_Y);
int bmwidth;
int bmheight;
+ int bmstride;
+ enum nsfb_format_e bmformat;
unsigned char *bmptr;
nsfb_t *bm = (nsfb_t *)bitmap;
@@ -199,8 +200,8 @@ framebuffer_plot_bitmap(int x, int y,
}
nsfb_plot_get_clip(nsfb, &clipbox);
- nsfb_get_geometry(bm, &bmwidth, &bmheight, NULL);
- nsfb_get_buffer(bm, &bmptr, NULL);
+ nsfb_get_geometry(bm, &bmwidth, &bmheight, &bmformat);
+ nsfb_get_buffer(bm, &bmptr, &bmstride);
/* Optimise tiled plots of 1x1 bitmaps by replacing with a flat fill
* of the area. Can only be done when image is fully opaque. */
@@ -231,23 +232,19 @@ framebuffer_plot_bitmap(int x, int y,
if (repeat_y)
for (; y > clipbox.y0; y -= height);
- /* tile down and across to extents */
- for (xf = x; xf < clipbox.x1; xf += width) {
- for (yf = y; yf < clipbox.y1; yf += height) {
-
- loc.x0 = xf;
- loc.y0 = yf;
- loc.x1 = loc.x0 + width;
- loc.y1 = loc.y0 + height;
+ /* set up top left tile location */
+ loc.x0 = x;
+ loc.y0 = y;
+ loc.x1 = loc.x0 + width;
+ loc.y1 = loc.y0 + height;
- nsfb_plot_copy(bm, NULL, nsfb, &loc);
+ /* plot tiling across and down to extents */
+ nsfb_plot_bitmap_tiles(nsfb, &loc,
+ repeat_x ? ((clipbox.x1 - x) + width - 1) / width : 1,
+ repeat_y ? ((clipbox.y1 - y) + height - 1) / height : 1,
+ (nsfb_colour_t *)bmptr, bmwidth, bmheight,
+ bmstride * 8 / 32, bmformat == NSFB_FMT_ABGR8888);
- if (!repeat_y)
- break;
- }
- if (!repeat_x)
- break;
- }
return true;
}
-----------------------------------------------------------------------
Summary of changes:
framebuffer/framebuffer.c | 33 +++++++++++++++------------------
1 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c
index da80a13..c2d73ac 100644
--- a/framebuffer/framebuffer.c
+++ b/framebuffer/framebuffer.c
@@ -172,13 +172,14 @@ framebuffer_plot_bitmap(int x, int y,
struct bitmap *bitmap, colour bg,
bitmap_flags_t flags)
{
- int xf,yf;
nsfb_bbox_t loc;
nsfb_bbox_t clipbox;
bool repeat_x = (flags & BITMAPF_REPEAT_X);
bool repeat_y = (flags & BITMAPF_REPEAT_Y);
int bmwidth;
int bmheight;
+ int bmstride;
+ enum nsfb_format_e bmformat;
unsigned char *bmptr;
nsfb_t *bm = (nsfb_t *)bitmap;
@@ -199,8 +200,8 @@ framebuffer_plot_bitmap(int x, int y,
}
nsfb_plot_get_clip(nsfb, &clipbox);
- nsfb_get_geometry(bm, &bmwidth, &bmheight, NULL);
- nsfb_get_buffer(bm, &bmptr, NULL);
+ nsfb_get_geometry(bm, &bmwidth, &bmheight, &bmformat);
+ nsfb_get_buffer(bm, &bmptr, &bmstride);
/* Optimise tiled plots of 1x1 bitmaps by replacing with a flat fill
* of the area. Can only be done when image is fully opaque. */
@@ -231,23 +232,19 @@ framebuffer_plot_bitmap(int x, int y,
if (repeat_y)
for (; y > clipbox.y0; y -= height);
- /* tile down and across to extents */
- for (xf = x; xf < clipbox.x1; xf += width) {
- for (yf = y; yf < clipbox.y1; yf += height) {
-
- loc.x0 = xf;
- loc.y0 = yf;
- loc.x1 = loc.x0 + width;
- loc.y1 = loc.y0 + height;
+ /* set up top left tile location */
+ loc.x0 = x;
+ loc.y0 = y;
+ loc.x1 = loc.x0 + width;
+ loc.y1 = loc.y0 + height;
- nsfb_plot_copy(bm, NULL, nsfb, &loc);
+ /* plot tiling across and down to extents */
+ nsfb_plot_bitmap_tiles(nsfb, &loc,
+ repeat_x ? ((clipbox.x1 - x) + width - 1) / width : 1,
+ repeat_y ? ((clipbox.y1 - y) + height - 1) / height : 1,
+ (nsfb_colour_t *)bmptr, bmwidth, bmheight,
+ bmstride * 8 / 32, bmformat == NSFB_FMT_ABGR8888);
- if (!repeat_y)
- break;
- }
- if (!repeat_x)
- break;
- }
return true;
}
--
NetSurf Browser