clutter/stage-view: Simplify painting of offscreen slightly

We will only ever have an "offscreen" if we're painting transformed in
some way, so the 'can_blit' checking is unnecessary. Remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
This commit is contained in:
Jonas Ådahl 2020-05-05 18:59:32 +02:00 committed by Georges Basile Stavracas Neto
parent 4e27a4ea1d
commit db975bd2a8

View File

@ -167,28 +167,13 @@ clutter_stage_view_invalidate_offscreen_blit_pipeline (ClutterStageView *view)
} }
static void static void
clutter_stage_view_copy_to_framebuffer (ClutterStageView *view, paint_transformed_framebuffer (ClutterStageView *view,
CoglPipeline *pipeline, CoglPipeline *pipeline,
CoglFramebuffer *src_framebuffer, CoglFramebuffer *src_framebuffer,
CoglFramebuffer *dst_framebuffer, CoglFramebuffer *dst_framebuffer)
gboolean can_blit)
{ {
CoglMatrix matrix; CoglMatrix matrix;
/* First, try with blit */
if (can_blit)
{
if (cogl_blit_framebuffer (src_framebuffer,
dst_framebuffer,
0, 0,
0, 0,
cogl_framebuffer_get_width (dst_framebuffer),
cogl_framebuffer_get_height (dst_framebuffer),
NULL))
return;
}
/* If blit fails, fallback to the slower painting method */
cogl_framebuffer_push_matrix (dst_framebuffer); cogl_framebuffer_push_matrix (dst_framebuffer);
cogl_matrix_init_identity (&matrix); cogl_matrix_init_identity (&matrix);
@ -285,28 +270,21 @@ clutter_stage_view_after_paint (ClutterStageView *view)
if (priv->offscreen) if (priv->offscreen)
{ {
gboolean can_blit;
CoglMatrix matrix;
clutter_stage_view_ensure_offscreen_blit_pipeline (view); clutter_stage_view_ensure_offscreen_blit_pipeline (view);
clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix);
can_blit = cogl_matrix_is_identity (&matrix);
if (priv->shadow.framebuffer) if (priv->shadow.framebuffer)
{ {
clutter_stage_view_copy_to_framebuffer (view, paint_transformed_framebuffer (view,
priv->offscreen_pipeline, priv->offscreen_pipeline,
priv->offscreen, priv->offscreen,
priv->shadow.framebuffer, priv->shadow.framebuffer);
can_blit);
} }
else else
{ {
clutter_stage_view_copy_to_framebuffer (view, paint_transformed_framebuffer (view,
priv->offscreen_pipeline, priv->offscreen_pipeline,
priv->offscreen, priv->offscreen,
priv->framebuffer, priv->framebuffer);
can_blit);
} }
} }