[mutter] clutter/stage-view: Move frambuffer prop setting into helper
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/stage-view: Move frambuffer prop setting into helper
- Date: Thu, 2 Jul 2020 20:52:03 +0000 (UTC)
commit 5e7ce7ea75ab3d705ff430781167f6090a13ae46
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Apr 9 10:36:28 2020 +0200
clutter/stage-view: Move frambuffer prop setting into helper
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
clutter/clutter/clutter-stage-view.c | 41 +++++++++++++++++++++++-------------
1 file changed, 26 insertions(+), 15 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index 29f43332b0..eb5d52fdb7 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -991,6 +991,31 @@ clutter_stage_view_take_scanout (ClutterStageView *view)
return g_steal_pointer (&priv->next_scanout);
}
+static void
+clutter_stage_view_set_framebuffer (ClutterStageView *view,
+ CoglFramebuffer *framebuffer)
+{
+ ClutterStageViewPrivate *priv =
+ clutter_stage_view_get_instance_private (view);
+
+ priv->framebuffer = cogl_object_ref (framebuffer);
+
+#ifndef G_DISABLE_CHECKS
+ if (priv->framebuffer)
+ {
+ int fb_width, fb_height;
+
+ fb_width = cogl_framebuffer_get_width (priv->framebuffer);
+ fb_height = cogl_framebuffer_get_height (priv->framebuffer);
+
+ g_warn_if_fail (fabsf (roundf (fb_width / priv->scale) -
+ fb_width / priv->scale) < FLT_EPSILON);
+ g_warn_if_fail (fabsf (roundf (fb_height / priv->scale) -
+ fb_height / priv->scale) < FLT_EPSILON);
+ }
+#endif
+}
+
static void
clutter_stage_view_get_property (GObject *object,
guint prop_id,
@@ -1053,21 +1078,7 @@ clutter_stage_view_set_property (GObject *object,
priv->layout = *layout;
break;
case PROP_FRAMEBUFFER:
- priv->framebuffer = g_value_dup_boxed (value);
-#ifndef G_DISABLE_CHECKS
- if (priv->framebuffer)
- {
- int fb_width, fb_height;
-
- fb_width = cogl_framebuffer_get_width (priv->framebuffer);
- fb_height = cogl_framebuffer_get_height (priv->framebuffer);
-
- g_warn_if_fail (fabsf (roundf (fb_width / priv->scale) -
- fb_width / priv->scale) < FLT_EPSILON);
- g_warn_if_fail (fabsf (roundf (fb_height / priv->scale) -
- fb_height / priv->scale) < FLT_EPSILON);
- }
-#endif
+ clutter_stage_view_set_framebuffer (view, g_value_get_boxed (value));
break;
case PROP_OFFSCREEN:
priv->offscreen = g_value_dup_boxed (value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]