[mutter] clutter/stage-view: Move shadowfb struct fields into anonymous struct
- From: verdre <jonasd src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/stage-view: Move shadowfb struct fields into anonymous struct
- Date: Tue, 26 May 2020 14:21:15 +0000 (UTC)
commit 675a2d13b933f188d4a78f8e70a92151f31d2dec
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Apr 30 18:19:30 2020 +0200
clutter/stage-view: Move shadowfb struct fields into anonymous struct
With the aim to collect shadow buffer related things in one place, place
them in an anonymous struct.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
clutter/clutter/clutter-stage-view.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index c24fab4f79..0aa92f3fbf 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -55,8 +55,10 @@ typedef struct _ClutterStageViewPrivate
CoglPipeline *offscreen_pipeline;
gboolean use_shadowfb;
- CoglOffscreen *shadowfb;
- CoglPipeline *shadowfb_pipeline;
+ struct {
+ CoglOffscreen *framebuffer;
+ CoglPipeline *pipeline;
+ } shadow;
CoglScanout *next_scanout;
@@ -95,8 +97,8 @@ clutter_stage_view_get_framebuffer (ClutterStageView *view)
if (priv->offscreen)
return priv->offscreen;
- else if (priv->shadowfb)
- return priv->shadowfb;
+ else if (priv->shadow.framebuffer)
+ return priv->shadow.framebuffer;
else
return priv->framebuffer;
}
@@ -162,11 +164,11 @@ clutter_stage_view_ensure_shadowfb_blit_pipeline (ClutterStageView *view)
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
- if (priv->shadowfb_pipeline)
+ if (priv->shadow.pipeline)
return;
- priv->shadowfb_pipeline =
- clutter_stage_view_create_framebuffer_pipeline (priv->shadowfb);
+ priv->shadow.pipeline =
+ clutter_stage_view_create_framebuffer_pipeline (priv->shadow.framebuffer);
}
void
@@ -260,7 +262,7 @@ init_offscreen_shadowfb (ClutterStageView *view,
if (!offscreen)
return FALSE;
- priv->shadowfb = offscreen;
+ priv->shadow.framebuffer = offscreen;
return TRUE;
}
@@ -304,12 +306,12 @@ clutter_stage_view_after_paint (ClutterStageView *view)
clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix);
can_blit = cogl_matrix_is_identity (&matrix);
- if (priv->shadowfb)
+ if (priv->shadow.framebuffer)
{
clutter_stage_view_copy_to_framebuffer (view,
priv->offscreen_pipeline,
priv->offscreen,
- priv->shadowfb,
+ priv->shadow.framebuffer,
can_blit);
}
else
@@ -322,12 +324,12 @@ clutter_stage_view_after_paint (ClutterStageView *view)
}
}
- if (priv->shadowfb)
+ if (priv->shadow.framebuffer)
{
clutter_stage_view_ensure_shadowfb_blit_pipeline (view);
clutter_stage_view_copy_to_framebuffer (view,
- priv->shadowfb_pipeline,
- priv->shadowfb,
+ priv->shadow.pipeline,
+ priv->shadow.framebuffer,
priv->framebuffer,
TRUE);
}
@@ -616,10 +618,10 @@ clutter_stage_view_dispose (GObject *object)
g_clear_pointer (&priv->name, g_free);
g_clear_pointer (&priv->framebuffer, cogl_object_unref);
- g_clear_pointer (&priv->shadowfb, cogl_object_unref);
+ g_clear_pointer (&priv->shadow.framebuffer, cogl_object_unref);
+ g_clear_pointer (&priv->shadow.pipeline, cogl_object_unref);
g_clear_pointer (&priv->offscreen, cogl_object_unref);
g_clear_pointer (&priv->offscreen_pipeline, cogl_object_unref);
- g_clear_pointer (&priv->shadowfb_pipeline, cogl_object_unref);
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
G_OBJECT_CLASS (clutter_stage_view_parent_class)->dispose (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]