[mutter] clutter/stage-view: Move framebuffer sanity check into helper
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/stage-view: Move framebuffer sanity check into helper
- Date: Thu, 2 Jul 2020 20:52:08 +0000 (UTC)
commit 1e284c601c7c7be4248faebf5c7f7c7af0b24554
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Apr 9 10:49:07 2020 +0200
clutter/stage-view: Move framebuffer sanity check into helper
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
clutter/clutter/clutter-stage-view.c | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index eb5d52fdb7..eb6bddd67d 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -991,6 +991,22 @@ clutter_stage_view_take_scanout (ClutterStageView *view)
return g_steal_pointer (&priv->next_scanout);
}
+static void
+sanity_check_framebuffer (ClutterStageView *view)
+{
+ ClutterStageViewPrivate *priv =
+ clutter_stage_view_get_instance_private (view);
+ G_GNUC_UNUSED 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);
+}
+
static void
clutter_stage_view_set_framebuffer (ClutterStageView *view,
CoglFramebuffer *framebuffer)
@@ -1000,20 +1016,8 @@ clutter_stage_view_set_framebuffer (ClutterStageView *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
+ sanity_check_framebuffer (view);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]