[mutter/wip/carlosg/clip-regions: 4/6] clutter/cogl: Ensure we set dirty pixel if there's no region
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/clip-regions: 4/6] clutter/cogl: Ensure we set dirty pixel if there's no region
- Date: Tue, 30 Jul 2019 21:54:26 +0000 (UTC)
commit 23d7c0e1e5cbe712442df2f9e4c27b7d8ccb294f
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 30 23:46:51 2019 +0200
clutter/cogl: Ensure we set dirty pixel if there's no region
This may happen on startup, causing a crash.
clutter/clutter/cogl/clutter-stage-cogl.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c
index 9ad1bf8f3..3f9b4dd8d 100644
--- a/clutter/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/clutter/cogl/clutter-stage-cogl.c
@@ -1142,9 +1142,17 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
clutter_stage_view_get_layout (view, &view_layout);
fb_damage = view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - 1)];
- cairo_region_get_extents (fb_damage, &fb_damage_rect);
- *x = fb_damage_rect.x / fb_scale;
- *y = fb_damage_rect.y / fb_scale;
+ if (fb_damage)
+ {
+ cairo_region_get_extents (fb_damage, &fb_damage_rect);
+ *x = fb_damage_rect.x / fb_scale;
+ *y = fb_damage_rect.y / fb_scale;
+ }
+ else
+ {
+ *x = 0;
+ *y = 0;
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]