[effects/slide] Const-ify variables
Summary: It improves a little bit readability and comprehensibility of the code. Reviewers: #kwin, mart Reviewed By: #kwin, mart Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D13116icc-effect-5.14.5
parent
02c08ca33d
commit
c5697d6415
|
@ -110,7 +110,7 @@ inline void wrapDiff(QPoint& diff, int w, int h)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QRegion buildClipRegion(QPoint pos, int w, int h)
|
inline QRegion buildClipRegion(const QPoint& pos, int w, int h)
|
||||||
{
|
{
|
||||||
const QSize screenSize = effects->virtualScreenSize();
|
const QSize screenSize = effects->virtualScreenSize();
|
||||||
QRegion r = QRect(pos, screenSize);
|
QRegion r = QRect(pos, screenSize);
|
||||||
|
@ -152,9 +152,9 @@ void SlideEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
|
||||||
|
|
||||||
QVector<int> visibleDesktops;
|
QVector<int> visibleDesktops;
|
||||||
visibleDesktops.reserve(4); // 4 - maximum number of visible desktops
|
visibleDesktops.reserve(4); // 4 - maximum number of visible desktops
|
||||||
QRegion clipRegion = buildClipRegion(currentPos, w, h);
|
const QRegion clipRegion = buildClipRegion(currentPos, w, h);
|
||||||
for (int i = 1; i <= effects->numberOfDesktops(); i++) {
|
for (int i = 1; i <= effects->numberOfDesktops(); i++) {
|
||||||
QRect desktopGeo = desktopGeometry(i);
|
const QRect desktopGeo = desktopGeometry(i);
|
||||||
if (! clipRegion.contains(desktopGeo)) {
|
if (! clipRegion.contains(desktopGeo)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ void SlideEffect::postPaintScreen()
|
||||||
QPoint SlideEffect::desktopCoords(int id) const
|
QPoint SlideEffect::desktopCoords(int id) const
|
||||||
{
|
{
|
||||||
QPoint c = effects->desktopCoords(id);
|
QPoint c = effects->desktopCoords(id);
|
||||||
QPoint gridPos = effects->desktopGridCoords(id);
|
const QPoint gridPos = effects->desktopGridCoords(id);
|
||||||
c.setX(c.x() + m_hGap * gridPos.x());
|
c.setX(c.x() + m_hGap * gridPos.x());
|
||||||
c.setY(c.y() + m_vGap * gridPos.y());
|
c.setY(c.y() + m_vGap * gridPos.y());
|
||||||
return c;
|
return c;
|
||||||
|
@ -356,7 +356,7 @@ bool SlideEffect::shouldForceBlur(const EffectWindow* w) const
|
||||||
// if (surf) {
|
// if (surf) {
|
||||||
// return !surf->blur().isNull();
|
// return !surf->blur().isNull();
|
||||||
// }
|
// }
|
||||||
KWayland::Server::SurfaceInterface* surf = w->surface();
|
const KWayland::Server::SurfaceInterface* surf = w->surface();
|
||||||
if (surf && surf->blur()) {
|
if (surf && surf->blur()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ bool SlideEffect::shouldForceBackgroundContrast(const EffectWindow* w) const
|
||||||
// if (surf) {
|
// if (surf) {
|
||||||
// return !surf->contrast().isNull();
|
// return !surf->contrast().isNull();
|
||||||
// }
|
// }
|
||||||
KWayland::Server::SurfaceInterface* surf = w->surface();
|
const KWayland::Server::SurfaceInterface* surf = w->surface();
|
||||||
if (surf && surf->contrast()) {
|
if (surf && surf->contrast()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue