[cairo] Problems with InvalidateRect under Windows
tim at framstag.com
Sun Jun 6 02:54:43 PDT 2010
I now started using cairo not only under X11 but also under Windows. My code is designed that way, that I only draw within the WM_PAINT event, creating a cairo surface using the HDC returned by BeginPaint (AFAIK this is the recommended way). For getting parts of the windows repainted because of changes (in reaction to user input) I call InvalidateRect (I also tried RedrawWindow with same results) with the RECT to get redrawn to trigger WM_PAINT message for the given region (AFAIK this is also the recommended way).
This works fine for WM_PAINT messages created by the system (initial WM_PAINT on window open, WM_PAINT messages on window resize) but it fails for WM_PAINT messages created by InvalidateRect - if a valid RECT* is handed over. While the content of WM_PAINT is correct and cairo_clip_extents() on the temporary surface shows reasonable values in all cases (while having the coordinate origin obviously in lower left, instead upper left) , nothing gets drawn at all. As soon as I pass NULL as RECT*, redraw works like a charm. However doing full screen refresh on every redraw is obviously not a long term solution ;-) I assume that cases where the cliping reagion on the HDC is not the full window are differently (and possibly wrongly?) handled or I'm doing something wrong (e.g. are there any coordinate system transformations necessary on the Windows or cairo side I'm missing?).
I'm using cairo-1.9.6 together with pixmap-0.18.2
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo