~mc-return/compiz/compiz.merge-fix1196345-ccsm-key-caption-vertical-alignment-fixed

Viewing all changes in revision 3740.

Expo, code cleanup:

Declaration of local variables outside of loops.
Use prefix instead of postfix increments.
Declaration and assignment of local variables in one line, if possible.
Reduced the scope of some variables.
Removed redundant brackets.
Used static_cast <> (type) instead of (type) cast.
Added and removed newlines if appropriate.
Fixed indentation.
Added TODOs.

Expo, speed improvements:

Do not calculate screen->vpSize ().width () and screen->vpSize ().height ()
multiple times, instead save them in the unsigned ints vpCountHorz and
vpCountVert and use those variables instead.
Speed up the curve calculations by using additional variables to save results
to not have to re-calculate those all the time. The new variables introduced
are degToRad, screenWidth, screenWidthSquared, curveDistSquaredPlusQuarter,
pOne2MinusCurveDist, v0Squared and v2Squared.
Also introduced const float halfGapX = gapX / 2.0 and used this variable in the
calculations of curveDistance and curveRadius.
Simplified calculations of this type:
(M_PI / 180.0f) * curveAngle / 2.0, which is equal to: (M_PI / 360.0f) * curveAngle
Do not call optionGetGroundSize (); twice, instead save the value in the float
groundSize and use that variable in the following calculations.
Removed the creation of the redundant bool hide, which is just used once in an
if-condition check. It does not help to have this bool.
Try to avoid redundant GL_BLEND state changes, they are expensive - only enable
GL_BLEND if it is disabled and just disable it, if it was disabled before, otherwise
do nothing.
Try to avoid redundant GL filter changes - just query the filter state if the mipmap
option in CCSM is enabled. Also just set back the filter to the previous state if
we actually changed it, otherwise do nothing.
-5.5f * 2 = -11.0f.
No need to calculate M_PI / 180.0f 720 times:
Calculate this value once instead and save it in the const float mpi, use mpi
in the following looped calculations.
Use const int scw in the same loop instead of calling screen->width () 360 times.

glow.cpp:
Massively increased calculation speed of the glow texture:
No need for any macros here -> removed them and replaced them with local variables.
Precalculate values, store them in local variables and use those in the following
calculations (new variables are the ints winRealX, winRealY, winRealWidth, winRealHeight,
halfWinRealWidth, halfWinRealHeight, xPlusHalfWidth, yPlusHalfHeight, xPlusGlowOff,
yPlusGlowOff, xMinusGlowOff, yMinusGlowOff and the float glowPart).
Used w->geometry ().widthIncBorders () and w->geometry ().heightIncBorders ()
to determine winRealWidth and winRealHeight.

Expo, fixes:

Do not force "One wall per output" on the user, if his displays use different
resolutions.
"One big wall" makes a lot of sense for many multi-screen configs, where not
all of the screens have exactly the same resolution, so if the user explicitely
chooses this mode, Compiz should respect the user's choice.

(LP: #1009592). Fixes: https://bugs.launchpad.net/bugs/1009592.

Approved by PS Jenkins bot, Sam Spilsbury, Sami Jaktholm.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: