mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 09:13:08 +03:00
Make pan routines use new screen copy API
svn path=/trunk/netsurf/; revision=9715
This commit is contained in:
parent
c3f2972d03
commit
6c271f148b
@ -368,7 +368,7 @@ fb_redraw_fill(fbtk_widget_t *root, fbtk_widget_t *widget, void *pw)
|
||||
nsfb_plot_rectangle_fill(root->u.root.fb, &bbox, widget->bg);
|
||||
}
|
||||
|
||||
nsfb_release(root->u.root.fb, &bbox);
|
||||
nsfb_update(root->u.root.fb, &bbox);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ fb_redraw_hscroll(fbtk_widget_t *root, fbtk_widget_t *widget, void *pw)
|
||||
|
||||
nsfb_plot_rectangle_fill(root->u.root.fb, &rect, widget->bg);
|
||||
|
||||
nsfb_release(root->u.root.fb, &bbox);
|
||||
nsfb_update(root->u.root.fb, &bbox);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -462,7 +462,7 @@ fb_redraw_vscroll(fbtk_widget_t *root, fbtk_widget_t *widget, void *pw)
|
||||
|
||||
nsfb_plot_rectangle_fill(root->u.root.fb, &rect, widget->bg);
|
||||
|
||||
nsfb_release(root->u.root.fb, &bbox);
|
||||
nsfb_update(root->u.root.fb, &bbox);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -488,7 +488,7 @@ fb_redraw_bitmap(fbtk_widget_t *root, fbtk_widget_t *widget, void *pw)
|
||||
/* plot the image */
|
||||
nsfb_plot_bitmap(root->u.root.fb, &rect, (nsfb_colour_t *)widget->u.bitmap.bitmap->pixdata, widget->u.bitmap.bitmap->width, widget->u.bitmap.bitmap->height, widget->u.bitmap.bitmap->width, !widget->u.bitmap.bitmap->opaque);
|
||||
|
||||
nsfb_release(root->u.root.fb, &bbox);
|
||||
nsfb_update(root->u.root.fb, &bbox);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -617,7 +617,7 @@ fb_redraw_text(fbtk_widget_t *root, fbtk_widget_t *widget, void *pw)
|
||||
&root_style);
|
||||
}
|
||||
|
||||
nsfb_release(root->u.root.fb, &bbox);
|
||||
nsfb_update(root->u.root.fb, &bbox);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -126,7 +126,8 @@ static void fb_pan(fbtk_widget_t *widget,
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
nsfb_bbox_t redraw_box;
|
||||
nsfb_bbox_t srcbox;
|
||||
nsfb_bbox_t dstbox;
|
||||
|
||||
c = bw->current_content;
|
||||
|
||||
@ -174,18 +175,17 @@ static void fb_pan(fbtk_widget_t *widget,
|
||||
|
||||
if (bwidget->pany < 0) {
|
||||
/* pan up by less then viewport height */
|
||||
redraw_box.x0 = x;
|
||||
redraw_box.y0 = y - bwidget->pany;
|
||||
redraw_box.x1 = redraw_box.x0 + width;
|
||||
redraw_box.y1 = redraw_box.y0 + height + bwidget->pany;
|
||||
|
||||
srcbox.x0 = x;
|
||||
srcbox.y0 = y;
|
||||
|
||||
dstbox.x0 = x;
|
||||
dstbox.y0 = y - bwidget->pany;
|
||||
dstbox.x1 = dstbox.x0 + width;
|
||||
dstbox.y1 = dstbox.y0 + height + bwidget->pany;
|
||||
|
||||
/* move part that remains visible up */
|
||||
nsfb_claim(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb,
|
||||
x, y,
|
||||
width, height + bwidget->pany,
|
||||
x, y - bwidget->pany);
|
||||
nsfb_release(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb, &srcbox, &dstbox);
|
||||
|
||||
/* redraw newly exposed area */
|
||||
bwidget->scrolly += bwidget->pany;
|
||||
@ -194,18 +194,17 @@ static void fb_pan(fbtk_widget_t *widget,
|
||||
|
||||
if (bwidget->pany > 0) {
|
||||
/* pan down by less then viewport height */
|
||||
redraw_box.x0 = x;
|
||||
redraw_box.y0 = y;
|
||||
redraw_box.x1 = redraw_box.x0 + width;
|
||||
redraw_box.y1 = redraw_box.y0 + height - bwidget->pany;
|
||||
|
||||
srcbox.x0 = x;
|
||||
srcbox.y0 = y + bwidget->pany;
|
||||
|
||||
dstbox.x0 = x;
|
||||
dstbox.y0 = y;
|
||||
dstbox.x1 = dstbox.x0 + width;
|
||||
dstbox.y1 = dstbox.y0 + height - bwidget->pany;
|
||||
|
||||
/* move part that remains visible down */
|
||||
nsfb_claim(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb,
|
||||
x, y + bwidget->pany,
|
||||
width, height - bwidget->pany,
|
||||
x, y);
|
||||
nsfb_release(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb, &srcbox, &dstbox);
|
||||
|
||||
/* redraw newly exposed area */
|
||||
bwidget->scrolly += bwidget->pany;
|
||||
@ -215,18 +214,17 @@ static void fb_pan(fbtk_widget_t *widget,
|
||||
|
||||
if (bwidget->panx < 0) {
|
||||
/* pan left by less then viewport width */
|
||||
redraw_box.x0 = x - bwidget->panx;
|
||||
redraw_box.y0 = y;
|
||||
redraw_box.x1 = redraw_box.x0 + width + bwidget->panx;
|
||||
redraw_box.y1 = redraw_box.y0 + height;
|
||||
|
||||
srcbox.x0 = x;
|
||||
srcbox.y0 = y;
|
||||
|
||||
dstbox.x0 = x - bwidget->panx;
|
||||
dstbox.y0 = y;
|
||||
dstbox.x1 = dstbox.x0 + width + bwidget->panx;
|
||||
dstbox.y1 = dstbox.y0 + height;
|
||||
|
||||
/* move part that remains visible left */
|
||||
nsfb_claim(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb,
|
||||
x, y,
|
||||
width + bwidget->panx, height,
|
||||
x - bwidget->panx, y);
|
||||
nsfb_release(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb, &srcbox, &dstbox);
|
||||
|
||||
/* redraw newly exposed area */
|
||||
bwidget->scrollx += bwidget->panx;
|
||||
@ -235,18 +233,16 @@ static void fb_pan(fbtk_widget_t *widget,
|
||||
|
||||
if (bwidget->panx > 0) {
|
||||
/* pan right by less then viewport width */
|
||||
redraw_box.x0 = x;
|
||||
redraw_box.y0 = y;
|
||||
redraw_box.x1 = redraw_box.x0 + width - bwidget->panx;
|
||||
redraw_box.y1 = redraw_box.y0 + height;
|
||||
srcbox.x0 = x + bwidget->panx;
|
||||
srcbox.y0 = y;
|
||||
|
||||
dstbox.x0 = x;
|
||||
dstbox.y0 = y;
|
||||
dstbox.x1 = dstbox.x0 + width - bwidget->panx;
|
||||
dstbox.y1 = dstbox.y0 + height;
|
||||
|
||||
/* move part that remains visible right */
|
||||
nsfb_claim(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb,
|
||||
x + bwidget->panx, y,
|
||||
width - bwidget->panx, height,
|
||||
x, y);
|
||||
nsfb_release(nsfb, &redraw_box);
|
||||
nsfb_plot_copy(nsfb, &srcbox, &dstbox);
|
||||
|
||||
/* redraw newly exposed area */
|
||||
bwidget->scrollx += bwidget->panx;
|
||||
@ -302,7 +298,7 @@ static void fb_redraw(fbtk_widget_t *widget,
|
||||
bw->scale, 0xFFFFFF);
|
||||
current_redraw_browser = NULL;
|
||||
|
||||
nsfb_release(fbtk_get_nsfb(widget), &bwidget->redraw_box);
|
||||
nsfb_update(fbtk_get_nsfb(widget), &bwidget->redraw_box);
|
||||
|
||||
bwidget->redraw_box.y0 = bwidget->redraw_box.x0 = INT_MAX;
|
||||
bwidget->redraw_box.y1 = bwidget->redraw_box.x1 = -(INT_MAX);
|
||||
|
Loading…
Reference in New Issue
Block a user