Remove scene check on repaints
AbandonedPublic

Authored by romangg on Jul 6 2019, 10:30 AM.

Details

Reviewers
None
Group Reviewers
KWin
Maniphest Tasks
T11071: Rework compositing pipeline
Summary

There is no need to check if a scene exists at this point. If not we
later abort anyway because the state is not 'On'.

Test Plan

Manually in X and Wayland nested session.

Diff Detail

Repository
R108 KWin
Branch
rmSceneCheck
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 13662
Build 13680: arc lint + arc unit
romangg created this revision.Jul 6 2019, 10:30 AM
Restricted Application added a project: KWin. · View Herald TranscriptJul 6 2019, 10:30 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Jul 6 2019, 10:30 AM
romangg updated this revision to Diff 61250.Jul 6 2019, 11:07 AM
  • Streamline code
zzag added a subscriber: zzag.Jul 8 2019, 7:40 AM

If not we later abort anyway because the state is not 'On'.

Can you provide link to this code?

composite.cpp
583–584

Is it correct though? We'll keep adding repaint regions even if compositing is disabled.

In D22295#492097, @zzag wrote:

If not we later abort anyway because the state is not 'On'.

Can you provide link to this code?

https://cgit.kde.org/kwin.git/tree/composite.cpp#n809

composite.cpp
583–584

Yea, shouldn't be an issue. We can add as many we like and when compositing gets enabled again we do a repaint of the accumulated region (probably we do a full repaint then anyway).

Let's merge to test it out.

zzag added inline comments.Jul 15 2019, 1:25 PM
composite.cpp
583–584

It's better to avoid unnecessary work if compositing is disabled. Many parts of KWin call Compositor::addRepaint() without checking whether compositing is active, although some parts check.

Please add this check back.

zzag added inline comments.Jul 15 2019, 1:32 PM
composite.cpp
795

It's a matter of personal taste, but maybe if statements should check only related stuff(i.e. don't inflate conditionals). Whether compositing is active and whether the composite timer is active seem to be unrelated.

Also, this will be a great idea to document when the composite timer condition can be fulfilled.

if (m_state != State::On) {
    return;
}

// This if statements checks something completely different, thus it's not
// merged with the previous if statement.
if (compositeTimer.isActive()) {
    return;
}
romangg added inline comments.Jul 15 2019, 1:53 PM
composite.cpp
583–584

Compositing is most often active nowadays. On Wayland always. I don't even understand how this can be a point of discussion.

zzag added inline comments.Jul 15 2019, 2:00 PM
composite.cpp
583–584

Yes, but the compositing still can be off, for example, when you're playing a game that blocks compositing.

romangg added inline comments.Jul 15 2019, 2:33 PM
composite.cpp
583–584

So what we do more in this case is a single region addtion to repaints_region, right?

zzag added inline comments.Jul 15 2019, 2:56 PM
composite.cpp
583–584

Yes, we'll be adding regions for no reason. Even though we don't hit this if statement in 99%, 1% is still there.

I'm all for mergin setCompositeTimer and scheduleRepaint methods, but I think we have to keep this check until X11 support is dropped.

romangg abandoned this revision.Jul 22 2019, 10:22 AM