Rename {draw,fill}_viewport once more (to draw_border_viewport and fill_viewport) and remove the viewport parameter as suggested by Dave Chapman.

The parameter wasn't used yet and it's not clear whether it should be a absolute or relative viewport.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28242 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-10-11 01:19:55 +00:00
parent 1f0ab7c9e6
commit 3022a60cc2
9 changed files with 21 additions and 27 deletions

View file

@ -69,7 +69,7 @@ static void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num)
vp.width = button_width-1; vp.width = button_width-1;
vp.x = button_width * num; vp.x = button_width * num;
display->set_viewport(&vp); display->set_viewport(&vp);
display->fill_viewport_rect(NULL); display->fill_viewport();
if(buttonbar->caption[num][0] != 0) if(buttonbar->caption[num][0] != 0)
{ {
display->getstringsize(buttonbar->caption[num], &fw, &fh); display->getstringsize(buttonbar->caption[num], &fw, &fh);

View file

@ -163,7 +163,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
#endif #endif
vp.drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); vp.drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
screen->fill_viewport_rect(NULL); screen->fill_viewport();
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
if (screen->depth > 1) if (screen->depth > 1)
@ -174,7 +174,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
#endif #endif
vp.drawmode = DRMODE_SOLID; vp.drawmode = DRMODE_SOLID;
screen->draw_viewport_rect(NULL); screen->draw_border_viewport();
/* prepare putting the text */ /* prepare putting the text */
y = RECT_SPACING; y = RECT_SPACING;

View file

@ -280,7 +280,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi
{ {
display->set_viewport(vp); display->set_viewport(vp);
display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
display->fill_viewport_rect(NULL); display->fill_viewport();
display->set_drawmode(DRMODE_SOLID); display->set_drawmode(DRMODE_SOLID);
if (bar->info.battery_state) if (bar->info.battery_state)

View file

@ -129,7 +129,7 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
} }
/* Draw bounding box around the button location. */ /* Draw bounding box around the button location. */
lcd->draw_viewport_rect(NULL); lcd->draw_border_viewport();
} }
} }
lcd->set_viewport(NULL); /* Go back to the default viewport */ lcd->set_viewport(NULL); /* Go back to the default viewport */

View file

@ -162,8 +162,8 @@ struct screen screens[NB_SCREENS] =
.update_viewport_rect=&lcd_update_viewport_rect, .update_viewport_rect=&lcd_update_viewport_rect,
.fillrect=&lcd_fillrect, .fillrect=&lcd_fillrect,
.drawrect=&lcd_drawrect, .drawrect=&lcd_drawrect,
.draw_viewport_rect=&lcd_draw_viewport_rect, .draw_border_viewport=&lcd_draw_border_viewport,
.fill_viewport_rect=&lcd_fill_viewport_rect, .fill_viewport=&lcd_fill_viewport,
.drawpixel=&lcd_drawpixel, .drawpixel=&lcd_drawpixel,
.drawline=&lcd_drawline, .drawline=&lcd_drawline,
.vline=&lcd_vline, .vline=&lcd_vline,
@ -255,8 +255,8 @@ struct screen screens[NB_SCREENS] =
.update_viewport_rect=&lcd_remote_update_viewport_rect, .update_viewport_rect=&lcd_remote_update_viewport_rect,
.fillrect=&lcd_remote_fillrect, .fillrect=&lcd_remote_fillrect,
.drawrect=&lcd_remote_drawrect, .drawrect=&lcd_remote_drawrect,
.draw_viewport_rect=&lcd_remote_draw_viewport_rect, .draw_border_viewport=&lcd_remote_draw_border_viewport,
.fill_viewport_rect=&lcd_remote_fill_viewport_rect, .fill_viewport=&lcd_remote_fill_viewport,
.drawpixel=&lcd_remote_drawpixel, .drawpixel=&lcd_remote_drawpixel,
.drawline=&lcd_remote_drawline, .drawline=&lcd_remote_drawline,
.vline=&lcd_remote_vline, .vline=&lcd_remote_vline,

View file

@ -117,8 +117,8 @@ struct screen
void (*update_viewport_rect)(int x, int y, int width, int height); void (*update_viewport_rect)(int x, int y, int width, int height);
void (*fillrect)(int x, int y, int width, int height); void (*fillrect)(int x, int y, int width, int height);
void (*drawrect)(int x, int y, int width, int height); void (*drawrect)(int x, int y, int width, int height);
void (*fill_viewport_rect)(const struct viewport *vp); void (*fill_viewport)(void);
void (*draw_viewport_rect)(const struct viewport *vp); void (*draw_border_viewport)(void);
void (*drawpixel)(int x, int y); void (*drawpixel)(int x, int y);
void (*drawline)(int x1, int y1, int x2, int y2); void (*drawline)(int x1, int y1, int x2, int y2);
void (*vline)(int x, int y1, int y2); void (*vline)(int x, int y1, int y2);

View file

@ -82,25 +82,19 @@ static void lcd_gradient_rect(int x1, int x2, int y, unsigned h,
#endif #endif
/* /*
* draws the borders of the viewport, or of current_vp if vp == NULL * draws the borders of the current viewport
**/ **/
void LCDFN(draw_viewport_rect)(const struct viewport *vp) void LCDFN(draw_border_viewport)(void)
{ {
if (vp == NULL) LCDFN(drawrect)(0, 0, current_vp->width, current_vp->height);
LCDFN(drawrect)(0, 0, current_vp->width, current_vp->height);
else
LCDFN(drawrect)(vp->x, vp->y, vp->width, vp->height);
} }
/* /*
* fills the rectangle formed by vp or by current_vp if vp == NULL * fills the rectangle formed by current_vp
**/ **/
void LCDFN(fill_viewport_rect)(const struct viewport *vp) void LCDFN(fill_viewport)(void)
{ {
if (vp == NULL) LCDFN(fillrect)(0, 0, current_vp->width, current_vp->height);
LCDFN(fillrect)(0, 0, current_vp->width, current_vp->height);
else
LCDFN(fillrect)(vp->x, vp->y, vp->width, vp->height);
} }
/* put a string at a given pixel position, skipping first ofs pixel columns */ /* put a string at a given pixel position, skipping first ofs pixel columns */

View file

@ -178,8 +178,8 @@ extern void lcd_remote_hline(int x1, int x2, int y);
extern void lcd_remote_vline(int x, int y1, int y2); extern void lcd_remote_vline(int x, int y1, int y2);
extern void lcd_remote_drawrect(int x, int y, int width, int height); extern void lcd_remote_drawrect(int x, int y, int width, int height);
extern void lcd_remote_fillrect(int x, int y, int width, int height); extern void lcd_remote_fillrect(int x, int y, int width, int height);
extern void lcd_remote_draw_viewport_rect(const struct viewport *vp); extern void lcd_remote_draw_border_viewport(const struct viewport *vp);
extern void lcd_remote_fill_viewport_rect(const struct viewport *vp); extern void lcd_remote_fill_viewport(const struct viewport *vp);
extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x,
int src_y, int stride, int x, int y, int src_y, int stride, int x, int y,
int width, int height); int width, int height);

View file

@ -507,8 +507,8 @@ extern void lcd_hline(int x1, int x2, int y);
extern void lcd_vline(int x, int y1, int y2); extern void lcd_vline(int x, int y1, int y2);
extern void lcd_drawrect(int x, int y, int width, int height); extern void lcd_drawrect(int x, int y, int width, int height);
extern void lcd_fillrect(int x, int y, int width, int height); extern void lcd_fillrect(int x, int y, int width, int height);
extern void lcd_draw_viewport_rect(const struct viewport *vp); extern void lcd_draw_border_viewport(void);
extern void lcd_fill_viewport_rect(const struct viewport *vp); extern void lcd_fill_viewport(void);
extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y, extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
int stride, int x, int y, int width, int height); int stride, int x, int y, int width, int height);
extern void lcd_bitmap(const fb_data *src, int x, int y, int width, extern void lcd_bitmap(const fb_data *src, int x, int y, int width,