[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2020-01-09 Thread Vlad Zahorodnii
https://bugs.kde.org/show_bug.cgi?id=257566

Vlad Zahorodnii  changed:

   What|Removed |Added

   Version Fixed In||5.18.0
  Latest Commit|https://commits.kde.org/kwi |https://commits.kde.org/kwi
   |n/d1cfcf4c975e1dfe6f54c470f |n/af71763be53054925f27b7614
   |9c2ead2548afacf |fc992e6380a1d02

--- Comment #17 from Vlad Zahorodnii  ---
Git commit af71763be53054925f27b7614fc992e6380a1d02 by Vlad Zahorodnii.
Committed on 09/01/2020 at 13:13.
Pushed by vladz into branch 'master'.

[scene] Fix decoration texture bleeding

Summary:
Quite long time ago, window decorations were painted on real X11 windows.
The nicest thing about that approach is that we get both contents of the
client and the frame window at the same time. However, somewhere around
KDE 4.2 - 4.3 times, decoration rendering architecture had been changed
to what we have now.

I've mentioned the previous decoration rendering design because it didn't
have a problem that the new design has, namely the texture bleeding issue.

In the name of better performance, opengl scene puts all decoration parts
to an atlas. This is totally reasonable, however we must be super cautious
about things such as the GL_LINEAR filter.

The GL_LINEAR filter may need to sample a couple of neighboring texels
in order to produce the final texel value. However, since all decoration
parts now live in a single texture, we have to make sure that we don't
sample texels that belong to another decoration part.

This patch fixes the texture bleeding problem by padding each individual
decoration part in the atlas. There is another solution for this problem
though. We could render a window into an offscreen texture and then map
that texture on the transformed window geometry. This would work well and
we definitely need an offscreen rendering path in the opengl scene,
however it's not feasible at the moment since we need to break the window
quads API. Also, it would be great to have as less as possible stuff going
on between invocation of Scene::Window::performPaint() and getting the
corresponding pixel data on the screen.

There is a good chance that the new padding stuff may make you vomit. If
it does so, I'm all ears for the suggestions how to make the code more
nicer.
Related: bug 360549, bug 412573
FIXED-IN: 5.18.0

Reviewers: #kwin

Subscribers: fredrik, kwin, fvogt

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25611

M  +6-1decorations/decorationrenderer.cpp
M  +1-0decorations/decorationrenderer.h
M  +108  -9plugins/scenes/opengl/scene_opengl.cpp
M  +11   -4scene.cpp

https://commits.kde.org/kwin/af71763be53054925f27b7614fc992e6380a1d02

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2020-01-09 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=257566

David Edmundson  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|REOPENED|RESOLVED
  Latest Commit||https://commits.kde.org/kwi
   ||n/d1cfcf4c975e1dfe6f54c470f
   ||9c2ead2548afacf

--- Comment #16 from David Edmundson  ---
Git commit d1cfcf4c975e1dfe6f54c470f9c2ead2548afacf by David Edmundson.
Committed on 09/01/2020 at 13:03.
Pushed by davidedmundson into branch 'master'.

Avoid texture bleed rendering X11 window

Summary:
We currently see a gap on transformed windows between the window and the
top decoration.

This is partly the atlas bleed on the decoration, and partly a bleed on
the window content itself.

On X11, the window we composite is the frame window - which is a larger
texture containing a transparent border where the frame normally would
be. When we sample with a linear filter we include these texels. Hence
GL_CLAMP_TO_EDGE doesn't work.

Vlad's patch to composite the correct window, not the frame was my
preferred approach, but we had to revert it as it caused an issue with
xwayland :(

Half pixel correction nearly worked, but caused blurry fonts.

This patch resolves it in the fragment shader used by effects doing
transforms. We pass the real texture geometry of the window to the
client with a half pixel correction. Any samples outside the outer half
pixel are then clamped within bounds.

Arguably a hack, but solves the problem in a comparatively
non-invasive way.
Related: bug 360549

Test Plan:
X11:
Using Vlad's atlas padding for decoration
Slowed animations, wobbled a dark window over a light background
No artifacts

Wayland:
This isn't needed. Now tested that everything still renders the same.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, jgrulich, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25737

M  +14   -3libkwineffects/kwinglutils.cpp
M  +2-0libkwineffects/kwinglutils.h
M  +40   -13   plugins/scenes/opengl/scene_opengl.cpp

https://commits.kde.org/kwin/d1cfcf4c975e1dfe6f54c470f9c2ead2548afacf

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-12-04 Thread RussianNeuroMancer
https://bugs.kde.org/show_bug.cgi?id=257566

RussianNeuroMancer  changed:

   What|Removed |Added

 CC|russianneuroman...@ya.ru|

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-12-02 Thread Vlad Zahorodnii
https://bugs.kde.org/show_bug.cgi?id=257566

Vlad Zahorodnii  changed:

   What|Removed |Added

   Version Fixed In|5.18.0  |
  Latest Commit|https://commits.kde.org/kwi |
   |n/ac4dce1c20a1cbfd3974bf8da |
   |6dd7557d35a4ca1 |

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-12-02 Thread Vlad Zahorodnii
https://bugs.kde.org/show_bug.cgi?id=257566

Vlad Zahorodnii  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-12-02 Thread Vlad Zahorodnii
https://bugs.kde.org/show_bug.cgi?id=257566

--- Comment #15 from Vlad Zahorodnii  ---
Git commit 6e000314b34820760cd08593d18708e1f8905cc9 by Vlad Zahorodnii.
Committed on 02/12/2019 at 17:45.
Pushed by vladz into branch 'master'.

Revert the fix for the texture bleeding issue

This reverts commit 9151bb7b9e71fdfeb3d3682ee8a42d796fa315e9.
This reverts commit ac4dce1c20a1cbfd3974bf8da6dd7557d35a4ca1.
This reverts commit 754b72d155820a6c8a9ba94b2c0960da1b2f86ce.

In order to make the fix work, we need to redirect the client window
instead of the frame window. However, we cannot to do that because
Xwayland expects the toplevel window(in our case, the frame window)
to be redirected.

Another solution to the texture bleeding issue must be found.
Related: bug 360549

M  +6-0composite.cpp
M  +1-6decorations/decorationrenderer.cpp
M  +0-1decorations/decorationrenderer.h
M  +6-1deleted.cpp
M  +2-1deleted.h
M  +2-3effects.cpp
M  +1-1events.cpp
M  +54   -50   geometry.cpp
M  +16   -109  plugins/scenes/opengl/scene_opengl.cpp
M  +18   -17   scene.cpp
M  +13   -1scene.h
M  +8-9toplevel.cpp
M  +10   -1toplevel.h
M  +56   -8x11client.cpp
M  +6-22   x11client.h

https://commits.kde.org/kwin/6e000314b34820760cd08593d18708e1f8905cc9

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-12-02 Thread Vlad Zahorodnii
https://bugs.kde.org/show_bug.cgi?id=257566

Vlad Zahorodnii  changed:

   What|Removed |Added

   Version Fixed In||5.18.0
  Latest Commit||https://commits.kde.org/kwi
   ||n/ac4dce1c20a1cbfd3974bf8da
   ||6dd7557d35a4ca1
 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED

--- Comment #14 from Vlad Zahorodnii  ---
Git commit ac4dce1c20a1cbfd3974bf8da6dd7557d35a4ca1 by Vlad Zahorodnii.
Committed on 02/12/2019 at 13:08.
Pushed by vladz into branch 'master'.

[scene] Fix decoration texture bleeding

Summary:
Quite long time ago, window decorations were painted on real X11 windows.
The nicest thing about that approach is that we get both contents of the
client and the frame window at the same time. However, somewhere around
KDE 4.2 - 4.3 times, decoration rendering architecture had been changed
to what we have now.

I've mentioned the previous decoration rendering design because it didn't
have a problem that the new design has, namely the texture bleeding issue.

In the name of better performance, opengl scene puts all decoration parts
to an atlas. This is totally reasonable, however we must be super cautious
about things such as the GL_LINEAR filter.

The GL_LINEAR filter may need to sample a couple of neighboring texels
in order to produce the final texel value. However, since all decoration
parts now live in a single texture, we have to make sure that we don't
sample texels that belong to another decoration part.

This patch fixes the texture bleeding problem by padding each individual
decoration part in the atlas. There is another solution for this problem
though. We could render a window into an offscreen texture and then map
that texture on the transformed window geometry. This would work well and
we definitely need an offscreen rendering path in the opengl scene,
however it's not feasible at the moment since we need to break the window
quads API. Also, it would be great to have as less as possible stuff going
on between invocation of Scene::Window::performPaint() and getting the
corresponding pixel data on the screen.

There is a good chance that the new padding stuff may make you vomit. If
it does so, I'm all ears for the suggestions how to make the code more
nicer.
Related: bug 360549, bug 412573
FIXED-IN: 5.18.0

Reviewers: #kwin

Subscribers: fredrik, kwin, fvogt

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25611

M  +6-1decorations/decorationrenderer.cpp
M  +1-0decorations/decorationrenderer.h
M  +108  -9plugins/scenes/opengl/scene_opengl.cpp
M  +11   -4scene.cpp

https://commits.kde.org/kwin/ac4dce1c20a1cbfd3974bf8da6dd7557d35a4ca1

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-11-29 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=257566

Nate Graham  changed:

   What|Removed |Added

 CC||n...@kde.org

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-11-28 Thread Vlad Zahorodnii
https://bugs.kde.org/show_bug.cgi?id=257566

Vlad Zahorodnii  changed:

   What|Removed |Added

   Assignee|kwin-bugs-n...@kde.org  |vladz...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-04-27 Thread Patrick Silva
https://bugs.kde.org/show_bug.cgi?id=257566

Patrick Silva  changed:

   What|Removed |Added

 CC||bugsefor...@gmx.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-03-27 Thread Vlad Zagorodniy
https://bugs.kde.org/show_bug.cgi?id=257566

Vlad Zagorodniy  changed:

   What|Removed |Added

 CC||david.cortes.rivera@gmail.c
   ||om

--- Comment #13 from Vlad Zagorodniy  ---
*** Bug 405933 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-01-08 Thread Filip F .
https://bugs.kde.org/show_bug.cgi?id=257566

--- Comment #12 from Filip F.  ---
Created attachment 117346
  --> https://bugs.kde.org/attachment.cgi?id=117346=edit
KWin Wobbly Flicker

Flickering is less pronounced with Crisp set as the scaling method, but is
still present.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2019-01-08 Thread Sefa Eyeoglu
https://bugs.kde.org/show_bug.cgi?id=257566

Sefa Eyeoglu  changed:

   What|Removed |Added

 CC||sefa6...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2018-12-27 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=257566

Martin Flöser  changed:

   What|Removed |Added

 CC||tr...@yandex.com

--- Comment #11 from Martin Flöser  ---
*** Bug 402595 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2018-10-08 Thread Vlad Zagorodniy
https://bugs.kde.org/show_bug.cgi?id=257566

Vlad Zagorodniy  changed:

   What|Removed |Added

   See Also||https://bugs.kde.org/show_b
   ||ug.cgi?id=360549

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2018-06-10 Thread Filip
https://bugs.kde.org/show_bug.cgi?id=257566

Filip  changed:

   What|Removed |Added

 CC||tyx...@gmail.com

--- Comment #10 from Filip  ---
(In reply to Ivan Stanton from comment #9)
> Still having this issue on neon Developer-Unstable. In 2017.
> Surprised we still don't have a fix.

I don't know where the filtering options can be set or if they exist anymore,
but this is still very reproducible.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 257566] Wobbly Windows effect with bi/trilinear filtering make windows' decorations flicker

2017-03-21 Thread Unreal Name
https://bugs.kde.org/show_bug.cgi?id=257566

Unreal Name <2112...@jeffcoschools.us> changed:

   What|Removed |Added

 CC||2112...@jeffcoschools.us

--- Comment #9 from Unreal Name <2112...@jeffcoschools.us> ---
Still having this issue on neon Developer-Unstable. In 2017.
Surprised we still don't have a fix.

-- 
You are receiving this mail because:
You are watching all bug changes.