Commit 47306865 authored by Roman Gilg's avatar Roman Gilg
Browse files

[platforms/drm] Refactor updateTransform

Summary:
Small intermediate refactor. For now just do the normal rotation when a flipped
transform is requested. In the future we might want to provide the possibility
to flip the output image.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25649
parent f21f61db
......@@ -651,41 +651,36 @@ bool DrmOutput::dpmsLegacyApply()
void DrmOutput::updateTransform(Transform transform)
{
DrmPlane::Transformation planeTransform;
// TODO: Do we want to support reflections (flips)?
switch (transform) {
case Transform::Normal:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate0);
}
break;
case Transform::Rotated90:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate90);
}
break;
case Transform::Rotated180:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate180);
}
break;
case Transform::Rotated270:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate270);
}
break;
case Transform::Flipped:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate0;
break;
case Transform::Rotated90:
case Transform::Flipped90:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate90;
break;
case Transform::Rotated180:
case Transform::Flipped180:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate180;
break;
case Transform::Rotated270:
case Transform::Flipped270:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate270;
break;
default:
Q_UNREACHABLE();
}
if (m_primaryPlane) {
m_primaryPlane->setTransformation(planeTransform);
}
m_modesetRequested = true;
// the cursor might need to get rotated
updateCursor();
showCursor();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment