1. 01 Sep, 2020 1 commit
    • Vlad Zahorodnii's avatar
      effects: Disable blur and contrast effect when screen is locked · ed113171
      Vlad Zahorodnii authored
      The results of the blur and the background contrast effect will never
      be seen if the screen locker is active.
      
      In order to avoid wasting computational resources, we could temporarily
      disable the blur effect until the screen is unlocked.
      
      Furthermore, given that the blur effect shrinks the clip region, it is
      guaranteed that the compositor will have to render the desktop window
      behind the lockscreen window. With this change, all windows behind the
      screen locker will be properly clipped away.
      ed113171
  2. 31 Aug, 2020 1 commit
    • Vlad Zahorodnii's avatar
      effects/blur: Remove leftovers after blur cache · afdd5b84
      Vlad Zahorodnii authored
      The original purpose of m_damageArea was to indicate which region of the
      blur cache became dirty and needs to be updated. However, we no longer
      need to keep track of damaged area since the blur cache was removed.
      afdd5b84
  3. 07 Aug, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Prettify license headers · 4ce853e8
      Vlad Zahorodnii authored
      4ce853e8
    • Vlad Zahorodnii's avatar
      Switch to SPDX license markers · 1fb9f6f1
      Vlad Zahorodnii authored
      The main advantage of SPDX license identifiers over the traditional
      license headers is that it's more difficult to overlook inappropriate
      licenses for kwin, for example GPL 3. We also don't have to copy a
      lot of boilerplate text.
      
      In order to create this change, I ran licensedigger -r -c from the
      toplevel source directory.
      1fb9f6f1
  4. 02 Aug, 2020 1 commit
  5. 29 May, 2020 1 commit
  6. 26 May, 2020 1 commit
  7. 30 Apr, 2020 1 commit
  8. 26 Nov, 2019 1 commit
  9. 30 Oct, 2019 1 commit
    • Albert Astals Cid's avatar
      Add some const & · e144748c
      Albert Astals Cid authored
      Summary:
      Won't make things go much faster since everything that was
      being passed by value is refcounted but still const & is a bit faster
      than refcounting
      
      For shared pointers instead of adding const & we move them into the
      destination variable saving some cpu usage but at the same time making
      clear the pointer is being stored by not being const &
      
      Reviewers: zzag
      
      Reviewed By: zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D25022
      e144748c
  10. 09 Jul, 2019 1 commit
  11. 08 Jul, 2019 1 commit
  12. 15 Feb, 2019 1 commit
    • Vlad Zahorodnii's avatar
      [effects] Make sure that all effects reset the streaming buffer · 0d741533
      Vlad Zahorodnii authored
      Summary:
      The streaming buffer is shared so we have to reset it before rendering
      something. Otherwise, it's basically undefined behavior.
      
      For example, if the streaming buffer had been used for rendering a
      geometry with some color, then the Background Contrast effect may crash
      in GLVertexBuffer::bindArrays, it all depends on whether there is any
      bounded GLShader. To fix that, the buffer has to be reset.
      
      BUG: 356141
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19034
      0d741533
  13. 31 Jan, 2019 1 commit
    • Alex Nemeth's avatar
      [effects/blur] Update blur to be more natural · 3c2148a5
      Alex Nemeth authored
      Summary:
      This gets rid of the dark area that may appear between very different colors by doing the blur in SRGB colorspace.
      This is not enabled for GLES, and will use the previous blur type.
      
      Test Plan:
      Before:
      {F6577457}
      
      After:
      {F6577458}
      
      Reviewers: #vdg, #kwin, davidedmundson, zzag, fredrik, ngraham
      
      Reviewed By: #vdg, fredrik, ngraham
      
      Subscribers: Codezela, fredrik, abetts, Petross404, rapiteanu, filipf, rooty, ngraham, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18377
      3c2148a5
  14. 27 Jan, 2019 1 commit
    • Martin Flöser's avatar
      Add windowsystem plugin for KWin's qpa · 02a05610
      Martin Flöser authored
      Summary:
      KWindowSystem provides a plugin interface to have platform specific
      implementations. So far KWin relied on the implementation in
      KWayland-integration repository.
      
      This is something I find unsuited, for the following reasons:
       * any test in KWin for functionality set through the plugin would fail
       * it's not clear what's going on where
       * in worst case some code could deadlock
       * KWin shouldn't use KWindowSystem and only a small subset is allowed
      to be used
      
      The last point needs some further explanation. KWin internally does not
      and cannot use KWindowSystem. KWindowSystem (especially KWindowInfo) is
      exposing information which KWin sets. It's more than weird if KWin asks
      KWindowSystem for the state of a window it set itself. On X11 it's just
      slow, on Wayland it can result in roundtrips to KWin itself which is
      dangerous.
      
      But due to using Plasma components we have a few areas where we use
      KWindowSystem. E.g. a Plasma::Dialog sets a window type, the slide in
      direction, blur and background contrast. This we want to support and
      need to support. Other API elements we do not want, like for examples
      the available windows. KWin internal windows either have direct access
      to KWin or a scripting interface exposed providing (limited) access -
      there is just no need to have this in KWindowSystem.
      
      To make it more clear what KWin supports as API of KWindowSystem for
      internal windows this change implements a stripped down version of the
      kwayland-integration plugin. The main difference is that it does not use
      KWayland at all, but a QWindow internal side channel.
      
      To support this EffectWindow provides an accessor for internalWindow and
      the three already mentioned effects are adjusted to read from the
      internal QWindow and it's dynamic properties.
      
      This change is a first step for a further refactoring. I plan to split
      the internal window out of ShellClient into a dedicated class. I think
      there are nowadays too many special cases. If it moves out there is the
      question whether we really want to use Wayland for the internal windows
      or whether this is just historic ballast (after all we used to use
      qwayland for that in the beginning).
      
      As the change could introduce regressions I'm targetting 5.16.
      
      Test Plan:
      new test case for window type, manual testing using Alt+Tab
      for the effects integration. Sliding popups, blur and contrast worked fine.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18228
      02a05610
  15. 25 Jan, 2019 1 commit
    • Vlad Zahorodnii's avatar
      [effects] Port to new connect syntax · 253ff428
      Vlad Zahorodnii authored
      Summary:
      The new connect syntax has several advantages over the old syntax:
      
      (a) Connecting with the new syntax is faster;
      (b) It is compile time checked.
      
      There are still a few places where the old connect syntax is used, e.g.
      connecting to QML buttons in the Desktop Grid effect.
      
      Test Plan:
      Have been testing this patch for ~2 weeks, haven't noticed any
      regressions.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, broulik, graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18368
      253ff428
  16. 31 Aug, 2018 1 commit
    • Vlad Zahorodnii's avatar
      Clean up includes · 624a4531
      Vlad Zahorodnii authored
      Summary:
      * effects.h includes client.h and forward declares Client, both at the
        same time. Thus, delete the include;
      
      * the blur effect includes effects.h. That, most likely, is a leftover
        after 3f5bf65a.
      
      Test Plan: Compiles.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D15191
      624a4531
  17. 18 Jun, 2018 4 commits
    • Alex Nemeth's avatar
      Fix multimonitor blur · 2419c949
      Alex Nemeth authored
      Summary:
      On wayland blur on secondary monitor would not render correctly.
      
      BUG: 393723
      Depends on D12452
      
      Test Plan:
       - use more than one output
       - log in in a wayland session
       - open a transparent window (for example: Konsole with transparent and blur enabled profile)
       - drag the window to another screen
       - blurs the content under the window corretly
      
      Reviewers: #kwin, graesslin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: apol, zzag, davidedmundson, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12678
      2419c949
    • Alex Nemeth's avatar
      [effects/blur] Check for blitting support · be3168b8
      Alex Nemeth authored
      Summary:
      In D12678 blur was changed to use `blitFromFramebuffer()` instead of `glCopyTexSubImage2D()`
      Now it checks if the GPU supports it.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13246
      be3168b8
    • Alex Nemeth's avatar
      Fix blur on Wayland when scaling is used · 37f4c54d
      Alex Nemeth authored
      Summary:
      Blur should now work on Wayland when scaling is used.
      This does not affect X11 as `GLRenderTarget::virtualScreenScale()` is always 1 on X11
      
      BUG: 391387
      Depends on D12678
      
      Test Plan:
        - log in in a Wayland session
        - turn display scaling to 2x
        - open a transparent window (for example: Konsole with transparent and blur enabled profile)
        - blurs the content under the window corretly
      
      Reviewers: davidedmundson, #kwin
      
      Reviewed By: davidedmundson, #kwin
      
      Subscribers: romangg, apol, zzag, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12700
      37f4c54d
    • Vlad Zahorodnii's avatar
      [effects/blur] Clean up shader code · 168109f3
      Vlad Zahorodnii authored
      Summary:
      * Drop abstract BlurShader class
      * Delete evil "using namespace KWin"
      * Fix includes
      * Use smart pointers
      * Turn BlurShader into a QObject
      * Fix coding style
      * Add missing default cases
      * Use default member initialization
      * Delete methods that are used only once
      * Use more const
      * Use QRect::{top,right,bottom,left} methods in the setBlurRect method
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13110
      168109f3
  18. 01 Jun, 2018 1 commit
  19. 31 May, 2018 2 commits
    • Alex Nemeth's avatar
      Fix blur on Wayland when scaling is used · b3b691a2
      Alex Nemeth authored
      Summary:
      Blur should now work on Wayland when scaling is used.
      This does not affect X11 as `GLRenderTarget::virtualScreenScale()` is always 1 on X11
      
      BUG: 391387
      Depends on D12678
      
      Test Plan:
        - log in in a Wayland session
        - turn display scaling to 2x
        - open a transparent window (for example: Konsole with transparent and blur enabled profile)
        - blurs the content under the window corretly
      
      Reviewers: davidedmundson, #kwin
      
      Reviewed By: davidedmundson, #kwin
      
      Subscribers: romangg, apol, zzag, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12700
      b3b691a2
    • Vlad Zahorodnii's avatar
      [effects/blur] Lookup window once when disconnecting from blurChanged · 95ee0524
      Vlad Zahorodnii authored
      Summary:
      When disconnecting from `blurChanged` signal, `(w, connection)` pair is
      being looked up three times. We can do better by using `QMap` in a more
      STL-like way.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13118
      95ee0524
  20. 29 May, 2018 1 commit
    • Alex Nemeth's avatar
      Fix multimonitor blur · 99532fb9
      Alex Nemeth authored
      Summary:
      On wayland blur on secondary monitor would not render correctly.
      
      BUG: 393723
      Depends on D12452
      
      Test Plan:
       - use more than one output
       - log in in a wayland session
       - open a transparent window (for example: Konsole with transparent and blur enabled profile)
       - drag the window to another screen
       - blurs the content under the window corretly
      
      Reviewers: #kwin, graesslin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: apol, zzag, davidedmundson, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12678
      99532fb9
  21. 30 Apr, 2018 1 commit
    • Alex Nemeth's avatar
      Fix blur noise effect using incorrect scaling value · 16a0e241
      Alex Nemeth authored
      Summary:
      `QGuiApplication::primaryScreen()->logicalDotsPerInch()` sometimes reports incorrect scale value, for example 95.951 (or even lower) instead of 96.0 at 1x scale and this caused to simply darken blurred areas instead of noising them.
      This patch sets a minimum 1x scale for the noise texture, because realistically we will never be below that.
      
      Reviewers: davidedmundson
      
      Reviewed By: davidedmundson
      
      Subscribers: davidedmundson, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12519
      16a0e241
  22. 20 Apr, 2018 1 commit
    • Vlad Zahorodnii's avatar
      Fix unused param warnings · 75fff176
      Vlad Zahorodnii authored
      Summary:
      Compiler: GCC 7.3.1
      Distro: Arch Linux
      
      Compiler warnings:
      
      ```
      /home/vlad/KDE/src/kde/workspace/kwin/effects/blur/blur.cpp: In member function ‘void KWin::BlurEffect::upscaleRenderToScreen(KWin::GLVertexBuffer*, int, int, QMatrix4x4, QRect, QPoint)’:
      /home/vlad/KDE/src/kde/workspace/kwin/effects/blur/blur.cpp:677:129: warning: unused parameter ‘windowShape’ [-Wunused-parameter]
       void BlurEffect::upscaleRenderToScreen(GLVertexBuffer *vbo, int vboStart, int blurRectCount, QMatrix4x4 screenProjection, QRect windowShape, QPoint windowPosition)
                                                                                                                                       ^~~~~~~~~~~
      ```
      
      ```
      /home/vlad/KDE/src/kde/workspace/kwin/main_wayland.cpp: In function ‘void KWin::{anonymous}::gainRealTime(KWin::RealTimeFlags)’:
      /home/vlad/KDE/src/kde/workspace/kwin/main_wayland.cpp:95:56: warning: unused parameter ‘flags’ [-Wunused-parameter]
       void gainRealTime(RealTimeFlags flags = RealTimeFlags::DontReset)
      ```
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: davidedmundson
      
      Subscribers: anemeth, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12208
      75fff176
  23. 13 Feb, 2018 1 commit
    • Alex Nemeth's avatar
      Added noise blur effect · cc0325af
      Alex Nemeth authored
      Summary:
      Added the option to turn on noise behind the blurred area.
      The lowest strength value disables it completely, so it is optional and is disabled by default.
      
      Test Plan:
      Edit: this new screenshot shows the updated noise generation.
      Edit2: separated the screenshots so you can flick through them to clearly see the differences
      
      {F5694024}
      
      {F5694031}
      
      {F5694025}
      
      {F5694028}
      
      Reviewers: #kwin, #vdg, fredrik
      
      Reviewed By: #vdg, fredrik
      
      Subscribers: davidedmundson, matheusm, romangg, ivan, zzag, ngraham, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D10281
      cc0325af
  24. 03 Feb, 2018 1 commit
    • Alex Nemeth's avatar
      Removed the "fastblur" path · f8ff4027
      Alex Nemeth authored
      Summary:
      Since the new blur is more efficient "fastblur" or "simpleblur" is not needed anymore for fullscreen blur.
      Even my old low-end laptop from 2009 (with Intel T3300) can easily do fullscreen blur now with the new method without any hitch at all.
      
      Reviewers: graesslin, #kwin, #plasma, #vdg, fredrik
      
      Reviewed By: #vdg, fredrik
      
      Subscribers: avaragic, fredrik, ngraham, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D10181
      f8ff4027
  25. 25 Jan, 2018 2 commits
    • Alex Nemeth's avatar
      Reverted accidental file permission changes · 977a5ef0
      Alex Nemeth authored
      Summary: In D9848 the file permissions in effects/blur where accidentally changed from 644 to 755.
      
      Test Plan: {F5674656}
      
      Reviewers: #kwin, hein
      
      Reviewed By: hein
      
      Subscribers: kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D10100
      977a5ef0
    • Alex Nemeth's avatar
      Updated the blur method to use the more efficient dual kawase blur algorithm. · 0179f741
      Alex Nemeth authored
      Summary:
      Updated the old and outdated blur method to use the much more efficient dual kawase blur method.
      Now with this we can do virtually infinite blur with very very little performance cost.
      The dual kawase blur method is basically downscaling and upscaling an image, but combined with the kawase blur shader.
      Comparison: https://i.imgur.com/mh6Cw61.png
      Left is old, right is new.
      Comparison was done with the strongest blur setting in a VM running on an Intel i7-4790 and a GTX980
      We can see here that the performance is even better with this new method.
      
      Reviewers: #plasma, #kwin, graesslin, fredrik
      
      Reviewed By: fredrik
      
      Subscribers: hein, dos, luebking, broulik, romangg, zzag, anthonyfieroni, mart, davidedmundson, fredrik, ngraham, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D9848
      0179f741
  26. 15 Jan, 2018 1 commit
    • Martin Flöser's avatar
      [effects/blur] Disable texture cache on Wayland · e200d740
      Martin Flöser authored
      Summary:
      It is known to create problems especially on multi-screen and is not as
      important on Wayland as it used to be on X11 thanks to things like
      buffer age and in general better rendering.
      
      Test Plan: Opened the config module and verified that the option is
      hidden
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D9879
      e200d740
  27. 02 Dec, 2017 1 commit
  28. 29 Sep, 2017 1 commit
    • David Edmundson's avatar
      Don't recreate kwayland blurmanager on screen size changes · b3020d6f
      David Edmundson authored
      Summary:
      Instead of calling reconfigure() on screen size changes, which deletes
      and recreates the effect, we can just update the one texture that's mapped to
      the screen size.
      
      ---
      
      From the wayland commit.
      
      >What surprises me is that BlurManager recreates for Output changes.
      >That sounds like a bug in KWin (or an area which could be improved).
      
      I had thought the same and wrote this (though wanted to have kwayland fixed first)
      
      Test Plan:
      Logged in and out (my screen resizes on startup due to scaling)
      Tested on my X machine by turning a screen off. Nothing broke, plasma
      panels looked the same.
      
      Note: Eike tried this patch last week and claimed kwin still crashed.
      We don't have a backtrace so it could have been something unrelated,
      applied wrong or that he was deliberately lying to wind me up.
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: graesslin, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7877
      b3020d6f
  29. 12 Sep, 2017 1 commit
    • Martin Flöser's avatar
      [effects] Support xcbConnectionChanged for support properties · 90e77a93
      Martin Flöser authored
      Summary:
      Several effects announce a support property atom on the root window. This
      change forwards the KWin::Application's signal that the xcbConnection
      changed to the EffectsHandler so that the effects can respond to it.
      
      All effects which announce a support property connect to this new signal
      and re-announce the property. In case the xcb connection died (future
      XWayland crashing case) it is set to XCB_ATOM_NONE by that. In case the
      xcb connection got created (future delayed XWayland startup) the atom is
      set to the proper value.
      
      In addition all usages of the support properties are guarded, so that no
      nonesense actions are performed if the support property is XCB_ATOM_NONE.
      
      Test Plan: Only compile tested as we don't have XFree KWin yet
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7761
      90e77a93
  30. 28 Apr, 2017 1 commit
    • David Edmundson's avatar
      Add scaling support into BlurEffect::doBlur · 44a6050e
      David Edmundson authored
      Summary:
      This patch caputres from the framebuffer using the framebuffer's
      geometry, factoring in scale. We then keep the current normal DPI
      framebuffer causing it to downsample there.
      
      This is good because:
      - it keeps the code very simple
      - it's a performance optimisation. Blurring on 4k is naturally more
      expensive than at regular DPI. Downsampling keeps it the same - and you
      can't see a difference given it's high DPI and you're going to blur it
      anwyay.
      - it keeps kernel sizes somewhat resolution independent so it will look
      just as blurry across multiple screens.
      
      ::doCachedBlur still needs doing.
      
      Test Plan:
      Ran an app
      Ran the kwindowsystem blur test
      Observed the right part of the window being blurred
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D4963
      44a6050e
  31. 15 Apr, 2017 1 commit
    • Martin Flöser's avatar
      [effects] Use arg="true" in the kcfg files · 2132b1e0
      Martin Flöser authored
      Summary:
      By changing all kcfg to have arg="true" we can pass in the same
      KSharedConfigPtr into all effects. This allows to have fake config in
      the tests and in the planned effect demo mode.
      
      Also it means that we don't have to hardcode the name kwinrc into the
      files. In the configs - where we cannot access the effectshandler - we
      use the define KWIN_CONFIG which gets generated based on the compile
      time arguments.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D3571
      2132b1e0
  32. 18 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Adjust blur and contrast for multi-output rendering on Wayland · bef9c9c8
      Martin Flöser authored
      Summary:
      The glCopyTex(Sub)Image calls are adjusted to take the per output
      rendering into account. In addition contrast effect sets the model view
      projection matrix in each call to ensure it's on the correct screen.
      
      Blur probably needs more changes for the cached texture to work, but
      it's a start.
      
      Test Plan: Blur and Background contrast work on multi-screen wayland
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3101
      bef9c9c8
  33. 09 Aug, 2016 1 commit
  34. 25 Feb, 2016 1 commit