<div>I'm writting a cairo backend to use some hw acceleration. Basically I'm overloaded cairo_image_surface_t and cairo_image_source_t.</div><div>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.</div>
<div><br></div><div>In cairo-span-compositor.c:composite_aligned_boxes() :</div><div><br></div><div>if need_clip_mask is true it creates a mask using get_clip_surface() that returns a cairo_image_surface_t*</div><div>Then if no_mask is true it will call compositor->composite_boxes and gives a cairo_image_surface_t* mask as parameter instead of a cairo_image_source_t*</div>
<div><br></div><div><br></div><div><b>Conditions:</b></div><div><b>no_mask = 1</b></div><div><b>need_clip_mask = 1</b></div><div><br></div><div><div>if (need_clip_mask) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> <b> mask = get_clip_surface</b> (compositor, dst, extents->clip,</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> &extents->bounded);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> if (unlikely (mask->status))</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return mask->status;</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span> mask_x = -extents->bounded.x;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> mask_y = -extents->bounded.y;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div></div><div><br></div><div>if (! no_mask) {</div><div> </div><div>...</div><div>}</div><div><br></div><div><div>src = compositor->pattern_to_surface (dst, source, FALSE,</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> &extents->bounded,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> &extents->source_sample_area,</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> &src_x, &src_y);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if (likely (src->status == CAIRO_STATUS_SUCCESS)) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> status = <b>compositor->composite_boxes</b> (dst, op, src, <b>mask</b>,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> src_x, src_y,</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> mask_x, mask_y,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> 0, 0,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> boxes, &extents->bounded);</div>
</div><div><br></div><div><br></div><div>I welcome your thoughts,</div><div><br></div><div>Yannick</div>