[PATCH weston 1/2] compositor: Adds functions for backends to call around weston_surface_draw.
Kristian Høgsberg
hoegsberg at gmail.com
Mon Sep 10 18:10:57 PDT 2012
On Sat, Sep 08, 2012 at 12:42:31AM +0200, Zoxc wrote:
I've just committed the renderer abstraction branch that moves all
gles2 renderering to its own file and consolidates much of the repaint
logic. It should make what you're doing here a lot easier.
Kristian
> ---
> src/compositor-android.c | 4 ++++
> src/compositor-drm.c | 4 ++++
> src/compositor-wayland.c | 4 ++++
> src/compositor-x11.c | 4 ++++
> src/compositor.c | 10 ++++++++++
> src/compositor.h | 4 ++++
> 6 files changed, 30 insertions(+)
>
> diff --git a/src/compositor-android.c b/src/compositor-android.c
> index bfa2e95..ec05771 100644
> --- a/src/compositor-android.c
> +++ b/src/compositor-android.c
> @@ -159,9 +159,13 @@ android_output_repaint(struct weston_output *base, pixman_region32_t *damage,
> if (android_output_make_current(output) < 0)
> return;
>
> + weston_output_repaint_start(&output->base, damage);
> +
> wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
> weston_surface_draw(surface, &output->base, damage);
>
> + weston_output_repaint_finish(&output->base, damage);
> +
> if (!flip)
> return;
>
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index c6634a0..b01fcae 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -336,10 +336,14 @@ drm_output_render(struct drm_output *output, pixman_region32_t *damage, int flip
> return;
> }
>
> + weston_output_repaint_start(&output->base, damage);
> +
> wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
> if (surface->plane == &compositor->base.primary_plane)
> weston_surface_draw(surface, &output->base, damage);
>
> + weston_output_repaint_finish(&output->base, damage);
> +
> if (!flip)
> return;
>
> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index 1f45def..705a4e6 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -345,9 +345,13 @@ wayland_output_repaint(struct weston_output *output_base,
> return;
> }
>
> + weston_output_repaint_start(output_base, damage);
> +
> wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
> weston_surface_draw(surface, &output->base, damage);
>
> + weston_output_repaint_finish(output_base, damage);
> +
> if (!flip)
> return;
>
> diff --git a/src/compositor-x11.c b/src/compositor-x11.c
> index d5fa0c6..f95a827 100644
> --- a/src/compositor-x11.c
> +++ b/src/compositor-x11.c
> @@ -336,9 +336,13 @@ x11_output_repaint(struct weston_output *output_base,
> return;
> }
>
> + weston_output_repaint_start(output_base, damage);
> +
> wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
> weston_surface_draw(surface, &output->base, damage);
>
> + weston_output_repaint_finish(output_base, damage);
> +
> if (!flip)
> return;
>
> diff --git a/src/compositor.c b/src/compositor.c
> index 2b963f5..7013b4a 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -1327,6 +1327,16 @@ weston_shader_uniforms(struct weston_shader *shader,
> }
>
> WL_EXPORT void
> +weston_output_repaint_start(struct weston_output *output, pixman_region32_t *damage)
> +{
> +}
> +
> +WL_EXPORT void
> +weston_output_repaint_finish(struct weston_output *output, pixman_region32_t *damage)
> +{
> +}
> +
> +WL_EXPORT void
> weston_surface_draw(struct weston_surface *es, struct weston_output *output,
> pixman_region32_t *damage) /* in global coordinates */
> {
> diff --git a/src/compositor.h b/src/compositor.h
> index 38c2657..27505f4 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -548,6 +548,10 @@ weston_output_schedule_repaint(struct weston_output *output);
> void
> weston_output_damage(struct weston_output *output);
> void
> +weston_output_repaint_start(struct weston_output *output, pixman_region32_t *damage);
> +void
> +weston_output_repaint_finish(struct weston_output *output, pixman_region32_t *damage);
> +void
> weston_compositor_schedule_repaint(struct weston_compositor *compositor);
> void
> weston_compositor_fade(struct weston_compositor *compositor, float tint);
> --
> 1.7.12
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list