[cairo] win32: Bug in partial redrawing triggered by InvalidateRect
matthias.bolte at googlemail.com
Wed Jul 27 02:54:46 PDT 2011
2011/7/26 Andrea Canciani <ranma42 at gmail.com>:
> On Mon, Jul 25, 2011 at 1:14 PM, Matthias Bolte
> <matthias.bolte at googlemail.com> wrote:
>> I came across this problem while updating from cairo 1.8 to 1.10.
>> In 1.8 Triggering partial redraws via InvalidateRect works as
>> expected. In 1.10 it doesn't. The size of the rect is correct but the
>> offset is lost and the top-left corner of the window is redrawn with
>> the wrong content as the content comes from the correct offset.
>> I tracked the problem down to this commit
>> surface-fallback: Convert to composite rectangles
>> But I could not understand why this commit breaks partial redraws.
>> Today I found a mail on the mailing list about this problem
>> that refers to a bug report from 2010 about this problem
>> that has a working patch attached
>> The offending commit seems to have broken the handling of surfaces
>> that don't have their origin in (0,0) as it switched to the
>> _cairo_composite_rectangles_init* functions that assume that the
>> surface has it's origin in (0,0).
>> The problem seems to be that a BeginPaint call (as a reaction to a
>> WM_PAINT message triggered by a InvalidateRect) can return a DC with
>> an origin equal to the offset given in the InvalidateRect. So there is
>> a DC with an origin different from (0,0).
>> The referenced patch makes _cairo_composite_rectangles_init* honor
>> this offset and fixes the problem.
>> Now I wonder why this patch from October 2010 has neither been
>> reviewed nor been applied yet. This mail is an attempt to finally get
>> this problem fixed.
> I just updated the bug with some information.
> I thought that a discussion about this patch happened on
> the mailing lists, but right now I'm unable to find it
> (Probably it was actually on IRC)
> Sorry for not having updated the bugreport with the nack-review immediately
Thanks for updating the bugreport and thanks to Chris Wilson for
fixing the problem with commit
composite: Pass unbounded extents to initialisation
More information about the cairo