[cairo] Dangerous cast between cairo_image_surface_t and cairo_image_source_t

Chris Wilson chris at chris-wilson.co.uk
Tue Apr 16 06:54:04 PDT 2013


On Tue, Apr 16, 2013 at 03:28:40PM +0200, Yannick Poirier wrote:
> I'm writting a cairo backend to use some hw acceleration. Basically I'm
> overloaded cairo_image_surface_t and cairo_image_source_t.
> I'm facing a crash in one of my functions and this is because of a cast
> from cairo_image_surface_t to cairo_image_source_t.

The layout of cairo_image_surface_t and cairo_image_source_t should be
identical for the common components so that we can indeed pass down
cairo_image_surface_t into that function and treat it as a
cairo_image_source_t i.e. the offset of pixman_image_t is identical in
both structures.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list