Changeset 23809


Ignore:
Timestamp:
09/21/13 11:30:57 (10 years ago)
Author:
nit
Message:

[titan] optimize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/skin.h

    r23808 r23809  
    9393        if(ostrcmp("getplaytext", value) == 0)
    9494                return &getplaytext;
    95   if(ostrcmp("getbufferstatus", value) == 0)
     95        if(ostrcmp("getbufferstatus", value) == 0)
    9696        {
    9797                *rettype = FUNCPROGRESS;
     
    133133                return &getsignal;
    134134        }
    135   if(ostrcmp("getrecfreesizetext", value) == 0)
     135        if(ostrcmp("getrecfreesizetext", value) == 0)
    136136                return &getrecfreesizetext;
    137137        if(ostrcmp("getwlanlinkqualitytext", value) == 0)
     
    15141514int drawjpgsw(struct jpeg_decompress_struct* cinfo, unsigned char* buf, int posx, int posy, int width, int height, int colbytes, int mwidth, int mheight, int scalewidth, int scaleheight, int halign, int valign)
    15151515{
    1516         int aktline = 0, x = 0, py = 0, px = 0, row_stride = 0;
     1516        int aktline = 0, x = 0, py = 0, px = 0, row_stride = 0, pyw = 0;
     1517        int width4 = width * 4, width8 = width * 8, aktline1 = 0;
    15171518        unsigned char red, green, blue;
    15181519        unsigned long color = 0;
     
    15291530                row_stride = width * colbytes;
    15301531
    1531         if(accelfb != NULL && accelfb->varfbsize > width * 8 && (scalewidth != 0 || scaleheight != 0) && (scalewidth != width || scaleheight != height))
     1532        if(accelfb != NULL && accelfb->varfbsize > width8 && (scalewidth != 0 || scaleheight != 0) && (scalewidth != width || scaleheight != height))
    15321533        {
    15331534                if(halign == CENTER)
     
    15541555
    15551556                                py++;
     1557                                pyw = width * py;
    15561558                                for(x = 0; x < width; x++)
    15571559                                {
     
    15671569                                                color = (255 << 24) | (red << 16) | (red << 8) | red;
    15681570
    1569                                         drawpixelfb(accelfb, (width * py) + x, 0, color);
     1571                                        drawpixelfb(accelfb, pyw + x, 0, color);
    15701572                                }
    15711573
    1572                                 if((py * width * 4) + (width * 8) >= accelfb->varfbsize)
     1574                                if((py * width4) + (width8) >= accelfb->varfbsize)
    15731575                                {
    15741576                                        py++;
     
    15911593                        while(aktline < height)
    15921594                        {
     1595                                aktline1 = aktline * row_stride;
    15931596                                aktline++;
    15941597
    15951598                                py++;
     1599                                pyw = width * py;
    15961600                                for(x = 0; x < width; x++)
    15971601                                {
    15981602                                        px = colbytes * x;
    1599                                         red = buf[((aktline - 1) * row_stride) + px];
     1603                                        red = buf[aktline1 + px];
    16001604                                        if(colbytes > 2)
    16011605                                        {
    1602                                                 green = buf[((aktline - 1) * row_stride) + (px + 1)];
    1603                                                 blue = buf[((aktline - 1) * row_stride) + (px + 2)];
     1606                                                green = buf[aktline1 + (px + 1)];
     1607                                                blue = buf[aktline1 + (px + 2)];
    16041608                                                color = (255 << 24) | (red << 16) | (green << 8) | blue;
    16051609                                        }
     
    16071611                                                color = (255 << 24) | (red << 16) | (red << 8) | red;
    16081612
    1609                                         drawpixelfb(accelfb, (width * py) + x, 0, color);
     1613                                        drawpixelfb(accelfb, pyw + x, 0, color);
    16101614                                }
    16111615
    1612                                 if((py * width * 4) + (width * 8) >= accelfb->varfbsize)
     1616                                if((py * width4) + (width8) >= accelfb->varfbsize)
    16131617                                {
    16141618                                        py++;
     
    16601664                        else
    16611665                                aktline++;
     1666                               
     1667                        aktline1 = (aktline - 1) * row_stride;
    16621668
    16631669                        py = (posy + aktline - 1) * skinfb->width;
     
    16691675                                        red = buffer[0][px];
    16701676                                else
    1671                                         red = buf[((aktline - 1) * row_stride) + px];
     1677                                        red = buf[aktline1 + px];
    16721678
    16731679                                if(colbytes > 2)
     
    16811687                                        else
    16821688                                        {
    1683                                                 green = buf[((aktline - 1) * row_stride) + (px + 1)];
    1684                                                 blue = buf[((aktline - 1) * row_stride) + (px + 2)];
     1689                                                green = buf[aktline1 + (px + 1)];
     1690                                                blue = buf[aktline1 + (px + 2)];
    16851691                                                color = (255 << 24) | (red << 16) | (green << 8) | blue;
    16861692                                        }
Note: See TracChangeset for help on using the changeset viewer.