3776
|
|
cube.cpp, code cleanup:
#include "privates.h", not <privates.h>. Merged if condition checks. Declaration of variables, where you need them to improve the code structure and readability. Use C++ standard bool for topDir, bottomDir, allCaps and mCapsPainted[output] (bool true/false instead Bool TRUE/FALSE). Initialize all of the class member variables in the constructor. Replaced if (priv->mSky.size () > 0) with if (!priv->mSky.empty ()). Removed redundant brackets. Fixed indentation. Added TODO.
cube.cpp, code speedup:
Do not call optionGetInactiveOpacity () twice, instead save the value as float inactiveOpacity and use this variable in the following calculation. Introduced the variables float halfHsize = hsize / 2.0; and float tsSize = 360.0f / size; and used those in following calculations to not have to recalculate those values multiple times. Do not calculate M_PI / sides and 2 * M_PI / sides multiple times in loops, instead save those values in the GLfloats mps and tmps and use those values inside the loops. Use GLdouble mDist2 = 0.5 / mDistance; in the GLdouble clipPlane* arrays, instead of recalculating this value multiple times. Use GLfloat oneMinusFStepX = 1.0f - fStepX; and GLfloat oneMinusFStepY = 1.0f - fStepY; instead of calculating those values multiple times. Use float outputWidth = outputPtr->width (); and float outputHeight = outputPtr->height (); instead of calling the functions multiple times. Introduced the GLfloat normInvert = 0.5f * invert; and used this variable instead of recalculating this value multiple times. Introduced the GLfloats mSkyWidth and mSkyHeight and used those in the following loops instead of calling mSkySize.width () and mSkySize.height () multiple times. Try to avoid redundant GL_BLEND state changes, because OpenGL will blindly change the global state, no matter what it currently is set to and that state change is expensive. So we query and save the actual blending state in the variable GLboolean glBlendEnabled = glIsEnabled (GL_BLEND); and just enable it if it isn't already and just disable it, if it was disabled before.
(LP: #1101422, LP: #1195977)
cube.cpp, other fixes:
Return false in function PrivateCubeScreen::updateGeometry (int, int) if sides should ever be 0, which should never happen, but should make Coverity happy.
(LP: #1101541)
Initialize all class member variables in the PrivateCubeScreen:: PrivateCubeScreen (CompScreen *) constructor. (mTc, mNOutput, mOutput, mOutputMask, mCleared, mCapsPainted)
(LP: #1101575). Fixes: https://bugs.launchpad.net/bugs/1101422, https://bugs.launchpad.net/bugs/1101541, https://bugs.launchpad.net/bugs/1101575.
Approved by Sam Spilsbury, PS Jenkins bot.
|
MC Return |
|
11 years ago
|
|
|
3775
|
|
|
Sami Jaktholm |
|
11 years ago
|
|
|
3774
|
|
|
Sam Spilsbury |
|
11 years ago
|
|
|
3773
|
|
|
Sam Spilsbury |
v0.9.10.0 |
11 years ago
|
|
|
3772
|
|
|
Sami Jaktholm |
|
11 years ago
|
|
|
3771
|
|
|
MC Return |
|
11 years ago
|
|
|
3770
|
|
|
MC Return |
|
11 years ago
|
|
|
3769
|
|
Firepaint, code cleanup:
Declare variables outside of loops. Declaration and assignment of local variables in one line. Use pre- instead of postfix increment. Removed redundant newlines. Removed redundant casts. (from (float) optionGetFireColor) Removed redundant brackets. Added missing break (style issue only). Added comment and TODO. Fixed indentation.
Firepaint, speedup:
We just enable GL_BLEND if it is disabled and we just disable GL_BLEND if it was disabled before.
Introduced the GLfloats xMinusW, xPlusW, yMinusH and yPlusH to store calculated coordinates instead of recalculating them multiple times.
Introduced float fireLife = optionGetFireLife ();, float fireWidth = optionGetFireSize ();, float fireHeight = fireWidth * 1.5f; and bool mystFire = optionGetFireMystical (); and used those variables inside the loop.
Firepaint, .xml.in cleanup:
Firepaint now has 2 tabs, 'General' and 'Particle Settings'. The name of this plugin is Firepaint, <short> should not contain the description. Better description of the plugin. Uppercase option titles. Punctuation for tooltips. Improved tooltips.
Firepaint, fixes:
Initialize all class member variables in the ParticleSystem:: ParticleSystem () ctor (LP: #1101512, LP: #1101580). Fixes: https://bugs.launchpad.net/bugs/1101512, https://bugs.launchpad.net/bugs/1101580.
Approved by PS Jenkins bot, Sam Spilsbury.
|
MC Return |
|
11 years ago
|
|
|
3768
|
|
|
MC Return |
|
11 years ago
|
|
|
3767
|
|
|
BryanFRitt |
|
11 years ago
|
|
|
3766
|
|
|
Sami Jaktholm |
|
11 years ago
|
|
|
3765
|
|
|
Sam Spilsbury |
|
11 years ago
|
|
|
3764
|
|
|
Sam Spilsbury |
|
11 years ago
|
|
|
3763
|
|
|
Sam Spilsbury |
|
11 years ago
|
|
|
3762
|
|
|
Brandon Schaefer |
|
11 years ago
|
|
|
3761
|
|
|
Andrea Azzarone |
|
11 years ago
|
|
|
3760
|
|
|
Sam Spilsbury |
|
11 years ago
|
|
|
3759
|
|
Thumbnail, cleanup:
Merged if condition checks. Declaration of variables when they are needed (C++ style). Removed redundant brackets. Removed useless "/* Could someone please explain how this works */" comment. Removed extern const unsigned short TEXT_DISTANCE, because this variable does not exist anymore (value is configurable already). Changed if (something > 0.0) to if (something), 10 times. Changed pointedWin = 0; to pointedWin = NULL;. Used centerX () and centerY () abstractions from compiz::window::Geometry to determine the icon center coordinates. Added and removed newlines, if appropriate. Fixed indentation.
Thumbnail, code speedup:
Return ASAP, do not calculate stuff you might not need. No need for WIN_W (w) and WIN_H (w) macros, removed those and replaced them with the local variables int winWidth, int winHeight, int dockWidth and int dockHeight. No need for WIN_X (w) and WIN_Y (w) macros, replaced those with int dockX and int dockY. Introduced int tHeight = thumb.height;, int tWidth = thumb.width;, int halfTWidth = tWidth / 2; and int halfTHeight = tHeight / 2; and used those variables in the following calculations. Use igMidPoint[0] and igMidPoint[1] as arguments in the screen->outputDeviceForPoint (arg1, arg2) function, instead of re- calculating the arguments again.
Thumbnail, GL speedup:
Introduced GLfloat wxPlusWidth = wx + width;, GLfloat wyPlusHeight = wy + height;, GLfloat wxPlusWPlusOff = wxPlusWidth + off;, GLfloat wyPlusHPlusOff = wyPlusHeight + off;, GLfloat wxMinusOff = wx - off; and GLfloat wyMinusOff = wy - off; and used those coordinates in the vertexData arrays. No need to re- calculate those values multiple times. Just query optionGetShowDelay () once and use int showDelay later. We just enable blending if it is currently disabled and disable blending only, if it was disabled before.
Approved by PS Jenkins bot, MC Return, Sami Jaktholm, Sam Spilsbury.
|
MC Return |
|
11 years ago
|
|
|
3758
|
|
|
Sami Jaktholm |
|
11 years ago
|
|
|
3757
|
|
|
Sami Jaktholm |
|
11 years ago
|
|
|