Re: CAIRO_FORMAT_ARGB32 Usage Problem
"Antonio Scuri" <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
Hi, Yes! Thank you! I added both: cairo_surface_flush - before cairo_image_surface_get_data cairo_surface_mark_dirty - after changing the data And the problem was solved. Thanks, Scuri > -----Original Message----- > From: Chris Wilson [mailto:[email protected]] > Sent: sexta-feira, 30 de setembro de 2011 15:43 > To: Antonio Scuri; [email protected] > Subject: Re: [cairo] CAIRO_FORMAT_ARGB32 Usage Problem > > On Fri, 30 Sep 2011 14:31:34 -0300, "Antonio Scuri" <[email protected] > 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 -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo