/* This function makes @surface release the reference to its device. The function is intended to be used for avoiding cycling references for surfaces that are owned by their device, for example cache surfaces. Note that the @surface will still assume that the device is available. So it is the caller's responsibility to ensure the device stays around until the @surface is destroyed. Just calling cairo_surface_finish() is not enough.  */
void _cairo_surface_release_device_reference(cairo_surface_t *surface)
/* This function makes @surface release the reference to its device. The function is intended to be used for avoiding cycling references for surfaces that are owned by their device, for example cache surfaces. Note that the @surface will still assume that the device is available. So it is the caller's responsibility to ensure the device stays around until the @surface is destroyed. Just calling cairo_surface_finish() is not enough.  */
void _cairo_surface_release_device_reference(cairo_surface_t *surface)
{
    assert (surface->owns_device);
    cairo_device_destroy (surface->device);
    surface->owns_device = FALSE;
}