Change repaint_needed to bool
authorDaniel Stone <daniels@collabora.com>
Wed, 1 Mar 2017 11:34:06 +0000 (11:34 +0000)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 13 Mar 2017 12:20:06 +0000 (14:20 +0200)
It is only used as a binary value.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
libweston/compositor-drm.c
libweston/compositor-fbdev.c
libweston/compositor.c
libweston/compositor.h

index 3cb8f7e..72696d5 100644 (file)
@@ -2995,7 +2995,7 @@ session_notify(struct wl_listener *listener, void *data)
                 * pending frame callbacks. */
 
                wl_list_for_each(output, &compositor->output_list, base.link) {
                 * pending frame callbacks. */
 
                wl_list_for_each(output, &compositor->output_list, base.link) {
-                       output->base.repaint_needed = 0;
+                       output->base.repaint_needed = false;
                        drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0);
                }
 
                        drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0);
                }
 
index 44f0cf5..6f976d1 100644 (file)
@@ -693,7 +693,7 @@ session_notify(struct wl_listener *listener, void *data)
 
                wl_list_for_each(output,
                                 &compositor->output_list, link) {
 
                wl_list_for_each(output,
                                 &compositor->output_list, link) {
-                       output->repaint_needed = 0;
+                       output->repaint_needed = false;
                }
        }
 }
                }
        }
 }
index 4962618..80268bc 100644 (file)
@@ -2310,7 +2310,7 @@ weston_output_repaint(struct weston_output *output)
 
        pixman_region32_fini(&output_damage);
 
 
        pixman_region32_fini(&output_damage);
 
-       output->repaint_needed = 0;
+       output->repaint_needed = false;
 
        weston_compositor_repick(ec);
 
 
        weston_compositor_repick(ec);
 
@@ -2549,7 +2549,7 @@ weston_output_schedule_repaint(struct weston_output *output)
                TL_POINT("core_repaint_req", TLP_OUTPUT(output), TLP_END);
 
        loop = wl_display_get_event_loop(compositor->wl_display);
                TL_POINT("core_repaint_req", TLP_OUTPUT(output), TLP_END);
 
        loop = wl_display_get_event_loop(compositor->wl_display);
-       output->repaint_needed = 1;
+       output->repaint_needed = true;
        if (output->repaint_scheduled)
                return;
 
        if (output->repaint_scheduled)
                return;
 
index 08e728a..45dcb6d 100644 (file)
@@ -170,7 +170,10 @@ struct weston_output {
        pixman_region32_t region;
 
        pixman_region32_t previous_damage;
        pixman_region32_t region;
 
        pixman_region32_t previous_damage;
-       int repaint_needed;
+
+       /** True if damage has occurred since the last repaint for this output;
+        *  if set, a repaint will eventually occur. */
+       bool repaint_needed;
        int repaint_scheduled;
        struct wl_event_source *repaint_timer;
        struct weston_output_zoom zoom;
        int repaint_scheduled;
        struct wl_event_source *repaint_timer;
        struct weston_output_zoom zoom;