summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-13 18:16:22 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-13 18:16:22 +0000
commite38f4d2f1a2211ed03ac6418c460931194fa2870 (patch)
tree3108f42e2d931da80a49121c9bc6ff4c9e345cf2 /frontends
parent593ec1fbeab32d598bc4cc5de42bb0887ad0d520 (diff)
downloadnetsurf-e38f4d2f1a2211ed03ac6418c460931194fa2870.tar.gz
netsurf-e38f4d2f1a2211ed03ac6418c460931194fa2870.tar.bz2
Get render bitmap size via function
Diffstat (limited to 'frontends')
-rw-r--r--frontends/amiga/corewindow.c6
-rw-r--r--frontends/amiga/gui.c6
-rw-r--r--frontends/amiga/plotters.c6
-rw-r--r--frontends/amiga/plotters.h8
4 files changed, 22 insertions, 4 deletions
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index e6293453c..5fc5c3736 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -219,8 +219,8 @@ ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
struct IBox *bbox;
ULONG pos_x, pos_y;
struct rect draw_rect;
- int tile_size_x = ami_cw->gg->width;
- int tile_size_y = ami_cw->gg->height;
+ int tile_size_x;
+ int tile_size_y;
int tile_x, tile_y, tile_w, tile_h;
int x = r->x0;
int y = r->y0;
@@ -254,6 +254,8 @@ ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
y = pos_y;
}
+ ami_plot_ra_get_size(ami_cw->gg, &tile_size_x, &tile_size_y);
+
for(tile_y = y; tile_y < (y + height); tile_y += tile_size_y) {
tile_h = tile_size_y;
if(((y + height) - tile_y) < tile_size_y)
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 973f4e787..a8a1265d9 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -3524,8 +3524,10 @@ static void ami_do_redraw_tiled(struct gui_window_2 *gwin, bool busy,
struct gui_globals *glob = (struct gui_globals *)ctx->priv;
int x, y;
struct rect clip;
- int tile_size_x = glob->width;
- int tile_size_y = glob->height;
+ int tile_size_x;
+ int tile_size_y;
+
+ ami_plot_ra_get_size(glob, &tile_size_x, &tile_size_y);
int tile_x_scale = (int)(tile_size_x / gwin->gw->scale);
int tile_y_scale = (int)(tile_size_y / gwin->gw->scale);
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index e70a9a998..0f00bc415 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -265,6 +265,12 @@ struct BitMap *ami_plot_ra_get_bitmap(struct gui_globals *gg)
return gg->bm;
}
+void ami_plot_ra_get_size(struct gui_globals *gg, int *width, int *height)
+{
+ *width = gg->width;
+ *height = gg->height;
+}
+
void ami_plot_ra_set_pen_list(struct gui_globals *gg, struct MinList *pen_list)
{
gg->shared_pens = pen_list;
diff --git a/frontends/amiga/plotters.h b/frontends/amiga/plotters.h
index 4d2dc660c..ed89916e7 100644
--- a/frontends/amiga/plotters.h
+++ b/frontends/amiga/plotters.h
@@ -77,6 +77,14 @@ void ami_plot_ra_free(struct gui_globals *gg);
struct BitMap *ami_plot_ra_get_bitmap(struct gui_globals *gg);
/**
+ * Get size of BitMap associated with a render area
+ * \param gg render area
+ * \param width updated to BitMap width
+ * \param height updated to BitMap height
+ */
+void ami_plot_ra_get_size(struct gui_globals *gg, int *width, int *height);
+
+/**
* Set a list of shared pens for a render area to use
* Only relevant for palette-mapped screens
* \param gg render area