mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 10:30:40 +00:00
gtk4: Use scale instead of rotate where possible
In order to make it easier for GTK4 to figure out that the resulting operation is 2D and - crucially - can get offloaded to Wayland. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1662>
This commit is contained in:
parent
2238db2005
commit
c7ef8e8185
1 changed files with 5 additions and 6 deletions
|
@ -253,25 +253,24 @@ impl PaintableImpl for Paintable {
|
||||||
snapshot.rotate(90.0);
|
snapshot.rotate(90.0);
|
||||||
}
|
}
|
||||||
frame::Orientation::Rotate180 => {
|
frame::Orientation::Rotate180 => {
|
||||||
snapshot.rotate(180.0);
|
snapshot.scale(-1.0, -1.0);
|
||||||
}
|
}
|
||||||
frame::Orientation::Rotate270 => {
|
frame::Orientation::Rotate270 => {
|
||||||
snapshot.rotate(270.0);
|
snapshot.rotate(270.0);
|
||||||
}
|
}
|
||||||
frame::Orientation::FlipRotate0 => {
|
frame::Orientation::FlipRotate0 => {
|
||||||
snapshot.rotate_3d(180.0, >k::graphene::Vec3::y_axis());
|
snapshot.scale(-1.0, 1.0);
|
||||||
}
|
}
|
||||||
frame::Orientation::FlipRotate90 => {
|
frame::Orientation::FlipRotate90 => {
|
||||||
snapshot.rotate(90.0);
|
snapshot.rotate(90.0);
|
||||||
snapshot.rotate_3d(180.0, >k::graphene::Vec3::y_axis());
|
snapshot.scale(-1.0, 1.0);
|
||||||
}
|
}
|
||||||
frame::Orientation::FlipRotate180 => {
|
frame::Orientation::FlipRotate180 => {
|
||||||
snapshot.rotate(180.0);
|
snapshot.scale(1.0, -1.0);
|
||||||
snapshot.rotate_3d(180.0, >k::graphene::Vec3::y_axis());
|
|
||||||
}
|
}
|
||||||
frame::Orientation::FlipRotate270 => {
|
frame::Orientation::FlipRotate270 => {
|
||||||
snapshot.rotate(270.0);
|
snapshot.rotate(270.0);
|
||||||
snapshot.rotate_3d(180.0, >k::graphene::Vec3::y_axis());
|
snapshot.scale(-1.0, 1.0);
|
||||||
}
|
}
|
||||||
frame::Orientation::Auto => unreachable!(),
|
frame::Orientation::Auto => unreachable!(),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue