[cairo] [1.10.0] Win32 redrawing issues (regression?)
Cxx Joe
cxxjoe at googlemail.com
Fri Sep 10 13:17:01 PDT 2010
Hey,
it's probably a mistake on my side, but I have been investigating it
for some hours to no real avail now.
This is what's going on:
I'm using cairo_win32_surface_create in WM_PAINT (together with
BeginPaint and EndPaint) to copy what I previously rendered to a
memory image buffer to the screen device context. This includes scroll
bar functionality.
You can have a look at the code here:
http://code.google.com/p/infekt/source/browse/trunk/src/win32/nfo_view_ctrl.cpp#262
Now the problem only exists with cairo 1.10.0, 1.8.x has always been
working fine. This is the issue:
Whenever the invalidated rect in l_ps.rcPaint (which is equal to the
rects in cairo_win32_surface_t->extents and
cairo_win32_surface_t->clip_rect) has a top or left value different
from zero, calling cairo_fill (or cairo_paint for that matter) yields
no visible result at all. This is mostly visible when scrolling:
Scrolling up works just fine because the invalidated rects start at
(0,0). Scrolling down however invalidates rects at the bottom of the
control, like (0,550)(800,620) and cairo is not painting anything to
l_realSurface (the win32_surface) at all. This makes Windows move the
contents above the rect to the top and keep the old content (that
really was supposed to be painted over) at the bottom. Example:
http://img820.imageshack.us/img820/743/fhtgfyhx.jpg
Interestingly enough, it doesn't matter whether I'm copying the entire
image to l_buffer (code above) or just rcPaint (code linked below).
Some things I have been testing to no avail:
http://dpaste.de/mjO3/
* Verified that drawing rectangles with GDI instead of Cairo works
* Verified that the l_buffer memory buffer contains the correct image
* Drawing a simple colored rect (cairo_rectangle) instead of copying
from a buffer doesn't work either
Can anyone think of ANYTHING that could be going on here? I looked at
diffs from 1.8.10 to 1.10.0, I used the debugger to step through both
versions in parallel... but I haven't been able to get to the bottom
of this so far.
Thanks in advance
Joe
More information about the cairo
mailing list