diff options
| author | Simon Ser <contact@emersion.fr> | 2023-12-12 11:12:07 +0100 | 
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2023-12-25 11:43:41 +0100 | 
| commit | 66b6c349e7be0d9e459459a88cf12a290bc14b3c (patch) | |
| tree | 297887bd57b084a925b12271c6c4225581e1abde | |
| parent | cd157a0bd96acf9bf444cd46ca67c4257821de9b (diff) | |
| download | wlroots-66b6c349e7be0d9e459459a88cf12a290bc14b3c.tar.xz | |
compositor: remove unnecessary wlr_surface.has_buffer
No need to store this bit, we can infer it from buffer_width and
buffer_height.
| -rw-r--r-- | include/wlr/types/wlr_compositor.h | 1 | ||||
| -rw-r--r-- | types/wlr_compositor.c | 6 | 
2 files changed, 2 insertions, 5 deletions
| diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h index cb9f9292..a4de7928 100644 --- a/include/wlr/types/wlr_compositor.h +++ b/include/wlr/types/wlr_compositor.h @@ -218,7 +218,6 @@ struct wlr_surface {  	bool unmap_commit;  	bool opaque; -	bool has_buffer;  	int32_t preferred_buffer_scale;  	bool preferred_buffer_transform_sent; diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c index 9269e100..bbae8129 100644 --- a/types/wlr_compositor.c +++ b/types/wlr_compositor.c @@ -341,8 +341,6 @@ static void surface_state_move(struct wlr_surface_state *state,  }  static void surface_apply_damage(struct wlr_surface *surface) { -	surface->has_buffer = surface->current.buffer; -  	if (surface->current.buffer == NULL) {  		// NULL commit  		if (surface->buffer != NULL) { @@ -383,7 +381,7 @@ static void surface_apply_damage(struct wlr_surface *surface) {  }  static void surface_update_opaque_region(struct wlr_surface *surface) { -	if (!surface->has_buffer) { +	if (!wlr_surface_has_buffer(surface)) {  		pixman_region32_clear(&surface->opaque_region);  		return;  	} @@ -722,7 +720,7 @@ struct wlr_texture *wlr_surface_get_texture(struct wlr_surface *surface) {  }  bool wlr_surface_has_buffer(struct wlr_surface *surface) { -	return surface->has_buffer; +	return surface->current.buffer_width > 0 && surface->current.buffer_height > 0;  }  void wlr_surface_map(struct wlr_surface *surface) { | 
