D9848: Updated the blur method to use the more efficient dual kawase blur algorithm.
    Vlad Zagorodniy 
    noreply at phabricator.kde.org
       
    Sat Jan 13 19:21:10 UTC 2018
    
    
  
zzag added inline comments.
Restricted Application edited projects, added Plasma; removed KWin.
INLINE COMMENTS
> blur.cpp:135
> +    /**
> +     * Explanation for the magic numbers:
> +     * 
Where did they come from?
> blur.cpp:160
> +    // Dummy data needed, because the blur strength range is 1-15
> +    blurConfigData.append({0, 0, 0});
> +    
Please add a comment explaining each number(e.g. the first number is the number of downsampling and upsampling iterations, and so on). Just for readability.
> blur.cpp:208
> +    
> +    int blurStrength = BlurConfig::blurRadius();
> +    m_downSampleIterations = blurConfigData[blurStrength].downSampleIterations;
Just a naming thing: maybe it should be `blurRadius`.. So, for given blur radius `blurRadius` lookup corresponding "Dual filter" params in a map `(BlurRadius -> BlurParams)`.
> blur.h:103
> +    QVector <GLRenderTarget*> renderTargets;
> +    QVector <GLTexture> renderTextures;
>      long net_wm_blur_region;
Coding style(prefix fields with `m_`) + consistency:
  BlurShader *m_shader;
  QVector <GLRenderTarget*> m_renderTargets;
  QVector <GLTexture> m_renderTextures;
> blur.h:124
> +    
> +    struct BlurStrenghtData {
> +        int downSampleIterations;
strength
> blurshader.h:107
> +    int textureSizeLocationCopysample;
> +    int blurRectLocationCopysample;
> +    
Coding style + consistency:
  GLShader *m_shaderDownsample;
  GLShader *m_shaderUpsample;
  GLShader *m_shaderCopysample;
  
  int m_mvpMatrixLocationDownsample;
  int m_offsetLocationDownsample;
  int m_textureSizeLocationDownsample;
  
  int m_mvpMatrixLocationUpsample;
  int m_offsetLocationUpsample;
  int m_textureSizeLocationUpsample;
  
  int m_mvpMatrixLocationCopysample;
  int m_textureSizeLocationCopysample;
  int m_blurRectLocationCopysample;
> blurshader.h:111
> +    //Caching uniform values to aviod unnecessary setUniform calls
> +    int activeSampleType;
> +    
`m_`
REPOSITORY
  R108 KWin
REVISION DETAIL
  https://phabricator.kde.org/D9848
To: anemeth, #plasma, #kwin
Cc: zzag, anthonyfieroni, mart, davidedmundson, fredrik, ngraham, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180113/f2079137/attachment.html>
    
    
More information about the Plasma-devel
mailing list