~vanvugt/compiz/blacklist

« back to all changes in this revision

Viewing changes to plugins/wall/src/wall.cpp

Minor Performance Optimizations:

* Return ASAP./Prevent executing any unnecessary operations if we return.
* Used De Morgan's laws to merge and simplify if statements.

Other Changes:

* C++ Style: Declared iterator variables inside the for loops they are used in.
* No logic changes have been made.

Approved by Daniel van Vugt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    float           outline = 2.0f;
71
71
    int             width, height, radius;
72
72
    float           r, g, b, a;
73
 
    unsigned int    i, j;
74
73
 
75
74
    destroyCairoContext (switcherContext);
76
75
    setupCairoContext (switcherContext);
124
123
    cairo_restore (cr);
125
124
 
126
125
    cairo_save (cr);
127
 
    for (i = 0; i < (unsigned int) screen->vpSize ().height (); i++)
 
126
    for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().height (); i++)
128
127
    {
129
128
        cairo_translate (cr, 0.0, viewportBorder);
130
129
        cairo_save (cr);
131
 
        for (j = 0; j < (unsigned int) screen->vpSize ().width (); j++)
 
130
        for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().width (); j++)
132
131
        {
133
132
            cairo_translate (cr, viewportBorder, 0.0);
134
133
 
949
948
    float             width, height;
950
949
    float             topLeftX, topLeftY;
951
950
    float             border;
952
 
    unsigned int      i, j;
953
951
    GLTexture::Matrix matrix;
954
952
    BOX               box;
955
953
    GLMatrix          wTransform (transform);
1020
1018
    height = (float) thumbContext.height;
1021
1019
 
1022
1020
    thumbContext.texture[0]->enable (GLTexture::Fast);
1023
 
    for (i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
 
1021
    for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
1024
1022
    {
1025
 
        for (j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
 
1023
        for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
1026
1024
        {
1027
1025
            if (i == gotoX && j == gotoY && moving)
1028
1026
                continue;
1197
1195
 
1198
1196
        if (optionGetMiniscreen ())
1199
1197
        {
1200
 
            unsigned int i, j;
1201
1198
            float        mw, mh;
1202
1199
 
1203
1200
            mw = viewportWidth;
1209
1206
            mSAttribs.opacity = OPAQUE * (1.0 + mSzCamera);
1210
1207
            mSAttribs.saturation = COLOR;
1211
1208
 
1212
 
            for (j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
 
1209
            for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
1213
1210
            {
1214
 
                for (i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
 
1211
                for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
1215
1212
                {
1216
1213
                    float        mx, my;
1217
1214
                    unsigned int msMask;