Optimise some more line drawing calls.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17083 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-04-12 09:51:16 +00:00
parent b6213bbf98
commit fef82552e1
10 changed files with 53 additions and 68 deletions

View file

@ -502,13 +502,11 @@ void cal_initial (void)
/* draw lines */
rb->lcd_drawrect(X_0_POS, Y_0_POS, LCD_WIDTH-1, LCD_HEIGHT);
rb->lcd_drawline(X_0_POS, Y_1_POS-1, X_5_POS, Y_1_POS-1);
rb->lcd_hline(X_0_POS, X_5_POS, Y_1_POS-1);
for (i = 0; i < 5 ; i++)
rb->lcd_drawline(X_0_POS, Y_1_POS+i*REC_HEIGHT,
X_5_POS, Y_1_POS+i*REC_HEIGHT);
rb->lcd_hline(X_0_POS, X_5_POS, Y_1_POS+i*REC_HEIGHT);
for (i = 0; i < 4 ; i++)
rb->lcd_drawline(X_1_POS+i*REC_WIDTH, Y_1_POS,
X_1_POS+i*REC_WIDTH, Y_6_POS);
rb->lcd_vline(X_1_POS+i*REC_WIDTH, Y_1_POS, Y_6_POS);
#ifdef CALCULATOR_OPERATORS
/* basic operators are available through separate button */

View file

@ -114,7 +114,7 @@ static void draw_headers(void)
rb->lcd_putsxy(ws, 0 , Dayname[i++]);
ws += space;
}
rb->lcd_drawline(0 ,h ,LCD_WIDTH-1 ,h);
rb->lcd_hline(0, LCD_WIDTH-1 ,h);
}
static bool day_has_memo[31];
@ -170,8 +170,8 @@ static void draw_calendar(struct shown *shown)
ws = 2;
}
}
rb->lcd_drawline(60,LCD_HEIGHT-h-3,60,LCD_HEIGHT-1);
rb->lcd_drawline(60,LCD_HEIGHT-h-3,LCD_WIDTH-1,LCD_HEIGHT-h-3);
rb->lcd_vline(60,LCD_HEIGHT-h-3,LCD_HEIGHT-1);
rb->lcd_hline(60,LCD_WIDTH-1,LCD_HEIGHT-h-3);
rb->snprintf(buffer,9,"%s %04d",Monthname[shown->mon-1],shown->year);
rb->lcd_putsxy(62,(LCD_HEIGHT-h-1),buffer);
shown->lastday = pos;

View file

@ -220,20 +220,15 @@ void draw_hour(struct screen* display, struct time* time,
void draw_center_cover(struct screen* display)
{
display->drawline((display->width/2)-1, (display->height/2)+3,
(display->width/2)+1, (display->height/2)+3);
display->drawline((display->width/2)-3, (display->height/2)+2,
(display->width/2)+3, (display->height/2)+2);
display->drawline((display->width/2)-4, (display->height/2)+1,
(display->width/2)+4, (display->height/2)+1);
display->drawline((display->width/2)-4, display->height/2,
(display->width/2)+4, display->height/2);
display->drawline((display->width/2)-4, (display->height/2)-1,
(display->width/2)+4, (display->height/2)-1);
display->drawline((display->width/2)-3, (display->height/2)-2,
(display->width/2)+3, (display->height/2)-2);
display->drawline((display->width/2)-1, (display->height/2)-3,
(display->width/2)+1, (display->height/2)-3);
display->hline((display->width/2)-1,
(display->width/2)+1, (display->height/2)+3);
display->hline((display->width/2)-3,
(display->width/2)+3, (display->height/2)+2);
display->fillrect((display->width/2)-4, (display->height/2)-1, 9, 3);
display->hline((display->width/2)-3,
(display->width/2)+3, (display->height/2)-2);
display->hline((display->width/2)-1,
(display->width/2)+1, (display->height/2)-3);
}
void analog_clock_draw(struct screen* display, struct time* time,

View file

@ -188,7 +188,7 @@ void metronome_draw(struct screen* display)
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_LCD_BITMAP
display->drawline(0, 12, 111, 12);
display->hline(0, 111, 12);
if(sound_paused)
display->puts(0,2,METRONOME_MSG_START);
else

View file

@ -1000,7 +1000,7 @@ static unsigned int pegbox_menu(struct game_context* pb) {
rb->lcd_putsxy((LCD_WIDTH)/4, 40, "Quit");
if(!can_resume)
rb->lcd_drawline((LCD_WIDTH)/4, 28, (LCD_WIDTH)/4+30, 28);
rb->lcd_hline((LCD_WIDTH)/4, (LCD_WIDTH)/4+30, 28);
rb->lcd_putsxy((LCD_WIDTH)/4-8, loc*8+16, "*");

View file

@ -2461,10 +2461,10 @@ static void inv_cursor(bool update)
rb->lcd_set_foreground(COLOR_BLACK);
rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
/* cross painting */
rb->lcd_drawline(x-4,y,x-1,y);
rb->lcd_drawline(x+1,y,x+4,y);
rb->lcd_drawline(x,y-4,x,y-1);
rb->lcd_drawline(x,y+1,x,y+4);
rb->lcd_hline(x-4,x-1,y);
rb->lcd_hline(x+1,x+4,y);
rb->lcd_vline(x,y-4,y-1);
rb->lcd_vline(x,y+1,y+4);
rb->lcd_set_foreground(rp_colors[drawcolor]);
rb->lcd_set_drawmode(DRMODE_SOLID);

View file

@ -338,10 +338,10 @@ static void redraw_osci(void)
{
if (osci_buffer[x] > 0)
{
rb->lcd_drawline
rb->lcd_vline
(
OSCI_X + x, OSCI_Y + OSCI_HEIGHT - 1,
OSCI_X + x, OSCI_Y + OSCI_HEIGHT - osci_buffer[x] - 1
OSCI_Y + OSCI_HEIGHT - osci_buffer[x] - 1
);
}
}
@ -977,10 +977,10 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
int i;
for (i = lastx +1; i <= x; i++)
{
rb->lcd_drawline
rb->lcd_vline
(
i, OSCI_Y + OSCI_HEIGHT - 1,
i, OSCI_Y + OSCI_HEIGHT - osci_buffer[i - OSCI_X]-1
OSCI_Y + OSCI_HEIGHT - osci_buffer[i - OSCI_X]-1
);
}
}
@ -1007,8 +1007,8 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
);
rb->lcd_set_drawmode(DRMODE_SOLID);
}
rb->lcd_drawline(split_x -2, OSCI_Y, split_x + 2, OSCI_Y);
rb->lcd_drawline(split_x-1, OSCI_Y+1, split_x +1,OSCI_Y+1);
rb->lcd_hline(split_x -2, split_x + 2, OSCI_Y);
rb->lcd_hline(split_x-1, split_x +1,OSCI_Y+1);
}
/* make visible */

View file

@ -355,12 +355,10 @@ void draw_board(void) {
}
rb->lcd_set_foreground(LCD_BLACK);
for(i=0;i<=10;i++) { /* Draw Horizontal lines */
rb->lcd_drawline(MARGIN, MARGIN+(BOX_HEIGHT*i), MARGIN+(BOX_WIDTH*10),
MARGIN+(BOX_HEIGHT*i));
rb->lcd_hline(MARGIN, MARGIN+(BOX_WIDTH*10), MARGIN+(BOX_HEIGHT*i));
}
for(i=0;i<=10;i++) { /* Draw Vertical lines */
rb->lcd_drawline(MARGIN+(BOX_WIDTH*i),MARGIN, MARGIN+(BOX_WIDTH*i),
MARGIN+(BOX_HEIGHT*10));
rb->lcd_vline(MARGIN+(BOX_WIDTH*i), MARGIN, MARGIN+(BOX_HEIGHT*10));
}
rb->lcd_update();
}
@ -688,14 +686,12 @@ int get_number(char* param, int* value) {
/* Draw a 3x4 grid */
int i,j,x=0,y=0;
for(i=0;i<=3;i++) { /* Vertical lines */
rb->lcd_drawline(NUM_MARGIN_X+(NUM_BOX_WIDTH*i), NUM_MARGIN_Y,
NUM_MARGIN_X+(NUM_BOX_WIDTH*i),
NUM_MARGIN_Y+(4*NUM_BOX_HEIGHT));
rb->lcd_vline(NUM_MARGIN_X+(NUM_BOX_WIDTH*i), NUM_MARGIN_Y,
NUM_MARGIN_Y+(4*NUM_BOX_HEIGHT));
}
for(i=0;i<=4;i++) { /* Horizontal lines */
rb->lcd_drawline(NUM_MARGIN_X, NUM_MARGIN_Y+(i*NUM_BOX_HEIGHT),
NUM_MARGIN_X+(3*NUM_BOX_WIDTH),
NUM_MARGIN_Y+(NUM_BOX_HEIGHT*i));
rb->lcd_hline(NUM_MARGIN_X, NUM_MARGIN_X+(3*NUM_BOX_WIDTH),
NUM_MARGIN_Y+(NUM_BOX_HEIGHT*i));
}
int temp = 1;
for(i=0;i<3;i++) {

View file

@ -561,8 +561,8 @@ void analog_meter(void) {
rb->lcd_putsxy(half_width+quarter_width-12, 12, "Right");
/* Line above/below the Left/Right text */
rb->lcd_drawline(0,9,LCD_WIDTH-1,9);
rb->lcd_drawline(0,21,LCD_WIDTH-1,21);
rb->lcd_hline(0,LCD_WIDTH-1,9);
rb->lcd_hline(0,LCD_WIDTH-1,21);
for(i=0; i<half_width; i++) {
rb->lcd_drawpixel(i, (y_values[i])-2);
@ -613,18 +613,18 @@ void digital_meter(void) {
draw_digital_minimeters();
/* Lines above/below where the LEDS are */
rb->lcd_drawline(0,12,LCD_WIDTH-1,12);
rb->lcd_drawline(0,half_height-12,LCD_WIDTH-1,half_height-12);
rb->lcd_hline(0,LCD_WIDTH-1,12);
rb->lcd_hline(0,LCD_WIDTH-1,half_height-12);
rb->lcd_drawline(0,half_height+18,LCD_WIDTH-1,half_height+18);
rb->lcd_drawline(0,LCD_HEIGHT-6,LCD_WIDTH-1,LCD_HEIGHT-6);
rb->lcd_hline(0,LCD_WIDTH-1,half_height+18);
rb->lcd_hline(0,LCD_WIDTH-1,LCD_HEIGHT-6);
/* Show Left/Right */
rb->lcd_putsxy(2, half_height-8, "Left");
rb->lcd_putsxy(2, half_height+8, "Right");
/* Line in the middle */
rb->lcd_drawline(0,half_height+3,LCD_WIDTH-1,half_height+3);
rb->lcd_hline(0,LCD_WIDTH-1,half_height+3);
}
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {

View file

@ -289,26 +289,22 @@ int displaypeaks(void)
rb->lcd_clear_display();
rb->lcd_drawline(0, LEFTZERO - (0x8000 / YSCALE), LCD_WIDTH-1,
LEFTZERO - (0x8000 / YSCALE));
rb->lcd_drawline(0, LEFTZERO, LCD_WIDTH-1, LEFTZERO);
rb->lcd_drawline(0, LEFTZERO + (0x8000 / YSCALE), LCD_WIDTH-1,
LEFTZERO + (0x8000 / YSCALE));
rb->lcd_drawline(0, RIGHTZERO - (0x8000 / YSCALE), LCD_WIDTH-1,
RIGHTZERO - (0x8000 / YSCALE));
rb->lcd_drawline(0, RIGHTZERO, LCD_WIDTH-1, RIGHTZERO);
rb->lcd_drawline(0, RIGHTZERO + (0x8000 / YSCALE), LCD_WIDTH-1,
RIGHTZERO + (0x8000 / YSCALE));
rb->lcd_hline(0, LCD_WIDTH-1, LEFTZERO - (0x8000 / YSCALE));
rb->lcd_hline(0, LCD_WIDTH-1, LEFTZERO);
rb->lcd_hline(0, LCD_WIDTH-1, LEFTZERO + (0x8000 / YSCALE));
rb->lcd_hline(0, LCD_WIDTH-1, RIGHTZERO - (0x8000 / YSCALE));
rb->lcd_hline(0, LCD_WIDTH-1, RIGHTZERO);
rb->lcd_hline(0, LCD_WIDTH-1, RIGHTZERO + (0x8000 / YSCALE));
#if LCD_DEPTH > 1
rb->lcd_set_foreground(LCD_BLACK);
#endif
/* draw zoombar */
rb->lcd_drawline(leftmargin / (mempeakcount / LCD_WIDTH), LCD_HEIGHT / 2,
(leftmargin / (mempeakcount / LCD_WIDTH)) +
rb->lcd_hline(leftmargin / (mempeakcount / LCD_WIDTH),
(leftmargin / (mempeakcount / LCD_WIDTH)) +
(LCD_WIDTH / zoomlevel),
LCD_HEIGHT / 2);
LCD_HEIGHT / 2);
while((x < LCD_WIDTH) && (peakcount < mempeakcount))
{
@ -324,10 +320,10 @@ int displaypeaks(void)
if(0 == (peakcount % ppp))
{
/* drawing time */
rb->lcd_drawline(x, LEFTZERO - (lymax / YSCALE), x,
LEFTZERO - (lymin / YSCALE));
rb->lcd_drawline(x, RIGHTZERO - (rymax / YSCALE), x,
RIGHTZERO - (rymin / YSCALE));
rb->lcd_vline(x, LEFTZERO - (lymax / YSCALE),
LEFTZERO - (lymin / YSCALE));
rb->lcd_vline(x, RIGHTZERO - (rymax / YSCALE),
RIGHTZERO - (rymin / YSCALE));
lymin = INT_MAX;
lymax = INT_MIN;
rymin = INT_MAX;