[cairo] CAIRO_FORMAT_ARGB32 Usage Problem
Chris Wilson
chris at chris-wilson.co.uk
Fri Sep 30 11:42:41 PDT 2011
On Fri, 30 Sep 2011 14:31:34 -0300, "Antonio Scuri" <scuri at tecgraf.puc-rio.br> wrote:
> Hi,
>
> I'm successfully using Cairo in X-Windows, GDK and Win32 with the
> functions:
>
> cairo_xlib_surface_create
> gdk_cairo_create
> cairo_win32_surface_create
>
> To draw an image I use:
>
> cairo_image_surface_create
cairo_surface_flush // redundant in this case, but stated for pedagology
> cairo_image_surface_get_data
cairo_surface_mark_dirty
> cairo_set_source_surface
> cairo_paint
>
> Everything works fine. But I have 24bpp and 32bpp images, so I use
> CAIRO_FORMAT_RGB24 and CAIRO_FORMAT_ARGB32 accordingly.
>
> In Cairo 1.8 both flags were working fine, but in Cairo 1.10 the flag
> CAIRO_FORMAT_ARGB32 causes "cairo_paint" to draw nothing. This behavior
> occurs is all the systems mentioned above. Other primitives work fine.
It sounds like the problem is that you modified the data without informing
Cairo, so it continues to assume that it had the same value as before
(which is all-clear). The secret is that cairo does and always has
expected you to mark any part of the surface that you externally modify
(that is manipulate directly and not through the cairo surface) as dirty.
-chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo
mailing list