[weston] compositor: make keep_buffer a bool

Submitted by Derek Foreman on Oct. 10, 2014, 2:36 p.m.

Details

Message ID 1412951805-26749-1-git-send-email-derekf@osg.samsung.com
State Accepted
Headers show

Not browsing as part of any series.

Commit Message

Derek Foreman Oct. 10, 2014, 2:36 p.m.
The comments already call it bool, so let's just make it one
---
 src/compositor-drm.c | 4 ++--
 src/compositor.h     | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 07b83a7..bee41ef 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1106,9 +1106,9 @@  drm_assign_planes(struct weston_output *output)
 		    (es->buffer_ref.buffer &&
 		    (!wl_shm_buffer_get(es->buffer_ref.buffer->resource) ||
 		     (ev->surface->width <= 64 && ev->surface->height <= 64))))
-			es->keep_buffer = 1;
+			es->keep_buffer = true;
 		else
-			es->keep_buffer = 0;
+			es->keep_buffer = false;
 
 		pixman_region32_init(&surface_overlap);
 		pixman_region32_intersect(&surface_overlap, &overlap,
diff --git a/src/compositor.h b/src/compositor.h
index 0fbca33..a11a91d 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -28,6 +28,7 @@ 
 extern "C" {
 #endif
 
+#include <stdbool.h>
 #include <time.h>
 #include <pixman.h>
 #include <xkbcommon/xkbcommon.h>
@@ -885,7 +886,7 @@  struct weston_surface {
 	struct weston_buffer_viewport buffer_viewport;
 	int32_t width_from_buffer; /* before applying viewport */
 	int32_t height_from_buffer;
-	int keep_buffer; /* bool for backends to prevent early release */
+	bool keep_buffer; /* for backends to prevent early release */
 
 	/* wl_viewport resource for this surface */
 	struct wl_resource *viewport_resource;

Comments

On Fri, Oct 10, 2014 at 09:36:45AM -0500, Derek Foreman wrote:
> The comments already call it bool, so let's just make it one

LGTM

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
> ---
>  src/compositor-drm.c | 4 ++--
>  src/compositor.h     | 3 ++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index 07b83a7..bee41ef 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -1106,9 +1106,9 @@ drm_assign_planes(struct weston_output *output)
>  		    (es->buffer_ref.buffer &&
>  		    (!wl_shm_buffer_get(es->buffer_ref.buffer->resource) ||
>  		     (ev->surface->width <= 64 && ev->surface->height <= 64))))
> -			es->keep_buffer = 1;
> +			es->keep_buffer = true;
>  		else
> -			es->keep_buffer = 0;
> +			es->keep_buffer = false;
>  
>  		pixman_region32_init(&surface_overlap);
>  		pixman_region32_intersect(&surface_overlap, &overlap,
> diff --git a/src/compositor.h b/src/compositor.h
> index 0fbca33..a11a91d 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -28,6 +28,7 @@
>  extern "C" {
>  #endif
>  
> +#include <stdbool.h>
>  #include <time.h>
>  #include <pixman.h>
>  #include <xkbcommon/xkbcommon.h>
> @@ -885,7 +886,7 @@ struct weston_surface {
>  	struct weston_buffer_viewport buffer_viewport;
>  	int32_t width_from_buffer; /* before applying viewport */
>  	int32_t height_from_buffer;
> -	int keep_buffer; /* bool for backends to prevent early release */
> +	bool keep_buffer; /* for backends to prevent early release */
>  
>  	/* wl_viewport resource for this surface */
>  	struct wl_resource *viewport_resource;
> -- 
> 2.1.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
On Mon, 13 Oct 2014 11:21:06 -0700
Bryce Harrington <bryce@osg.samsung.com> wrote:

> On Fri, Oct 10, 2014 at 09:36:45AM -0500, Derek Foreman wrote:
> > The comments already call it bool, so let's just make it one
> 
> LGTM
> 
> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
> > ---
> >  src/compositor-drm.c | 4 ++--
> >  src/compositor.h     | 3 ++-
> >  2 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> > index 07b83a7..bee41ef 100644
> > --- a/src/compositor-drm.c
> > +++ b/src/compositor-drm.c
> > @@ -1106,9 +1106,9 @@ drm_assign_planes(struct weston_output *output)
> >  		    (es->buffer_ref.buffer &&
> >  		    (!wl_shm_buffer_get(es->buffer_ref.buffer->resource) ||
> >  		     (ev->surface->width <= 64 && ev->surface->height <= 64))))
> > -			es->keep_buffer = 1;
> > +			es->keep_buffer = true;
> >  		else
> > -			es->keep_buffer = 0;
> > +			es->keep_buffer = false;
> >  
> >  		pixman_region32_init(&surface_overlap);
> >  		pixman_region32_intersect(&surface_overlap, &overlap,
> > diff --git a/src/compositor.h b/src/compositor.h
> > index 0fbca33..a11a91d 100644
> > --- a/src/compositor.h
> > +++ b/src/compositor.h
> > @@ -28,6 +28,7 @@
> >  extern "C" {
> >  #endif
> >  
> > +#include <stdbool.h>
> >  #include <time.h>
> >  #include <pixman.h>
> >  #include <xkbcommon/xkbcommon.h>
> > @@ -885,7 +886,7 @@ struct weston_surface {
> >  	struct weston_buffer_viewport buffer_viewport;
> >  	int32_t width_from_buffer; /* before applying viewport */
> >  	int32_t height_from_buffer;
> > -	int keep_buffer; /* bool for backends to prevent early release */
> > +	bool keep_buffer; /* for backends to prevent early release */
> >  
> >  	/* wl_viewport resource for this surface */
> >  	struct wl_resource *viewport_resource;

Pushed.

Thanks,
pq