core: Rename OutputTransform enums

This commit is contained in:
Vlad Zahorodnii 2023-12-21 10:40:33 +02:00
parent 47017d19de
commit 9039612c20
13 changed files with 268 additions and 268 deletions

View file

@ -49,13 +49,13 @@ void TestOutputTransform::mapSizeF_data()
QTest::addColumn<QSizeF>("target");
QTest::addRow("rotate-0") << OutputTransform::Normal << QSizeF(10, 20) << QSizeF(10, 20);
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << QSizeF(10, 20) << QSizeF(20, 10);
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << QSizeF(10, 20) << QSizeF(10, 20);
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << QSizeF(10, 20) << QSizeF(20, 10);
QTest::addRow("flip-0") << OutputTransform::Flipped << QSizeF(10, 20) << QSizeF(10, 20);
QTest::addRow("flip-90") << OutputTransform::Flipped90 << QSizeF(10, 20) << QSizeF(20, 10);
QTest::addRow("flip-180") << OutputTransform::Flipped180 << QSizeF(10, 20) << QSizeF(10, 20);
QTest::addRow("flip-270") << OutputTransform::Flipped270 << QSizeF(10, 20) << QSizeF(20, 10);
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << QSizeF(10, 20) << QSizeF(20, 10);
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << QSizeF(10, 20) << QSizeF(10, 20);
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << QSizeF(10, 20) << QSizeF(20, 10);
QTest::addRow("flip-x-0") << OutputTransform::FlipX << QSizeF(10, 20) << QSizeF(10, 20);
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << QSizeF(10, 20) << QSizeF(20, 10);
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << QSizeF(10, 20) << QSizeF(10, 20);
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << QSizeF(10, 20) << QSizeF(20, 10);
}
void TestOutputTransform::mapSizeF()
@ -74,13 +74,13 @@ void TestOutputTransform::mapSize_data()
QTest::addColumn<QSize>("target");
QTest::addRow("rotate-0") << OutputTransform::Normal << QSize(10, 20) << QSize(10, 20);
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << QSize(10, 20) << QSize(20, 10);
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << QSize(10, 20) << QSize(10, 20);
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << QSize(10, 20) << QSize(20, 10);
QTest::addRow("flip-0") << OutputTransform::Flipped << QSize(10, 20) << QSize(10, 20);
QTest::addRow("flip-90") << OutputTransform::Flipped90 << QSize(10, 20) << QSize(20, 10);
QTest::addRow("flip-180") << OutputTransform::Flipped180 << QSize(10, 20) << QSize(10, 20);
QTest::addRow("flip-270") << OutputTransform::Flipped270 << QSize(10, 20) << QSize(20, 10);
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << QSize(10, 20) << QSize(20, 10);
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << QSize(10, 20) << QSize(10, 20);
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << QSize(10, 20) << QSize(20, 10);
QTest::addRow("flip-x-0") << OutputTransform::FlipX << QSize(10, 20) << QSize(10, 20);
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << QSize(10, 20) << QSize(20, 10);
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << QSize(10, 20) << QSize(10, 20);
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << QSize(10, 20) << QSize(20, 10);
}
void TestOutputTransform::mapSize()
@ -99,13 +99,13 @@ void TestOutputTransform::mapRectF_data()
QTest::addColumn<QRectF>("target");
QTest::addRow("rotate-0") << OutputTransform::Normal << QRectF(10, 20, 30, 40) << QRectF(10, 20, 30, 40);
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << QRectF(10, 20, 30, 40) << QRectF(20, 60, 40, 30);
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << QRectF(10, 20, 30, 40) << QRectF(60, 140, 30, 40);
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << QRectF(10, 20, 30, 40) << QRectF(140, 10, 40, 30);
QTest::addRow("flip-0") << OutputTransform::Flipped << QRectF(10, 20, 30, 40) << QRectF(60, 20, 30, 40);
QTest::addRow("flip-90") << OutputTransform::Flipped90 << QRectF(10, 20, 30, 40) << QRectF(20, 10, 40, 30);
QTest::addRow("flip-180") << OutputTransform::Flipped180 << QRectF(10, 20, 30, 40) << QRectF(10, 140, 30, 40);
QTest::addRow("flip-270") << OutputTransform::Flipped270 << QRectF(10, 20, 30, 40) << QRectF(140, 60, 40, 30);
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << QRectF(10, 20, 30, 40) << QRectF(20, 60, 40, 30);
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << QRectF(10, 20, 30, 40) << QRectF(60, 140, 30, 40);
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << QRectF(10, 20, 30, 40) << QRectF(140, 10, 40, 30);
QTest::addRow("flip-x-0") << OutputTransform::FlipX << QRectF(10, 20, 30, 40) << QRectF(60, 20, 30, 40);
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << QRectF(10, 20, 30, 40) << QRectF(20, 10, 40, 30);
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << QRectF(10, 20, 30, 40) << QRectF(10, 140, 30, 40);
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << QRectF(10, 20, 30, 40) << QRectF(140, 60, 40, 30);
}
void TestOutputTransform::mapRectF()
@ -124,13 +124,13 @@ void TestOutputTransform::mapRect_data()
QTest::addColumn<QRect>("target");
QTest::addRow("rotate-0") << OutputTransform::Normal << QRect(10, 20, 30, 40) << QRect(10, 20, 30, 40);
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << QRect(10, 20, 30, 40) << QRect(20, 60, 40, 30);
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << QRect(10, 20, 30, 40) << QRect(60, 140, 30, 40);
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << QRect(10, 20, 30, 40) << QRect(140, 10, 40, 30);
QTest::addRow("flip-0") << OutputTransform::Flipped << QRect(10, 20, 30, 40) << QRect(60, 20, 30, 40);
QTest::addRow("flip-90") << OutputTransform::Flipped90 << QRect(10, 20, 30, 40) << QRect(20, 10, 40, 30);
QTest::addRow("flip-180") << OutputTransform::Flipped180 << QRect(10, 20, 30, 40) << QRect(10, 140, 30, 40);
QTest::addRow("flip-270") << OutputTransform::Flipped270 << QRect(10, 20, 30, 40) << QRect(140, 60, 40, 30);
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << QRect(10, 20, 30, 40) << QRect(20, 60, 40, 30);
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << QRect(10, 20, 30, 40) << QRect(60, 140, 30, 40);
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << QRect(10, 20, 30, 40) << QRect(140, 10, 40, 30);
QTest::addRow("flip-x-0") << OutputTransform::FlipX << QRect(10, 20, 30, 40) << QRect(60, 20, 30, 40);
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << QRect(10, 20, 30, 40) << QRect(20, 10, 40, 30);
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << QRect(10, 20, 30, 40) << QRect(10, 140, 30, 40);
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << QRect(10, 20, 30, 40) << QRect(140, 60, 40, 30);
}
void TestOutputTransform::mapRect()
@ -149,13 +149,13 @@ void TestOutputTransform::mapPointF_data()
QTest::addColumn<QPointF>("target");
QTest::addRow("rotate-0") << OutputTransform::Normal << QPointF(10, 20) << QPointF(10, 20);
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << QPointF(10, 20) << QPointF(20, 90);
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << QPointF(10, 20) << QPointF(90, 180);
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << QPointF(10, 20) << QPointF(180, 10);
QTest::addRow("flip-0") << OutputTransform::Flipped << QPointF(10, 20) << QPointF(90, 20);
QTest::addRow("flip-90") << OutputTransform::Flipped90 << QPointF(10, 20) << QPointF(20, 10);
QTest::addRow("flip-180") << OutputTransform::Flipped180 << QPointF(10, 20) << QPointF(10, 180);
QTest::addRow("flip-270") << OutputTransform::Flipped270 << QPointF(10, 20) << QPointF(180, 90);
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << QPointF(10, 20) << QPointF(20, 90);
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << QPointF(10, 20) << QPointF(90, 180);
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << QPointF(10, 20) << QPointF(180, 10);
QTest::addRow("flip-x-0") << OutputTransform::FlipX << QPointF(10, 20) << QPointF(90, 20);
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << QPointF(10, 20) << QPointF(20, 10);
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << QPointF(10, 20) << QPointF(10, 180);
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << QPointF(10, 20) << QPointF(180, 90);
}
void TestOutputTransform::mapPointF()
@ -177,13 +177,13 @@ void TestOutputTransform::mapPoint_data()
QTest::addColumn<QPoint>("target");
QTest::addRow("rotate-0") << OutputTransform::Normal << QPoint(10, 20) << QPoint(10, 20);
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << QPoint(10, 20) << QPoint(20, 90);
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << QPoint(10, 20) << QPoint(90, 180);
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << QPoint(10, 20) << QPoint(180, 10);
QTest::addRow("flip-0") << OutputTransform::Flipped << QPoint(10, 20) << QPoint(90, 20);
QTest::addRow("flip-90") << OutputTransform::Flipped90 << QPoint(10, 20) << QPoint(20, 10);
QTest::addRow("flip-180") << OutputTransform::Flipped180 << QPoint(10, 20) << QPoint(10, 180);
QTest::addRow("flip-270") << OutputTransform::Flipped270 << QPoint(10, 20) << QPoint(180, 90);
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << QPoint(10, 20) << QPoint(20, 90);
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << QPoint(10, 20) << QPoint(90, 180);
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << QPoint(10, 20) << QPoint(180, 10);
QTest::addRow("flip-x-0") << OutputTransform::FlipX << QPoint(10, 20) << QPoint(90, 20);
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << QPoint(10, 20) << QPoint(20, 10);
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << QPoint(10, 20) << QPoint(10, 180);
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << QPoint(10, 20) << QPoint(180, 90);
}
void TestOutputTransform::mapPoint()
@ -204,13 +204,13 @@ void TestOutputTransform::inverted_data()
QTest::addColumn<OutputTransform::Kind>("inverted");
QTest::addRow("rotate-0") << OutputTransform::Normal << OutputTransform::Normal;
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << OutputTransform::Rotated270;
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << OutputTransform::Rotated180;
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << OutputTransform::Rotated90;
QTest::addRow("flip-0") << OutputTransform::Flipped << OutputTransform::Flipped;
QTest::addRow("flip-90") << OutputTransform::Flipped90 << OutputTransform::Flipped90;
QTest::addRow("flip-180") << OutputTransform::Flipped180 << OutputTransform::Flipped180;
QTest::addRow("flip-270") << OutputTransform::Flipped270 << OutputTransform::Flipped270;
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << OutputTransform::Rotate270;
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << OutputTransform::Rotate180;
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << OutputTransform::Rotate90;
QTest::addRow("flip-x-0") << OutputTransform::FlipX << OutputTransform::FlipX;
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << OutputTransform::FlipX90;
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << OutputTransform::FlipX180;
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << OutputTransform::FlipX270;
}
void TestOutputTransform::inverted()
@ -228,76 +228,76 @@ void TestOutputTransform::combine_data()
QTest::addColumn<OutputTransform::Kind>("result");
QTest::addRow("rotate-0 | rotate-0") << OutputTransform::Normal << OutputTransform::Normal << OutputTransform::Normal;
QTest::addRow("rotate-90 | rotate-0") << OutputTransform::Rotated90 << OutputTransform::Normal << OutputTransform::Rotated90;
QTest::addRow("rotate-180 | rotate-0") << OutputTransform::Rotated180 << OutputTransform::Normal << OutputTransform::Rotated180;
QTest::addRow("rotate-270 | rotate-0") << OutputTransform::Rotated270 << OutputTransform::Normal << OutputTransform::Rotated270;
QTest::addRow("flip-0 | rotate-0") << OutputTransform::Flipped << OutputTransform::Normal << OutputTransform::Flipped;
QTest::addRow("flip-90 | rotate-0") << OutputTransform::Flipped90 << OutputTransform::Normal << OutputTransform::Flipped90;
QTest::addRow("flip-180 | rotate-0") << OutputTransform::Flipped180 << OutputTransform::Normal << OutputTransform::Flipped180;
QTest::addRow("flip-270 | rotate-0") << OutputTransform::Flipped270 << OutputTransform::Normal << OutputTransform::Flipped270;
QTest::addRow("rotate-90 | rotate-0") << OutputTransform::Rotate90 << OutputTransform::Normal << OutputTransform::Rotate90;
QTest::addRow("rotate-180 | rotate-0") << OutputTransform::Rotate180 << OutputTransform::Normal << OutputTransform::Rotate180;
QTest::addRow("rotate-270 | rotate-0") << OutputTransform::Rotate270 << OutputTransform::Normal << OutputTransform::Rotate270;
QTest::addRow("flip-x-0 | rotate-0") << OutputTransform::FlipX << OutputTransform::Normal << OutputTransform::FlipX;
QTest::addRow("flip-x-90 | rotate-0") << OutputTransform::FlipX90 << OutputTransform::Normal << OutputTransform::FlipX90;
QTest::addRow("flip-x-180 | rotate-0") << OutputTransform::FlipX180 << OutputTransform::Normal << OutputTransform::FlipX180;
QTest::addRow("flip-x-270 | rotate-0") << OutputTransform::FlipX270 << OutputTransform::Normal << OutputTransform::FlipX270;
QTest::addRow("rotate-0 | rotate-90") << OutputTransform::Normal << OutputTransform::Rotated90 << OutputTransform::Rotated90;
QTest::addRow("rotate-90 | rotate-90") << OutputTransform::Rotated90 << OutputTransform::Rotated90 << OutputTransform::Rotated180;
QTest::addRow("rotate-180 | rotate-90") << OutputTransform::Rotated180 << OutputTransform::Rotated90 << OutputTransform::Rotated270;
QTest::addRow("rotate-270 | rotate-90") << OutputTransform::Rotated270 << OutputTransform::Rotated90 << OutputTransform::Normal;
QTest::addRow("flip-0 | rotate-90") << OutputTransform::Flipped << OutputTransform::Rotated90 << OutputTransform::Flipped90;
QTest::addRow("flip-90 | rotate-90") << OutputTransform::Flipped90 << OutputTransform::Rotated90 << OutputTransform::Flipped180;
QTest::addRow("flip-180 | rotate-90") << OutputTransform::Flipped180 << OutputTransform::Rotated90 << OutputTransform::Flipped270;
QTest::addRow("flip-270 | rotate-90") << OutputTransform::Flipped270 << OutputTransform::Rotated90 << OutputTransform::Flipped;
QTest::addRow("rotate-0 | rotate-90") << OutputTransform::Normal << OutputTransform::Rotate90 << OutputTransform::Rotate90;
QTest::addRow("rotate-90 | rotate-90") << OutputTransform::Rotate90 << OutputTransform::Rotate90 << OutputTransform::Rotate180;
QTest::addRow("rotate-180 | rotate-90") << OutputTransform::Rotate180 << OutputTransform::Rotate90 << OutputTransform::Rotate270;
QTest::addRow("rotate-270 | rotate-90") << OutputTransform::Rotate270 << OutputTransform::Rotate90 << OutputTransform::Normal;
QTest::addRow("flip-x-0 | rotate-90") << OutputTransform::FlipX << OutputTransform::Rotate90 << OutputTransform::FlipX90;
QTest::addRow("flip-x-90 | rotate-90") << OutputTransform::FlipX90 << OutputTransform::Rotate90 << OutputTransform::FlipX180;
QTest::addRow("flip-x-180 | rotate-90") << OutputTransform::FlipX180 << OutputTransform::Rotate90 << OutputTransform::FlipX270;
QTest::addRow("flip-x-270 | rotate-90") << OutputTransform::FlipX270 << OutputTransform::Rotate90 << OutputTransform::FlipX;
QTest::addRow("rotate-0 | rotate-180") << OutputTransform::Normal << OutputTransform::Rotated180 << OutputTransform::Rotated180;
QTest::addRow("rotate-90 | rotate-180") << OutputTransform::Rotated90 << OutputTransform::Rotated180 << OutputTransform::Rotated270;
QTest::addRow("rotate-180 | rotate-180") << OutputTransform::Rotated180 << OutputTransform::Rotated180 << OutputTransform::Normal;
QTest::addRow("rotate-270 | rotate-180") << OutputTransform::Rotated270 << OutputTransform::Rotated180 << OutputTransform::Rotated90;
QTest::addRow("flip-0 | rotate-180") << OutputTransform::Flipped << OutputTransform::Rotated180 << OutputTransform::Flipped180;
QTest::addRow("flip-90 | rotate-180") << OutputTransform::Flipped90 << OutputTransform::Rotated180 << OutputTransform::Flipped270;
QTest::addRow("flip-180 | rotate-180") << OutputTransform::Flipped180 << OutputTransform::Rotated180 << OutputTransform::Flipped;
QTest::addRow("flip-270 | rotate-180") << OutputTransform::Flipped270 << OutputTransform::Rotated180 << OutputTransform::Flipped90;
QTest::addRow("rotate-0 | rotate-180") << OutputTransform::Normal << OutputTransform::Rotate180 << OutputTransform::Rotate180;
QTest::addRow("rotate-90 | rotate-180") << OutputTransform::Rotate90 << OutputTransform::Rotate180 << OutputTransform::Rotate270;
QTest::addRow("rotate-180 | rotate-180") << OutputTransform::Rotate180 << OutputTransform::Rotate180 << OutputTransform::Normal;
QTest::addRow("rotate-270 | rotate-180") << OutputTransform::Rotate270 << OutputTransform::Rotate180 << OutputTransform::Rotate90;
QTest::addRow("flip-x-0 | rotate-180") << OutputTransform::FlipX << OutputTransform::Rotate180 << OutputTransform::FlipX180;
QTest::addRow("flip-x-90 | rotate-180") << OutputTransform::FlipX90 << OutputTransform::Rotate180 << OutputTransform::FlipX270;
QTest::addRow("flip-x-180 | rotate-180") << OutputTransform::FlipX180 << OutputTransform::Rotate180 << OutputTransform::FlipX;
QTest::addRow("flip-x-270 | rotate-180") << OutputTransform::FlipX270 << OutputTransform::Rotate180 << OutputTransform::FlipX90;
QTest::addRow("rotate-0 | rotate-270") << OutputTransform::Normal << OutputTransform::Rotated270 << OutputTransform::Rotated270;
QTest::addRow("rotate-90 | rotate-270") << OutputTransform::Rotated90 << OutputTransform::Rotated270 << OutputTransform::Normal;
QTest::addRow("rotate-180 | rotate-270") << OutputTransform::Rotated180 << OutputTransform::Rotated270 << OutputTransform::Rotated90;
QTest::addRow("rotate-270 | rotate-270") << OutputTransform::Rotated270 << OutputTransform::Rotated270 << OutputTransform::Rotated180;
QTest::addRow("flip-0 | rotate-270") << OutputTransform::Flipped << OutputTransform::Rotated270 << OutputTransform::Flipped270;
QTest::addRow("flip-90 | rotate-270") << OutputTransform::Flipped90 << OutputTransform::Rotated270 << OutputTransform::Flipped;
QTest::addRow("flip-180 | rotate-270") << OutputTransform::Flipped180 << OutputTransform::Rotated270 << OutputTransform::Flipped90;
QTest::addRow("flip-270 | rotate-270") << OutputTransform::Flipped270 << OutputTransform::Rotated270 << OutputTransform::Flipped180;
QTest::addRow("rotate-0 | rotate-270") << OutputTransform::Normal << OutputTransform::Rotate270 << OutputTransform::Rotate270;
QTest::addRow("rotate-90 | rotate-270") << OutputTransform::Rotate90 << OutputTransform::Rotate270 << OutputTransform::Normal;
QTest::addRow("rotate-180 | rotate-270") << OutputTransform::Rotate180 << OutputTransform::Rotate270 << OutputTransform::Rotate90;
QTest::addRow("rotate-270 | rotate-270") << OutputTransform::Rotate270 << OutputTransform::Rotate270 << OutputTransform::Rotate180;
QTest::addRow("flip-x-0 | rotate-270") << OutputTransform::FlipX << OutputTransform::Rotate270 << OutputTransform::FlipX270;
QTest::addRow("flip-x-90 | rotate-270") << OutputTransform::FlipX90 << OutputTransform::Rotate270 << OutputTransform::FlipX;
QTest::addRow("flip-x-180 | rotate-270") << OutputTransform::FlipX180 << OutputTransform::Rotate270 << OutputTransform::FlipX90;
QTest::addRow("flip-x-270 | rotate-270") << OutputTransform::FlipX270 << OutputTransform::Rotate270 << OutputTransform::FlipX180;
QTest::addRow("rotate-0 | flip-0") << OutputTransform::Normal << OutputTransform::Flipped << OutputTransform::Flipped;
QTest::addRow("rotate-90 | flip-0") << OutputTransform::Rotated90 << OutputTransform::Flipped << OutputTransform::Flipped270;
QTest::addRow("rotate-180 | flip-0") << OutputTransform::Rotated180 << OutputTransform::Flipped << OutputTransform::Flipped180;
QTest::addRow("rotate-270 | flip-0") << OutputTransform::Rotated270 << OutputTransform::Flipped << OutputTransform::Flipped90;
QTest::addRow("flip-0 | flip-0") << OutputTransform::Flipped << OutputTransform::Flipped << OutputTransform::Normal;
QTest::addRow("flip-90 | flip-0") << OutputTransform::Flipped90 << OutputTransform::Flipped << OutputTransform::Rotated270;
QTest::addRow("flip-180 | flip-0") << OutputTransform::Flipped180 << OutputTransform::Flipped << OutputTransform::Rotated180;
QTest::addRow("flip-270 | flip-0") << OutputTransform::Flipped270 << OutputTransform::Flipped << OutputTransform::Rotated90;
QTest::addRow("rotate-0 | flip-x-0") << OutputTransform::Normal << OutputTransform::FlipX << OutputTransform::FlipX;
QTest::addRow("rotate-90 | flip-x-0") << OutputTransform::Rotate90 << OutputTransform::FlipX << OutputTransform::FlipX270;
QTest::addRow("rotate-180 | flip-x-0") << OutputTransform::Rotate180 << OutputTransform::FlipX << OutputTransform::FlipX180;
QTest::addRow("rotate-270 | flip-x-0") << OutputTransform::Rotate270 << OutputTransform::FlipX << OutputTransform::FlipX90;
QTest::addRow("flip-x-0 | flip-x-0") << OutputTransform::FlipX << OutputTransform::FlipX << OutputTransform::Normal;
QTest::addRow("flip-x-90 | flip-x-0") << OutputTransform::FlipX90 << OutputTransform::FlipX << OutputTransform::Rotate270;
QTest::addRow("flip-x-180 | flip-x-0") << OutputTransform::FlipX180 << OutputTransform::FlipX << OutputTransform::Rotate180;
QTest::addRow("flip-x-270 | flip-x-0") << OutputTransform::FlipX270 << OutputTransform::FlipX << OutputTransform::Rotate90;
QTest::addRow("rotate-0 | flip-90") << OutputTransform::Normal << OutputTransform::Flipped90 << OutputTransform::Flipped90;
QTest::addRow("rotate-90 | flip-90") << OutputTransform::Rotated90 << OutputTransform::Flipped90 << OutputTransform::Flipped;
QTest::addRow("rotate-180 | flip-90") << OutputTransform::Rotated180 << OutputTransform::Flipped90 << OutputTransform::Flipped270;
QTest::addRow("rotate-270 | flip-90") << OutputTransform::Rotated270 << OutputTransform::Flipped90 << OutputTransform::Flipped180;
QTest::addRow("flip-0 | flip-90") << OutputTransform::Flipped << OutputTransform::Flipped90 << OutputTransform::Rotated90;
QTest::addRow("flip-90 | flip-90") << OutputTransform::Flipped90 << OutputTransform::Flipped90 << OutputTransform::Normal;
QTest::addRow("flip-180 | flip-90") << OutputTransform::Flipped180 << OutputTransform::Flipped90 << OutputTransform::Rotated270;
QTest::addRow("flip-270 | flip-90") << OutputTransform::Flipped270 << OutputTransform::Flipped90 << OutputTransform::Rotated180;
QTest::addRow("rotate-0 | flip-x-90") << OutputTransform::Normal << OutputTransform::FlipX90 << OutputTransform::FlipX90;
QTest::addRow("rotate-90 | flip-x-90") << OutputTransform::Rotate90 << OutputTransform::FlipX90 << OutputTransform::FlipX;
QTest::addRow("rotate-180 | flip-x-90") << OutputTransform::Rotate180 << OutputTransform::FlipX90 << OutputTransform::FlipX270;
QTest::addRow("rotate-270 | flip-x-90") << OutputTransform::Rotate270 << OutputTransform::FlipX90 << OutputTransform::FlipX180;
QTest::addRow("flip-x-0 | flip-x-90") << OutputTransform::FlipX << OutputTransform::FlipX90 << OutputTransform::Rotate90;
QTest::addRow("flip-x-90 | flip-x-90") << OutputTransform::FlipX90 << OutputTransform::FlipX90 << OutputTransform::Normal;
QTest::addRow("flip-x-180 | flip-x-90") << OutputTransform::FlipX180 << OutputTransform::FlipX90 << OutputTransform::Rotate270;
QTest::addRow("flip-x-270 | flip-x-90") << OutputTransform::FlipX270 << OutputTransform::FlipX90 << OutputTransform::Rotate180;
QTest::addRow("rotate-0 | flip-180") << OutputTransform::Normal << OutputTransform::Flipped180 << OutputTransform::Flipped180;
QTest::addRow("rotate-90 | flip-180") << OutputTransform::Rotated90 << OutputTransform::Flipped180 << OutputTransform::Flipped90;
QTest::addRow("rotate-180 | flip-180") << OutputTransform::Rotated180 << OutputTransform::Flipped180 << OutputTransform::Flipped;
QTest::addRow("rotate-270 | flip-180") << OutputTransform::Rotated270 << OutputTransform::Flipped180 << OutputTransform::Flipped270;
QTest::addRow("flip-0 | flip-180") << OutputTransform::Flipped << OutputTransform::Flipped180 << OutputTransform::Rotated180;
QTest::addRow("flip-90 | flip-180") << OutputTransform::Flipped90 << OutputTransform::Flipped180 << OutputTransform::Rotated90;
QTest::addRow("flip-180 | flip-180") << OutputTransform::Flipped180 << OutputTransform::Flipped180 << OutputTransform::Normal;
QTest::addRow("flip-270 | flip-180") << OutputTransform::Flipped270 << OutputTransform::Flipped180 << OutputTransform::Rotated270;
QTest::addRow("rotate-0 | flip-x-180") << OutputTransform::Normal << OutputTransform::FlipX180 << OutputTransform::FlipX180;
QTest::addRow("rotate-90 | flip-x-180") << OutputTransform::Rotate90 << OutputTransform::FlipX180 << OutputTransform::FlipX90;
QTest::addRow("rotate-180 | flip-x-180") << OutputTransform::Rotate180 << OutputTransform::FlipX180 << OutputTransform::FlipX;
QTest::addRow("rotate-270 | flip-x-180") << OutputTransform::Rotate270 << OutputTransform::FlipX180 << OutputTransform::FlipX270;
QTest::addRow("flip-x-0 | flip-x-180") << OutputTransform::FlipX << OutputTransform::FlipX180 << OutputTransform::Rotate180;
QTest::addRow("flip-x-90 | flip-x-180") << OutputTransform::FlipX90 << OutputTransform::FlipX180 << OutputTransform::Rotate90;
QTest::addRow("flip-x-180 | flip-x-180") << OutputTransform::FlipX180 << OutputTransform::FlipX180 << OutputTransform::Normal;
QTest::addRow("flip-x-270 | flip-x-180") << OutputTransform::FlipX270 << OutputTransform::FlipX180 << OutputTransform::Rotate270;
QTest::addRow("rotate-0 | flip-270") << OutputTransform::Normal << OutputTransform::Flipped270 << OutputTransform::Flipped270;
QTest::addRow("rotate-90 | flip-270") << OutputTransform::Rotated90 << OutputTransform::Flipped270 << OutputTransform::Flipped180;
QTest::addRow("rotate-180 | flip-270") << OutputTransform::Rotated180 << OutputTransform::Flipped270 << OutputTransform::Flipped90;
QTest::addRow("rotate-270 | flip-270") << OutputTransform::Rotated270 << OutputTransform::Flipped270 << OutputTransform::Flipped;
QTest::addRow("flip-0 | flip-270") << OutputTransform::Flipped << OutputTransform::Flipped270 << OutputTransform::Rotated270;
QTest::addRow("flip-90 | flip-270") << OutputTransform::Flipped90 << OutputTransform::Flipped270 << OutputTransform::Rotated180;
QTest::addRow("flip-180 | flip-270") << OutputTransform::Flipped180 << OutputTransform::Flipped270 << OutputTransform::Rotated90;
QTest::addRow("flip-270 | flip-270") << OutputTransform::Flipped270 << OutputTransform::Flipped270 << OutputTransform::Normal;
QTest::addRow("rotate-0 | flip-x-270") << OutputTransform::Normal << OutputTransform::FlipX270 << OutputTransform::FlipX270;
QTest::addRow("rotate-90 | flip-x-270") << OutputTransform::Rotate90 << OutputTransform::FlipX270 << OutputTransform::FlipX180;
QTest::addRow("rotate-180 | flip-x-270") << OutputTransform::Rotate180 << OutputTransform::FlipX270 << OutputTransform::FlipX90;
QTest::addRow("rotate-270 | flip-x-270") << OutputTransform::Rotate270 << OutputTransform::FlipX270 << OutputTransform::FlipX;
QTest::addRow("flip-x-0 | flip-x-270") << OutputTransform::FlipX << OutputTransform::FlipX270 << OutputTransform::Rotate270;
QTest::addRow("flip-x-90 | flip-x-270") << OutputTransform::FlipX90 << OutputTransform::FlipX270 << OutputTransform::Rotate180;
QTest::addRow("flip-x-180 | flip-x-270") << OutputTransform::FlipX180 << OutputTransform::FlipX270 << OutputTransform::Rotate90;
QTest::addRow("flip-x-270 | flip-x-270") << OutputTransform::FlipX270 << OutputTransform::FlipX270 << OutputTransform::Normal;
}
void TestOutputTransform::combine()
@ -323,13 +323,13 @@ void TestOutputTransform::matrix_data()
QTest::addColumn<QRectF>("target");
QTest::addRow("rotate-0") << OutputTransform::Normal << QRectF(10, 20, 30, 40) << QRectF(10, 20, 30, 40);
QTest::addRow("rotate-90") << OutputTransform::Rotated90 << QRectF(10, 20, 30, 40) << QRectF(20, 60, 40, 30);
QTest::addRow("rotate-180") << OutputTransform::Rotated180 << QRectF(10, 20, 30, 40) << QRectF(60, 140, 30, 40);
QTest::addRow("rotate-270") << OutputTransform::Rotated270 << QRectF(10, 20, 30, 40) << QRectF(140, 10, 40, 30);
QTest::addRow("flip-0") << OutputTransform::Flipped << QRectF(10, 20, 30, 40) << QRectF(60, 20, 30, 40);
QTest::addRow("flip-90") << OutputTransform::Flipped90 << QRectF(10, 20, 30, 40) << QRectF(20, 10, 40, 30);
QTest::addRow("flip-180") << OutputTransform::Flipped180 << QRectF(10, 20, 30, 40) << QRectF(10, 140, 30, 40);
QTest::addRow("flip-270") << OutputTransform::Flipped270 << QRectF(10, 20, 30, 40) << QRectF(140, 60, 40, 30);
QTest::addRow("rotate-90") << OutputTransform::Rotate90 << QRectF(10, 20, 30, 40) << QRectF(20, 60, 40, 30);
QTest::addRow("rotate-180") << OutputTransform::Rotate180 << QRectF(10, 20, 30, 40) << QRectF(60, 140, 30, 40);
QTest::addRow("rotate-270") << OutputTransform::Rotate270 << QRectF(10, 20, 30, 40) << QRectF(140, 10, 40, 30);
QTest::addRow("flip-x-0") << OutputTransform::FlipX << QRectF(10, 20, 30, 40) << QRectF(60, 20, 30, 40);
QTest::addRow("flip-x-90") << OutputTransform::FlipX90 << QRectF(10, 20, 30, 40) << QRectF(20, 10, 40, 30);
QTest::addRow("flip-x-180") << OutputTransform::FlipX180 << QRectF(10, 20, 30, 40) << QRectF(10, 140, 30, 40);
QTest::addRow("flip-x-270") << OutputTransform::FlipX270 << QRectF(10, 20, 30, 40) << QRectF(140, 60, 40, 30);
}
void TestOutputTransform::matrix()

View file

@ -279,13 +279,13 @@ void TestWaylandOutput::testTransform_data()
QTest::addColumn<KWayland::Client::Output::Transform>("expected");
QTest::addColumn<KWin::OutputTransform::Kind>("actual");
QTest::newRow("90") << KWayland::Client::Output::Transform::Rotated90 << KWin::OutputTransform::Rotated90;
QTest::newRow("180") << KWayland::Client::Output::Transform::Rotated180 << KWin::OutputTransform::Rotated180;
QTest::newRow("270") << KWayland::Client::Output::Transform::Rotated270 << KWin::OutputTransform::Rotated270;
QTest::newRow("Flipped") << KWayland::Client::Output::Transform::Flipped << KWin::OutputTransform::Flipped;
QTest::newRow("Flipped 90") << KWayland::Client::Output::Transform::Flipped90 << KWin::OutputTransform::Flipped90;
QTest::newRow("Flipped 180") << KWayland::Client::Output::Transform::Flipped180 << KWin::OutputTransform::Flipped180;
QTest::newRow("Flipped 280") << KWayland::Client::Output::Transform::Flipped270 << KWin::OutputTransform::Flipped270;
QTest::newRow("90") << KWayland::Client::Output::Transform::Rotated90 << KWin::OutputTransform::Rotate90;
QTest::newRow("180") << KWayland::Client::Output::Transform::Rotated180 << KWin::OutputTransform::Rotate180;
QTest::newRow("270") << KWayland::Client::Output::Transform::Rotated270 << KWin::OutputTransform::Rotate270;
QTest::newRow("Flipped") << KWayland::Client::Output::Transform::Flipped << KWin::OutputTransform::FlipX;
QTest::newRow("Flipped 90") << KWayland::Client::Output::Transform::Flipped90 << KWin::OutputTransform::FlipX90;
QTest::newRow("Flipped 180") << KWayland::Client::Output::Transform::Flipped180 << KWin::OutputTransform::FlipX180;
QTest::newRow("Flipped 280") << KWayland::Client::Output::Transform::Flipped270 << KWin::OutputTransform::FlipX270;
}
void TestWaylandOutput::testTransform()

View file

@ -472,11 +472,11 @@ OutputTransform DrmConnector::toKWinTransform(PanelOrientation orientation)
case PanelOrientation::Normal:
return KWin::OutputTransform::Normal;
case PanelOrientation::RightUp:
return KWin::OutputTransform::Rotated270;
return KWin::OutputTransform::Rotate270;
case PanelOrientation::LeftUp:
return KWin::OutputTransform::Rotated90;
return KWin::OutputTransform::Rotate90;
case PanelOrientation::UpsideDown:
return KWin::OutputTransform::Rotated180;
return KWin::OutputTransform::Rotate180;
default:
Q_UNREACHABLE();
}

View file

@ -213,19 +213,19 @@ DrmPlane::Transformations outputToPlaneTransform(OutputTransform transform)
switch (transform.kind()) {
case OutputTransform::Normal:
return PlaneTrans::Rotate0;
case OutputTransform::Flipped:
case OutputTransform::FlipX:
return PlaneTrans::ReflectX | PlaneTrans::Rotate0;
case OutputTransform::Rotated90:
case OutputTransform::Rotate90:
return PlaneTrans::Rotate90;
case OutputTransform::Flipped90:
case OutputTransform::FlipX90:
return PlaneTrans::ReflectX | PlaneTrans::Rotate90;
case OutputTransform::Rotated180:
case OutputTransform::Rotate180:
return PlaneTrans::Rotate180;
case OutputTransform::Flipped180:
case OutputTransform::FlipX180:
return PlaneTrans::ReflectX | PlaneTrans::Rotate180;
case OutputTransform::Rotated270:
case OutputTransform::Rotate270:
return PlaneTrans::Rotate270;
case OutputTransform::Flipped270:
case OutputTransform::FlipX270:
return PlaneTrans::ReflectX | PlaneTrans::Rotate270;
default:
Q_UNREACHABLE();

View file

@ -172,19 +172,19 @@ QPointF devicePointToGlobalPosition(const QPointF &devicePos, const Output *outp
// TODO: Do we need to handle the flipped cases differently?
switch (output->transform().kind()) {
case OutputTransform::Normal:
case OutputTransform::Flipped:
case OutputTransform::FlipX:
break;
case OutputTransform::Rotated90:
case OutputTransform::Flipped90:
case OutputTransform::Rotate90:
case OutputTransform::FlipX90:
pos = QPointF(output->modeSize().height() - devicePos.y(), devicePos.x());
break;
case OutputTransform::Rotated180:
case OutputTransform::Flipped180:
case OutputTransform::Rotate180:
case OutputTransform::FlipX180:
pos = QPointF(output->modeSize().width() - devicePos.x(),
output->modeSize().height() - devicePos.y());
break;
case OutputTransform::Rotated270:
case OutputTransform::Flipped270:
case OutputTransform::Rotate270:
case OutputTransform::FlipX270:
pos = QPointF(devicePos.y(), output->modeSize().width() - devicePos.x());
break;
default:

View file

@ -71,16 +71,16 @@ OutputTransform OutputTransform::inverted() const
switch (m_kind) {
case Kind::Normal:
return Kind::Normal;
case Kind::Rotated90:
return Kind::Rotated270;
case Kind::Rotated180:
return Kind::Rotated180;
case Kind::Rotated270:
return Kind::Rotated90;
case Kind::Flipped:
case Kind::Flipped90:
case Kind::Flipped180:
case Kind::Flipped270:
case Kind::Rotate90:
return Kind::Rotate270;
case Kind::Rotate180:
return Kind::Rotate180;
case Kind::Rotate270:
return Kind::Rotate90;
case Kind::FlipX:
case Kind::FlipX90:
case Kind::FlipX180:
case Kind::FlipX270:
return m_kind; // inverse transform of a flip transform is itself
}
@ -92,37 +92,37 @@ QRectF OutputTransform::map(const QRectF &rect, const QSizeF &bounds) const
switch (m_kind) {
case Kind::Normal:
return rect;
case Kind::Rotated90:
case Kind::Rotate90:
return QRectF(rect.y(),
bounds.width() - (rect.x() + rect.width()),
rect.height(),
rect.width());
case Kind::Rotated180:
case Kind::Rotate180:
return QRectF(bounds.width() - (rect.x() + rect.width()),
bounds.height() - (rect.y() + rect.height()),
rect.width(),
rect.height());
case Kind::Rotated270:
case Kind::Rotate270:
return QRectF(bounds.height() - (rect.y() + rect.height()),
rect.x(),
rect.height(),
rect.width());
case Kind::Flipped:
case Kind::FlipX:
return QRectF(bounds.width() - (rect.x() + rect.width()),
rect.y(),
rect.width(),
rect.height());
case Kind::Flipped90:
case Kind::FlipX90:
return QRectF(rect.y(),
rect.x(),
rect.height(),
rect.width());
case Kind::Flipped180:
case Kind::FlipX180:
return QRectF(rect.x(),
bounds.height() - (rect.y() + rect.height()),
rect.width(),
rect.height());
case Kind::Flipped270:
case Kind::FlipX270:
return QRectF(bounds.height() - (rect.y() + rect.height()),
bounds.width() - (rect.x() + rect.width()),
rect.height(),
@ -137,37 +137,37 @@ QRect OutputTransform::map(const QRect &rect, const QSize &bounds) const
switch (m_kind) {
case Kind::Normal:
return rect;
case Kind::Rotated90:
case Kind::Rotate90:
return QRect(rect.y(),
bounds.width() - (rect.x() + rect.width()),
rect.height(),
rect.width());
case Kind::Rotated180:
case Kind::Rotate180:
return QRect(bounds.width() - (rect.x() + rect.width()),
bounds.height() - (rect.y() + rect.height()),
rect.width(),
rect.height());
case Kind::Rotated270:
case Kind::Rotate270:
return QRect(bounds.height() - (rect.y() + rect.height()),
rect.x(),
rect.height(),
rect.width());
case Kind::Flipped:
case Kind::FlipX:
return QRect(bounds.width() - (rect.x() + rect.width()),
rect.y(),
rect.width(),
rect.height());
case Kind::Flipped90:
case Kind::FlipX90:
return QRect(rect.y(),
rect.x(),
rect.height(),
rect.width());
case Kind::Flipped180:
case Kind::FlipX180:
return QRect(rect.x(),
bounds.height() - (rect.y() + rect.height()),
rect.width(),
rect.height());
case Kind::Flipped270:
case Kind::FlipX270:
return QRect(bounds.height() - (rect.y() + rect.height()),
bounds.width() - (rect.x() + rect.width()),
rect.height(),
@ -182,25 +182,25 @@ QPointF OutputTransform::map(const QPointF &point, const QSizeF &bounds) const
switch (m_kind) {
case Kind::Normal:
return point;
case Kind::Rotated90:
case Kind::Rotate90:
return QPointF(point.y(),
bounds.width() - point.x());
case Kind::Rotated180:
case Kind::Rotate180:
return QPointF(bounds.width() - point.x(),
bounds.height() - point.y());
case Kind::Rotated270:
case Kind::Rotate270:
return QPointF(bounds.height() - point.y(),
point.x());
case Kind::Flipped:
case Kind::FlipX:
return QPointF(bounds.width() - point.x(),
point.y());
case Kind::Flipped90:
case Kind::FlipX90:
return QPointF(point.y(),
point.x());
case Kind::Flipped180:
case Kind::FlipX180:
return QPointF(point.x(),
bounds.height() - point.y());
case Kind::Flipped270:
case Kind::FlipX270:
return QPointF(bounds.height() - point.y(),
bounds.width() - point.x());
default:
@ -213,25 +213,25 @@ QPoint OutputTransform::map(const QPoint &point, const QSize &bounds) const
switch (m_kind) {
case Kind::Normal:
return point;
case Kind::Rotated90:
case Kind::Rotate90:
return QPoint(point.y(),
bounds.width() - point.x());
case Kind::Rotated180:
case Kind::Rotate180:
return QPoint(bounds.width() - point.x(),
bounds.height() - point.y());
case Kind::Rotated270:
case Kind::Rotate270:
return QPoint(bounds.height() - point.y(),
point.x());
case Kind::Flipped:
case Kind::FlipX:
return QPoint(bounds.width() - point.x(),
point.y());
case Kind::Flipped90:
case Kind::FlipX90:
return QPoint(point.y(),
point.x());
case Kind::Flipped180:
case Kind::FlipX180:
return QPoint(point.x(),
bounds.height() - point.y());
case Kind::Flipped270:
case Kind::FlipX270:
return QPoint(bounds.height() - point.y(),
bounds.width() - point.x());
default:
@ -243,9 +243,9 @@ QSizeF OutputTransform::map(const QSizeF &size) const
{
switch (m_kind) {
case Kind::Normal:
case Kind::Rotated180:
case Kind::Flipped:
case Kind::Flipped180:
case Kind::Rotate180:
case Kind::FlipX:
case Kind::FlipX180:
return size;
default:
return size.transposed();
@ -256,9 +256,9 @@ QSize OutputTransform::map(const QSize &size) const
{
switch (m_kind) {
case Kind::Normal:
case Kind::Rotated180:
case Kind::Flipped:
case Kind::Flipped180:
case Kind::Rotate180:
case Kind::FlipX:
case Kind::FlipX180:
return size;
default:
return size.transposed();
@ -303,27 +303,27 @@ QMatrix4x4 OutputTransform::toMatrix() const
switch (m_kind) {
case Kind::Normal:
break;
case Kind::Rotated90:
case Kind::Rotate90:
matrix.rotate(-90, 0, 0, 1);
break;
case Kind::Rotated180:
case Kind::Rotate180:
matrix.rotate(-180, 0, 0, 1);
break;
case Kind::Rotated270:
case Kind::Rotate270:
matrix.rotate(-270, 0, 0, 1);
break;
case Kind::Flipped:
case Kind::FlipX:
matrix.scale(-1, 1);
break;
case Kind::Flipped90:
case Kind::FlipX90:
matrix.rotate(-90, 0, 0, 1);
matrix.scale(-1, 1);
break;
case Kind::Flipped180:
case Kind::FlipX180:
matrix.rotate(-180, 0, 0, 1);
matrix.scale(-1, 1);
break;
case Kind::Flipped270:
case Kind::FlipX270:
matrix.rotate(-270, 0, 0, 1);
matrix.scale(-1, 1);
break;
@ -627,10 +627,10 @@ void Output::setState(const State &state)
QSize Output::orientateSize(const QSize &size) const
{
switch (m_state.transform.kind()) {
case OutputTransform::Rotated90:
case OutputTransform::Rotated270:
case OutputTransform::Flipped90:
case OutputTransform::Flipped270:
case OutputTransform::Rotate90:
case OutputTransform::Rotate270:
case OutputTransform::FlipX90:
case OutputTransform::FlipX270:
return size.transposed();
default:
return size;
@ -653,30 +653,30 @@ QMatrix4x4 Output::logicalToNativeMatrix(const QRectF &rect, qreal scale, Output
switch (transform.kind()) {
case OutputTransform::Normal:
case OutputTransform::Flipped:
case OutputTransform::FlipX:
break;
case OutputTransform::Rotated90:
case OutputTransform::Flipped90:
case OutputTransform::Rotate90:
case OutputTransform::FlipX90:
matrix.translate(0, rect.width());
matrix.rotate(-90, 0, 0, 1);
break;
case OutputTransform::Rotated180:
case OutputTransform::Flipped180:
case OutputTransform::Rotate180:
case OutputTransform::FlipX180:
matrix.translate(rect.width(), rect.height());
matrix.rotate(-180, 0, 0, 1);
break;
case OutputTransform::Rotated270:
case OutputTransform::Flipped270:
case OutputTransform::Rotate270:
case OutputTransform::FlipX270:
matrix.translate(rect.height(), 0);
matrix.rotate(-270, 0, 0, 1);
break;
}
switch (transform.kind()) {
case OutputTransform::Flipped:
case OutputTransform::Flipped90:
case OutputTransform::Flipped180:
case OutputTransform::Flipped270:
case OutputTransform::FlipX:
case OutputTransform::FlipX90:
case OutputTransform::FlipX180:
case OutputTransform::FlipX270:
matrix.translate(rect.width(), 0);
matrix.scale(-1, 1);
break;

View file

@ -39,13 +39,13 @@ class KWIN_EXPORT OutputTransform
public:
enum Kind {
Normal = 0, // no rotation
Rotated90 = 1, // rotate 90 degrees counterclockwise
Rotated180 = 2, // rotate 180 degrees counterclockwise
Rotated270 = 3, // rotate 270 degrees counterclockwise
Flipped = 4, // mirror horizontally
Flipped90 = 5, // mirror horizontally, then rotate 90 degrees counterclockwise
Flipped180 = 6, // mirror horizontally, then rotate 180 degrees counterclockwise
Flipped270 = 7, // mirror horizontally, then rotate 270 degrees counterclockwise
Rotate90 = 1, // rotate 90 degrees counterclockwise
Rotate180 = 2, // rotate 180 degrees counterclockwise
Rotate270 = 3, // rotate 270 degrees counterclockwise
FlipX = 4, // mirror horizontally
FlipX90 = 5, // mirror horizontally, then rotate 90 degrees counterclockwise
FlipX180 = 6, // mirror horizontally, then rotate 180 degrees counterclockwise
FlipX270 = 7, // mirror horizontally, then rotate 270 degrees counterclockwise
};
OutputTransform() = default;

View file

@ -154,11 +154,11 @@ OutputTransform toKWinTransform(int rotation)
case None:
return OutputTransform::Normal;
case Left:
return OutputTransform::Rotated90;
return OutputTransform::Rotate90;
case Inverted:
return OutputTransform::Rotated180;
return OutputTransform::Rotate180;
case Right:
return OutputTransform::Rotated270;
return OutputTransform::Rotate270;
default:
Q_UNREACHABLE();
}

View file

@ -84,13 +84,13 @@ void OutputConfigurationStore::applyOrientationReading(OutputConfiguration &conf
changeset->transform = panelOrientation;
return;
case QOrientationReading::Orientation::TopDown:
changeset->transform = panelOrientation.combine(OutputTransform::Kind::Rotated180);
changeset->transform = panelOrientation.combine(OutputTransform::Kind::Rotate180);
return;
case QOrientationReading::Orientation::LeftUp:
changeset->transform = panelOrientation.combine(OutputTransform::Kind::Rotated90);
changeset->transform = panelOrientation.combine(OutputTransform::Kind::Rotate90);
return;
case QOrientationReading::Orientation::RightUp:
changeset->transform = panelOrientation.combine(OutputTransform::Kind::Rotated270);
changeset->transform = panelOrientation.combine(OutputTransform::Kind::Rotate270);
return;
case QOrientationReading::Orientation::FaceUp:
case QOrientationReading::Orientation::FaceDown:
@ -604,19 +604,19 @@ void OutputConfigurationStore::load()
if (str == "Normal") {
state.transform = state.manualTransform = OutputTransform::Kind::Normal;
} else if (str == "Rotated90") {
state.transform = state.manualTransform = OutputTransform::Kind::Rotated90;
state.transform = state.manualTransform = OutputTransform::Kind::Rotate90;
} else if (str == "Rotated180") {
state.transform = state.manualTransform = OutputTransform::Kind::Rotated180;
state.transform = state.manualTransform = OutputTransform::Kind::Rotate180;
} else if (str == "Rotated270") {
state.transform = state.manualTransform = OutputTransform::Kind::Rotated270;
state.transform = state.manualTransform = OutputTransform::Kind::Rotate270;
} else if (str == "Flipped") {
state.transform = state.manualTransform = OutputTransform::Kind::Flipped;
state.transform = state.manualTransform = OutputTransform::Kind::FlipX;
} else if (str == "Flipped90") {
state.transform = state.manualTransform = OutputTransform::Kind::Flipped90;
state.transform = state.manualTransform = OutputTransform::Kind::FlipX90;
} else if (str == "Flipped180") {
state.transform = state.manualTransform = OutputTransform::Kind::Flipped180;
state.transform = state.manualTransform = OutputTransform::Kind::FlipX180;
} else if (str == "Flipped270") {
state.transform = state.manualTransform = OutputTransform::Kind::Flipped270;
state.transform = state.manualTransform = OutputTransform::Kind::FlipX270;
}
}
if (const auto it = data.find("overscan"); it != data.end()) {
@ -823,19 +823,19 @@ void OutputConfigurationStore::save()
}
if (output.manualTransform == OutputTransform::Kind::Normal) {
o["transform"] = "Normal";
} else if (output.manualTransform == OutputTransform::Kind::Rotated90) {
} else if (output.manualTransform == OutputTransform::Kind::Rotate90) {
o["transform"] = "Rotated90";
} else if (output.manualTransform == OutputTransform::Kind::Rotated180) {
} else if (output.manualTransform == OutputTransform::Kind::Rotate180) {
o["transform"] = "Rotated180";
} else if (output.manualTransform == OutputTransform::Kind::Rotated270) {
} else if (output.manualTransform == OutputTransform::Kind::Rotate270) {
o["transform"] = "Rotated270";
} else if (output.manualTransform == OutputTransform::Kind::Flipped) {
} else if (output.manualTransform == OutputTransform::Kind::FlipX) {
o["transform"] = "Flipped";
} else if (output.manualTransform == OutputTransform::Kind::Flipped90) {
} else if (output.manualTransform == OutputTransform::Kind::FlipX90) {
o["transform"] = "Flipped90";
} else if (output.manualTransform == OutputTransform::Kind::Flipped180) {
} else if (output.manualTransform == OutputTransform::Kind::FlipX180) {
o["transform"] = "Flipped180";
} else if (output.manualTransform == OutputTransform::Kind::Flipped270) {
} else if (output.manualTransform == OutputTransform::Kind::FlipX270) {
o["transform"] = "Flipped270";
}
if (output.overscan) {

View file

@ -146,32 +146,32 @@ void ItemRendererQPainter::renderSurfaceItem(QPainter *painter, SurfaceItem *sur
switch (surfaceToBufferTransform.kind()) {
case OutputTransform::Normal:
break;
case OutputTransform::Rotated90:
case OutputTransform::Rotate90:
painter->translate(0, transformedSize.width());
painter->rotate(-90);
break;
case OutputTransform::Rotated180:
case OutputTransform::Rotate180:
painter->translate(transformedSize.width(), transformedSize.height());
painter->rotate(-180);
break;
case OutputTransform::Rotated270:
case OutputTransform::Rotate270:
painter->translate(transformedSize.height(), 0);
painter->rotate(-270);
break;
case OutputTransform::Flipped:
case OutputTransform::FlipX:
painter->translate(transformedSize.width(), 0);
painter->scale(-1, 1);
break;
case OutputTransform::Flipped90:
case OutputTransform::FlipX90:
painter->rotate(-90);
painter->scale(-1, 1);
break;
case OutputTransform::Flipped180:
case OutputTransform::FlipX180:
painter->translate(0, transformedSize.height());
painter->rotate(-180);
painter->scale(-1, 1);
break;
case OutputTransform::Flipped270:
case OutputTransform::FlipX270:
painter->translate(transformedSize.height(), transformedSize.width());
painter->rotate(-270);
painter->scale(-1, 1);

View file

@ -80,19 +80,19 @@ static quint32 kwaylandServerTransformToWaylandTransform(OutputTransform transfo
switch (transform.kind()) {
case OutputTransform::Normal:
return OutputInterfacePrivate::transform_normal;
case OutputTransform::Rotated90:
case OutputTransform::Rotate90:
return OutputInterfacePrivate::transform_90;
case OutputTransform::Rotated180:
case OutputTransform::Rotate180:
return OutputInterfacePrivate::transform_180;
case OutputTransform::Rotated270:
case OutputTransform::Rotate270:
return OutputInterfacePrivate::transform_270;
case OutputTransform::Flipped:
case OutputTransform::FlipX:
return OutputInterfacePrivate::transform_flipped;
case OutputTransform::Flipped90:
case OutputTransform::FlipX90:
return OutputInterfacePrivate::transform_flipped_90;
case OutputTransform::Flipped180:
case OutputTransform::FlipX180:
return OutputInterfacePrivate::transform_flipped_180;
case OutputTransform::Flipped270:
case OutputTransform::FlipX270:
return OutputInterfacePrivate::transform_flipped_270;
default:
Q_UNREACHABLE();

View file

@ -133,19 +133,19 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_transform(Resou
auto toTransform = [transform]() {
switch (transform) {
case WL_OUTPUT_TRANSFORM_90:
return OutputTransform::Rotated90;
return OutputTransform::Rotate90;
case WL_OUTPUT_TRANSFORM_180:
return OutputTransform::Rotated180;
return OutputTransform::Rotate180;
case WL_OUTPUT_TRANSFORM_270:
return OutputTransform::Rotated270;
return OutputTransform::Rotate270;
case WL_OUTPUT_TRANSFORM_FLIPPED:
return OutputTransform::Flipped;
return OutputTransform::FlipX;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
return OutputTransform::Flipped90;
return OutputTransform::FlipX90;
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
return OutputTransform::Flipped180;
return OutputTransform::FlipX180;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
return OutputTransform::Flipped270;
return OutputTransform::FlipX270;
case WL_OUTPUT_TRANSFORM_NORMAL:
default:
return OutputTransform::Normal;

View file

@ -497,33 +497,33 @@ QMatrix4x4 SurfaceInterfacePrivate::buildSurfaceToBufferMatrix()
switch (current->bufferTransform.kind()) {
case OutputTransform::Normal:
case OutputTransform::Flipped:
case OutputTransform::FlipX:
break;
case OutputTransform::Rotated90:
case OutputTransform::Flipped90:
case OutputTransform::Rotate90:
case OutputTransform::FlipX90:
surfaceToBufferMatrix.translate(0, bufferSize.height() / current->bufferScale);
surfaceToBufferMatrix.rotate(-90, 0, 0, 1);
break;
case OutputTransform::Rotated180:
case OutputTransform::Flipped180:
case OutputTransform::Rotate180:
case OutputTransform::FlipX180:
surfaceToBufferMatrix.translate(bufferSize.width() / current->bufferScale, bufferSize.height() / current->bufferScale);
surfaceToBufferMatrix.rotate(-180, 0, 0, 1);
break;
case OutputTransform::Rotated270:
case OutputTransform::Flipped270:
case OutputTransform::Rotate270:
case OutputTransform::FlipX270:
surfaceToBufferMatrix.translate(bufferSize.width() / current->bufferScale, 0);
surfaceToBufferMatrix.rotate(-270, 0, 0, 1);
break;
}
switch (current->bufferTransform.kind()) {
case OutputTransform::Flipped:
case OutputTransform::Flipped180:
case OutputTransform::FlipX:
case OutputTransform::FlipX180:
surfaceToBufferMatrix.translate(bufferSize.width() / current->bufferScale, 0);
surfaceToBufferMatrix.scale(-1, 1);
break;
case OutputTransform::Flipped90:
case OutputTransform::Flipped270:
case OutputTransform::FlipX90:
case OutputTransform::FlipX270:
surfaceToBufferMatrix.translate(bufferSize.height() / current->bufferScale, 0);
surfaceToBufferMatrix.scale(-1, 1);
break;