[cairo] [BUG] Win32 clip region handling is wrong in cairo 1.10

Rainman Lee rainman.lee at gmail.com
Sun Nov 7 18:21:37 PST 2010


the handling of win32 clip region is wrong in cairo 1.10, but it was
right in 1.8.
there is a snippet of my testing codes:

      HRGN w32_hRgn0 = CreateRectRgn(0, 0, 300, 300);
      HRGN w32_hRgn1 = CreateRectRgn(0, 0, 150, 300);
      CombineRgn(w32_hRgn0, w32_hRgn0, w32_hRgn1, RGN_DIFF);
      DeleteObject(w32_hRgn1);
      SelectClipRgn(hdc, w32_hRgn0);

      cairo_surface_t* tarSurface = cairo_win32_surface_create(hdc);
      cairo_t* tarContext = cairo_create(tarSurface);

      cairo_set_source_rgb(tarContext, 1, 0, 0);
      cairo_rectangle(tarContext, 0, 0, 300, 300);
      cairo_fill(tarContext);

the expected result should be a red rectangle at (150, 0, 300, 300),
but in fact, nothing was drawn.


More information about the cairo mailing list