summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_display.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-12-03 20:43:58 +1100
committerJonathan Gordon <rockbox@jdgordon.info>2012-12-09 17:11:19 +1100
commit685cf5900825b10c952f36301abbbd9968567435 (patch)
tree41cdfed9e5a2943c80ac0d4ffe09c45519a3ecf3 /apps/gui/skin_engine/skin_display.c
parent1fbdc280d7e4b4ffb7ec8dccbfd1c1fc67f1c123 (diff)
downloadrockbox-685cf5900825b10c952f36301abbbd9968567435.tar.gz
rockbox-685cf5900825b10c952f36301abbbd9968567435.zip
9 segment bitmap drawing:
Use %x9(id) to draw an image in the whole current viewport using the 9 segment drawer (which draws the corners as normal and *tiles* the middle segments to the needed width/height). Future work is to make it scale instead of tile Change-Id: Ic3ed1cad93f96091694801eb442e0da5a2401203
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rw-r--r--apps/gui/skin_engine/skin_display.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 4f491dea24..24958a46f2 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -302,17 +302,20 @@ void clear_image_pos(struct gui_wps *gwps, struct gui_img *img)
gwps->display->set_drawmode(DRMODE_SOLID);
}
-void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subimage)
+void wps_draw_image(struct gui_wps *gwps, struct gui_img *img,
+ int subimage, struct viewport* vp)
{
struct screen *display = gwps->display;
img->bm.data = core_get_data(img->buflib_handle);
display->set_drawmode(DRMODE_SOLID);
- display->bmp_part(&img->bm, 0, img->subimage_height * subimage,
- img->x, img->y, img->bm.width, img->subimage_height);
+ if (img->is_9_segment)
+ display->nine_segment_bmp(&img->bm, 0, 0, vp->width, vp->height);
+ else
+ display->bmp_part(&img->bm, 0, img->subimage_height * subimage,
+ img->x, img->y, img->bm.width, img->subimage_height);
}
-
void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
{
if(!gwps || !gwps->data || !gwps->display)
@@ -334,7 +337,7 @@ void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
{
if (img->display >= 0)
{
- wps_draw_image(gwps, img, img->display);
+ wps_draw_image(gwps, img, img->display, vp);
}
}
list = SKINOFFSETTOPTR(get_skin_buffer(data), list->next);