D15735: [effects/wobblywindows] Optimize wobbly windows effect

Roman Gilg <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
romangg added a comment.


  Please add the context. Either by using arc or by supplying git diff the `-U99999`parameter

INLINE COMMENTS

> wobblywindows.cpp:60
>  
> -static const ParameterSet set_0 = {
> -    0.15,
> -    0.80,
> -    0.10,
> -    20.0,
> -    20.0,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    true,
> -    false,
> -    false
> -};
> -
> -static const ParameterSet set_1 = {
> -    0.10,
> -    0.85,
> -    0.10,
> -    20.0,
> -    20.0,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    true,
> -    false,
> -    false
> -};
> -
> -static const ParameterSet set_2 = {
> -    0.06,
> -    0.90,
> -    0.10,
> -    20.0,
> -    20.0,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    true,
> -    false,
> -    false
> -};
> -
> -static const ParameterSet set_3 = {
> -    0.03,
> -    0.92,
> -    0.20,
> -    20.0,
> -    20.0,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    true,
> -    false,
> -    false
> -};
> -
> -static const ParameterSet set_4 = {
> -    0.01,
> -    0.97,
> -    0.25,
> -    20.0,
> -    20.0,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    0.0,
> -    1000.0,
> -    0.5,
> -    true,
> -    false,
> -    false
> +static const ParameterSet pset[] = {
> +    {

I don't think it particularly helps the code readability to merge all that. What would help more is adding comments what this stuff does.

> wobblywindows.h:201
>  
> -    void initWobblyInfo(WindowWobblyInfos& wwi, QRect geometry) const;
> +    bool updateWindowWobblyDatas(WindowWobblyInfos& wwi, const QRectF& rect, qreal time);
> +    void adjustWindowWobblyAbilities(WindowWobblyInfos& wwi, const QRectF& rect);

Functions should be listed before member variables with same scope. The old code did this wrong already though.

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D15735

To: anthonyfieroni, #kwin, zzag
Cc: romangg, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.