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

Alexandros Frantzis alexandros.frantzis at linaro.org
Tue Jan 11 11:05:39 PST 2011

On Fri, Jan 07, 2011 at 11:28:44AM -0800, Bill Spitzak wrote:
> You could also put a serialize number on the surface that is
> incremented when the size changes and test that. This reduces the
> number of tests and the storage needed by the cairo_t, and allows
> more things than the width and height to trigger this code without
> more expense.
> Alexandros Frantzis wrote:
> >On Fri, Jan 07, 2011 at 03:40:29PM +0000, Chris Wilson 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.


I have implemented this idea in the 'gl-window-surface-resize2' branch:



The only issue I see with this approach is the case the destination is
set, it is resized UINT_MAX + 1 times (without any other surface being
set as the destination in the meantime) and then set again. In this case
the update will not be detected because the serial will have remained
the same. Of course this is extremely unlikely to happen :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-gl-Ensure-that-gl-surface-resizes-are-properly-appli.patch
Type: text/x-diff
Size: 3047 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20110111/6b49e586/attachment.patch>

More information about the cairo mailing list