[cairo] [PATCH] [cairo-gl] Fix support for gl window surface resizes

Andrea Canciani ranma42 at gmail.com
Wed Jan 12 01:05:32 PST 2011


On Fri, Jan 7, 2011 at 4:40 PM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> On Fri, 7 Jan 2011 16:31:43 +0200, Alexandros Frantzis
> <alexandros.frantzis at linaro.org> wrote:
>> From 94ced6d4c126fc8142dd32b2e761be8f9012ef52 Mon Sep 17 00:00:00 2001
>> From: Alexandros Frantzis <alexandros.frantzis at linaro.org>
>> Date: Fri, 7 Jan 2011 13:27:27 +0200
>> Subject: [PATCH 2/2] gl: Ensure that gl surface resizes are properly
>> applied
>>
>> If a gl surface is resized (with cairo_gl_surface_set_size()) while being
>> the
>> current target, the resize does not take effect until the target changes
>> to a
>> different surface and back to the original one. This patch adds tracking
>> of
>> pending resizes and ensures that a resize always take effect the next time
>> a resized surface is used as the target.
>> ---
>>  src/cairo-gl-device.c  |    4 +++-
>>  src/cairo-gl-private.h |    1 +
>>  src/cairo-gl-surface.c |    2 ++
>>  3 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
>> index 3793f9d..44b37d9 100644
>> --- a/src/cairo-gl-device.c
>> +++ b/src/cairo-gl-device.c
>> @@ -279,7 +279,7 @@ void
>>  _cairo_gl_context_set_destination (cairo_gl_context_t *ctx,
>>                                     cairo_gl_surface_t *surface)
>>  {
>> -    if (ctx->current_target == surface)
>> +    if (ctx->current_target == surface && ! surface->resize_pending)
>>          return;
>
> Hmm, don't you need to invalidate all contexts that have this surface as
> they current target?

'git grep' finds two occurrences of _cairo_gl_context_set_destination
and both of them are on surface->base.device. Is it really possible
to use a cairo-gl surface as destination in multiple contexts?

Andrea


More information about the cairo mailing list