[effects/backgroundcontrast] Calculate correct y-coord of the copy rect
ClosedPublic

Authored by zzag on Apr 23 2018, 10:53 AM.

Diff Detail

Repository
R108 KWin
Branch
contrast-correct-y
Lint
No Linters Available
Unit
No Unit Test Coverage
zzag created this revision.Apr 23 2018, 10:53 AM
Restricted Application added a project: KWin. · View Herald TranscriptApr 23 2018, 10:53 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Apr 23 2018, 10:53 AM
zzag edited the summary of this revision. (Show Details)Apr 23 2018, 10:56 AM
mart accepted this revision.Apr 24 2018, 9:44 AM
This revision is now accepted and ready to land.Apr 24 2018, 9:44 AM

As this is clearly more readable:
y = sg.height() - (r.y() - sg.y() + r.height())

Put it in the code rather than reobfuscating it

zzag updated this revision to Diff 32992.Apr 24 2018, 3:50 PM

Improve readibility.

zzag edited the summary of this revision. (Show Details)Apr 24 2018, 3:51 PM
zzag added a comment.EditedApr 24 2018, 3:56 PM

@davidedmundson it seems like not only blitFromFramebuffer needs to convert coords from "virtual space" to "screen space". Maybe, there should be a helper like QRect GLRenderTarget::mapToScreenCoords(const QRect& rect) (or mapToScreenSpace). What do you think?

GLRenderTarget::mapToScreenCoords

mapFrom surely

but yes good idea

zzag added a comment.EditedApr 24 2018, 4:04 PM

mapFrom surely

Not sure about mapFrom because we map coords to [OpenGL] screen space. But I guess that's a topic for another discussion.

Update: OK, mapFromVirtualSpace seems to be a good name.

Do you accept this change? :)

davidedmundson accepted this revision.May 14 2018, 1:55 PM
zzag added a comment.May 14 2018, 2:02 PM

David, could you please land this patch for me?

In D12466#262289, @zzag wrote:

David, could you please land this patch for me?

You don't have a dev account @zzag?

zzag added a comment.May 17 2018, 9:17 AM

You don't have a dev account @zzag?

I asked sysadmins to withdraw my dev account(for security reasons) because I won't be contributing any time soon.

This revision was automatically updated to reflect the committed changes.