Replaces foreach loops with modern for loops and improve code style overall.
Details
Details
- Reviewers
- None
- Group Reviewers
KWin - Maniphest Tasks
- T11071: Rework compositing pipeline
- Commits
- R108:91faa589c70f: Replace foreach loops and improve code style in composite
Auto tests pass as before and manually in X and Wayland sessions.
Diff Detail
Diff Detail
- Repository
- R108 KWin
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
composite.cpp | ||
---|---|---|
272–273 ↗ | (On Diff #63316) | Personal opinion: I don't like that the ternary operator is minding its own business somewhere far right. A better approach imho CompositingType compositingType = m_scene->compositingType(); if (compositingType & OpenGLCompositing) { compositingType = OpenGLCompositing; } // ... one day // if (compositingType & VulkanCompositing) { // compositingType = VulkanCompositing; // } kwinApp()->platform()->setSelectedCompositor(compositingType); |
309 ↗ | (On Diff #63316) | No short names. |
334 | Why did you remove auto? | |
350 ↗ | (On Diff #63316) | If you want to follow the frameworks coding style 100%, then it should be ShellClient *client. |
698–699 ↗ | (On Diff #63316) | That's unusual line breaking. A bit better imho kwinApp()->platform()->createOpenGLSafePoint( Platform::OpenGLSafePoint::PostLastGuardedFrame); |
948 ↗ | (On Diff #63316) | Indent only with 4 spaces. |
composite.cpp | ||
---|---|---|
334 | typo: auto -> const |
Comment Actions
You forgot to address my comment about short names.
Short names go against the frameworks coding style.
"con" needs to become "connection"
"win" needs to become "window"
I know that old code is full of short names but let's at least follow the coding style in "new" code.