renderer-view: Use graphene APIs

Yet another case of swapping operations order upside down.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
This commit is contained in:
Georges Basile Stavracas Neto 2020-09-11 19:12:06 -03:00
parent 4376f59c1e
commit f676861054

View File

@ -79,41 +79,41 @@ meta_renderer_view_get_offscreen_transformation_matrix (ClutterStageView *view,
{ {
MetaRendererView *renderer_view = META_RENDERER_VIEW (view); MetaRendererView *renderer_view = META_RENDERER_VIEW (view);
cogl_matrix_init_identity (matrix); graphene_matrix_init_identity (matrix);
switch (renderer_view->transform) switch (renderer_view->transform)
{ {
case META_MONITOR_TRANSFORM_NORMAL: case META_MONITOR_TRANSFORM_NORMAL:
break; break;
case META_MONITOR_TRANSFORM_90: case META_MONITOR_TRANSFORM_90:
cogl_matrix_rotate (matrix, 90, 0, 0, 1); graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (0, -1, 0));
cogl_matrix_translate (matrix, 0, -1, 0); graphene_matrix_rotate (matrix, 90, graphene_vec3_z_axis ());
break; break;
case META_MONITOR_TRANSFORM_180: case META_MONITOR_TRANSFORM_180:
cogl_matrix_rotate (matrix, 180, 0, 0, 1); graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, -1, 0));
cogl_matrix_translate (matrix, -1, -1, 0); graphene_matrix_rotate (matrix, 180, graphene_vec3_z_axis ());
break; break;
case META_MONITOR_TRANSFORM_270: case META_MONITOR_TRANSFORM_270:
cogl_matrix_rotate (matrix, 270, 0, 0, 1); graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, 0, 0));
cogl_matrix_translate (matrix, -1, 0, 0); graphene_matrix_rotate (matrix, 270, graphene_vec3_z_axis ());
break; break;
case META_MONITOR_TRANSFORM_FLIPPED: case META_MONITOR_TRANSFORM_FLIPPED:
cogl_matrix_scale (matrix, -1, 1, 1); graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, 0, 0));
cogl_matrix_translate (matrix, -1, 0, 0); graphene_matrix_scale (matrix, -1, 1, 1);
break; break;
case META_MONITOR_TRANSFORM_FLIPPED_90: case META_MONITOR_TRANSFORM_FLIPPED_90:
cogl_matrix_scale (matrix, -1, 1, 1); graphene_matrix_rotate (matrix, 90, graphene_vec3_z_axis ());
cogl_matrix_rotate (matrix, 90, 0, 0, 1); graphene_matrix_scale (matrix, -1, 1, 1);
break; break;
case META_MONITOR_TRANSFORM_FLIPPED_180: case META_MONITOR_TRANSFORM_FLIPPED_180:
cogl_matrix_scale (matrix, -1, 1, 1); graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (0, -1, 0));
cogl_matrix_rotate (matrix, 180, 0, 0, 1); graphene_matrix_rotate (matrix, 180, graphene_vec3_z_axis ());
cogl_matrix_translate (matrix, 0, -1, 0); graphene_matrix_scale (matrix, -1, 1, 1);
break; break;
case META_MONITOR_TRANSFORM_FLIPPED_270: case META_MONITOR_TRANSFORM_FLIPPED_270:
cogl_matrix_scale (matrix, -1, 1, 1); graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, -1, 0));
cogl_matrix_rotate (matrix, 270, 0, 0, 1); graphene_matrix_rotate (matrix, 270, graphene_vec3_z_axis ());
cogl_matrix_translate (matrix, -1, -1, 0); graphene_matrix_scale (matrix, -1, 1, 1);
break; break;
} }
} }