diff options
| author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-05-20 18:28:08 -0400 | 
|---|---|---|
| committer | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-05-23 15:43:18 -0400 | 
| commit | 17f5414b1ab198481f82d23e6903b48768785117 (patch) | |
| tree | b4deeba76f2ba456108249bf38f5b31c2d895f13 | |
| parent | 4ac19e9f9cf38bc146ba42cc7ce89b29e748b30f (diff) | |
| download | wlroots-17f5414b1ab198481f82d23e6903b48768785117.tar.xz | |
wlr_scene: Parse out WLR_SCENE_DEBUG_DAMAGE
| -rw-r--r-- | docs/env_vars.md | 6 | ||||
| -rw-r--r-- | include/wlr/types/wlr_scene.h | 8 | ||||
| -rw-r--r-- | types/scene/wlr_scene.c | 17 | 
3 files changed, 31 insertions, 0 deletions
| diff --git a/docs/env_vars.md b/docs/env_vars.md index 609ca97b..22626c6b 100644 --- a/docs/env_vars.md +++ b/docs/env_vars.md @@ -45,6 +45,12 @@ wlroots reads these environment variables  * *WLR_RENDERER_ALLOW_SOFTWARE*: allows the gles2 renderer to use software    rendering +## scenes + +* *WLR_SCENE_DEBUG_DAMAGE*: specifies debug options for screen damage related +tasks for compositors that use scenes. (available options: NONE, RERENDER, +HIGHLIGHT) +  # Generic  * *DISPLAY*: if set probe X11 backend in `wlr_backend_autocreate` diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index f3302574..2625dd80 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -71,6 +71,12 @@ struct wlr_scene_node {  	struct wlr_addon_set addons;  }; +enum wlr_scene_debug_damage_option { +	WLR_SCENE_DEBUG_DAMAGE_NONE, +	WLR_SCENE_DEBUG_DAMAGE_RERENDER, +	WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT +}; +  /** The root scene-graph node. */  struct wlr_scene {  	struct wlr_scene_node node; @@ -83,6 +89,8 @@ struct wlr_scene {  	// private state  	struct wl_listener presentation_destroy; + +	enum wlr_scene_debug_damage_option debug_damage_option;  };  /** A sub-tree in the scene-graph. */ diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 303325fd..4241a57c 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -130,6 +130,23 @@ struct wlr_scene *wlr_scene_create(void) {  	scene_node_init(&scene->node, WLR_SCENE_NODE_ROOT, NULL);  	wl_list_init(&scene->outputs);  	wl_list_init(&scene->presentation_destroy.link); + +	char *debug_damage = getenv("WLR_SCENE_DEBUG_DAMAGE"); +	if (debug_damage) { +		wlr_log(WLR_INFO, "Loading WLR_SCENE_DEBUG_DAMAGE option: %s", debug_damage); +	} + +	if (!debug_damage || strcmp(debug_damage, "none") == 0) { +		scene->debug_damage_option = WLR_SCENE_DEBUG_DAMAGE_NONE; +	} else if (strcmp(debug_damage, "rerender") == 0) { +		scene->debug_damage_option = WLR_SCENE_DEBUG_DAMAGE_RERENDER; +	} else if (strcmp(debug_damage, "highlight") == 0) { +		scene->debug_damage_option = WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT; +	} else { +		wlr_log(WLR_ERROR, "Unknown WLR_SCENE_DEBUG_DAMAGE option: %s", debug_damage); +		scene->debug_damage_option = WLR_SCENE_DEBUG_DAMAGE_NONE; +	} +  	return scene;  } | 
