[mutter] clutter/stage-view: Simplify painting of offscreen slightly
- From: verdre <jonasd src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/stage-view: Simplify painting of offscreen slightly
- Date: Tue, 26 May 2020 14:21:46 +0000 (UTC)
commit db975bd2a8d29557386d0c068c0de53a60c3b34a
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue May 5 18:59:32 2020 +0200
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
clutter/clutter/clutter-stage-view.c | 46 ++++++++++--------------------------
1 file changed, 12 insertions(+), 34 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index a9b202f8cd..b7a3d67162 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -167,28 +167,13 @@ clutter_stage_view_invalidate_offscreen_blit_pipeline (ClutterStageView *view)
}
static void
-clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
- CoglPipeline *pipeline,
- CoglFramebuffer *src_framebuffer,
- CoglFramebuffer *dst_framebuffer,
- gboolean can_blit)
+paint_transformed_framebuffer (ClutterStageView *view,
+ CoglPipeline *pipeline,
+ CoglFramebuffer *src_framebuffer,
+ CoglFramebuffer *dst_framebuffer)
{
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_matrix_init_identity (&matrix);
@@ -285,28 +270,21 @@ clutter_stage_view_after_paint (ClutterStageView *view)
if (priv->offscreen)
{
- gboolean can_blit;
- CoglMatrix matrix;
-
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)
{
- clutter_stage_view_copy_to_framebuffer (view,
- priv->offscreen_pipeline,
- priv->offscreen,
- priv->shadow.framebuffer,
- can_blit);
+ paint_transformed_framebuffer (view,
+ priv->offscreen_pipeline,
+ priv->offscreen,
+ priv->shadow.framebuffer);
}
else
{
- clutter_stage_view_copy_to_framebuffer (view,
- priv->offscreen_pipeline,
- priv->offscreen,
- priv->framebuffer,
- can_blit);
+ paint_transformed_framebuffer (view,
+ priv->offscreen_pipeline,
+ priv->offscreen,
+ priv->framebuffer);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]