blur: Disable sRGB when the framebuffer is linear
ClosedPublic

Authored by fredrik on Jun 29 2019, 11:50 AM.

Details

Summary

Disable sRGB rendering when the color encoding of the default
framebuffer is linear.

BUG: 408594

Diff Detail

Repository
R108 KWin
Lint
Lint Skipped
Unit
Unit Tests Skipped
fredrik created this revision.Jun 29 2019, 11:50 AM
Restricted Application added a project: KWin. · View Herald TranscriptJun 29 2019, 11:50 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
fredrik requested review of this revision.Jun 29 2019, 11:50 AM
zzag added a subscriber: zzag.Jun 29 2019, 12:40 PM
zzag added inline comments.
effects/blur/blur.cpp
133

Do we need to check whether the default framebuffer object is bound?

137–138

Coding style nitpick: Use curly braces even when the body of a conditional statement contains only one line.

656

Do we have to worry about the looking glass effect and all other effects that render the scene to a texture?

fredrik added inline comments.Jun 29 2019, 4:30 PM
effects/blur/blur.cpp
133

Yes, that's probably a good idea.

656

Yes, those effects will need to use an sRGB texture as well.

That being said, it looks to me like the blur effect is just broken in general when it's not rendering to the default framebuffer.

fredrik added inline comments.Jun 29 2019, 5:05 PM
effects/blur/blur.cpp
656

And the reason is that GLRenderTarget::blitFromFramebuffer() always blits from the default framebuffer.

zzag added inline comments.Jun 29 2019, 9:50 PM
effects/blur/blur.cpp
656

Aye, the source framebuffer object is hard coded.

fredrik updated this revision to Diff 60966.Jul 1 2019, 9:29 PM

Make sure that the default framebuffer is bound when checking the color encoding.

fredrik marked 2 inline comments as done.Jul 1 2019, 9:30 PM
fredrik added inline comments.Jul 1 2019, 9:59 PM
effects/blur/blur.cpp
656

I suggest that we ignore this issue in the stable branch for now since this is not a regression. I don't want to risk further fallout by changing the behavior of blitFromFramebuffer() there.

That this has been broken for a very long time without anyone noticing also speaks volumes about how many people use the looking glass effect.

zzag added a comment.Jul 1 2019, 10:03 PM

I'll test this patch tomorrow.

effects/blur/blur.cpp
656

Agreed.

zzag accepted this revision.Jul 2 2019, 7:28 PM
zzag added inline comments.
effects/blur/blur.cpp
134

Please use reinterpret_cast instead of c-style cast.

This revision is now accepted and ready to land.Jul 2 2019, 7:28 PM
zzag added a comment.EditedJul 2 2019, 7:30 PM

... also please change blur: to [effects/blur] in the subject line

In D22153#489729, @zzag wrote:

... also please change blur: to [effects/blur] in the subject line

I actually don't like that practice, because parts of the git tool chain automatically strips leading bracketed strings from commit messages.
These are used to encode information that's not supposed to be in the final commit message, such as [PATCH 1/2].

zzag added a comment.EditedJul 2 2019, 10:56 PM

I actually don't like that practice,

So do I to be honest. I prefer foobar: Heart touching subject line style. [foobar] is predominant style, that's why I asked you to change the prefix.

This revision was automatically updated to reflect the committed changes.