mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
clutter/stage-view: Use graphene APIs
In this case, since we are building the entire matrix by ourselves, reverse the order of operations (translate + scale → scale + translate) and build it using graphene-specific APIs. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
This commit is contained in:
parent
dc8f875a8a
commit
aca2880c6a
@ -236,13 +236,14 @@ paint_transformed_framebuffer (ClutterStageView *view,
|
||||
|
||||
cogl_framebuffer_push_matrix (dst_framebuffer);
|
||||
|
||||
cogl_matrix_init_identity (&matrix);
|
||||
cogl_matrix_scale (&matrix,
|
||||
1.0 / (dst_width / 2.0),
|
||||
-1.0 / (dst_height / 2.0), 0);
|
||||
cogl_matrix_translate (&matrix,
|
||||
-(dst_width / 2.0),
|
||||
-(dst_height / 2.0), 0);
|
||||
graphene_matrix_init_translate (&matrix,
|
||||
&GRAPHENE_POINT3D_INIT (-dst_width / 2.0,
|
||||
-dst_height / 2.0,
|
||||
0.f));
|
||||
graphene_matrix_scale (&matrix,
|
||||
1.0 / (dst_width / 2.0),
|
||||
-1.0 / (dst_height / 2.0),
|
||||
0.f);
|
||||
cogl_framebuffer_set_projection_matrix (dst_framebuffer, &matrix);
|
||||
cogl_framebuffer_set_viewport (dst_framebuffer,
|
||||
0, 0, dst_width, dst_height);
|
||||
@ -987,7 +988,7 @@ static void
|
||||
clutter_stage_default_get_offscreen_transformation_matrix (ClutterStageView *view,
|
||||
graphene_matrix_t *matrix)
|
||||
{
|
||||
cogl_matrix_init_identity (matrix);
|
||||
graphene_matrix_init_identity (matrix);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user