Skip to content
  • Vlad Zahorodnii's avatar
    [libbreezecommon] Use box blur instead of FFT blur · f1e4f103
    Vlad Zahorodnii authored
    Summary:
    Creation of shadows (especially for "Large" and "Very large" sizes) is
    a computation expensive task because we have to blur alpha channel of a
    shadow texture (which then will be tinted with desired shadow color).
    
    Currently, we use the following approach:
    * for blur radius less than 64, use naive 2-pass algorithm;
    * for blur radius greater than or equal to 64, use FFT.
    
    Even though the FFT approach is doing its the best, it still takes
    impresive amount of time to blur the alpha channel.
    
    What makes things even worse is that while we're blurring the alpha
    channel, we're blocking the main thread of KWin (decorations are not
    rendered in their own thread). This can result in frame drops (2 or 3
    frames, something like that).
    
    So, the only viable alternative is to use an approximation of the Gaussian
    blur. As such an approximation, I picked the box blur because it's quite
    simple, it's fast, and it takes small amount of iterations to have something
    simi...
    f1e4f103