Changeset 0a9a324 in mainline for fb/fb.c


Ignore:
Timestamp:
2006-06-08T16:42:20Z (18 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8bd0316
Parents:
7674793
Message:

Speed update for frame buffer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fb/fb.c

    r7674793 r0a9a324  
    224224}
    225225
    226 /** Fill line with color BGCOLOR */
    227 static void clear_line(int vp, unsigned int y)
    228 {
    229         unsigned int x;
    230         for (x = 0; x < viewports[vp].width; x++)
    231                 putpixel(vp, x, y, viewports[vp].style.bg_color);
     226static inline void putpixel_mem(char *mem, unsigned int x, unsigned int y,
     227                                int color)
     228{
     229        (*screen.rgb2scr)(&mem[POINTPOS(x,y)],color);
    232230}
    233231
     
    237235{
    238236        unsigned int x, y;
     237        static void *tmpline;
     238
     239        if (!tmpline)
     240                tmpline = malloc(screen.scanline*screen.pixelbytes);
    239241
    240242        /* Clear first line */
    241243        for (x = 0; x < width; x++)
    242                 putpixel(vp, sx + x, sy, color);
     244                putpixel_mem(tmpline, x, 0, color);
    243245
    244246        /* Recompute to screen coords */
     
    246248        sy += viewports[vp].y;
    247249        /* Copy the rest */
    248         for (y = sy+1;y < sy+height; y++)
    249                 memcpy(&screen.fbaddress[POINTPOS(sx,y)],
    250                        &screen.fbaddress[POINTPOS(sx,sy)],
     250        for (y = sy;y < sy+height; y++)
     251                memcpy(&screen.fbaddress[POINTPOS(sx,y)], tmpline,
    251252                       screen.pixelbytes * width);
    252253
Note: See TracChangeset for help on using the changeset viewer.