[PATCH weston 08/11] SHM: Don't flush damage when there is none
Kristian Høgsberg
hoegsberg at gmail.com
Thu Nov 8 08:27:58 PST 2012
On Wed, Nov 07, 2012 at 05:51:42PM +1100, Daniel Stone wrote:
> Every single frame, we were calling the flush_damage handler in the
> renderer. For GLES2 with subimage, this wasn't too bad as we'd never
> call glTexSubImage2D, but without it, we'd upload the entire frame
> through glTexImage2D every time.
Grabbed this one for 1.0 as well.
Kristian
> Signed-off-by: Daniel Stone <daniel at fooishbar.org>
> ---
> src/compositor.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/compositor.c b/src/compositor.c
> index 2d5b263..6b0c004 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -905,7 +905,8 @@ static void
> surface_accumulate_damage(struct weston_surface *surface,
> pixman_region32_t *opaque)
> {
> - if (surface->buffer && wl_buffer_is_shm(surface->buffer))
> + if (pixman_region32_not_empty(&surface->damage) &&
> + surface->buffer && wl_buffer_is_shm(surface->buffer))
> surface->compositor->renderer->flush_damage(surface);
>
> if (surface->transform.enabled) {
> --
> 1.7.10.4
>
> _______________________________________________
> 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