Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
static inline cairo_surface_t* copySurface(cairo_surface_t* surface)
{
    cairo_format_t format = cairo_image_surface_get_format(surface);
    int width = cairo_image_surface_get_width(surface);
    int height = cairo_image_surface_get_height(surface);
    cairo_surface_t* newsurface = cairo_image_surface_create(format, width, height);

    cairo_t* cr = cairo_create(newsurface);
    cairo_set_source_surface(cr, surface, 0, 0);
    cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
    cairo_paint(cr);
    cairo_destroy(cr);

    return newsurface;
}
// Cairo doesn't provide a way to copy a cairo_surface_t.
// See http://lists.cairographics.org/archives/cairo/2007-June/010877.html
// Once cairo provides the way, use the function instead of this.
Cairo doesn't provide a way to copy a cairo_surface_t.
Cairo doesn ' t provide a way to copy a cairo_surface_t .
static inline cairo_surface_t* copySurface(cairo_surface_t* surface)
{
    cairo_format_t format = cairo_image_surface_get_format(surface);
    int width = cairo_image_surface_get_width(surface);
    int height = cairo_image_surface_get_height(surface);
    cairo_surface_t* newsurface = cairo_image_surface_create(format, width, height);
    cairo_t* cr = cairo_create(newsurface);
    cairo_set_source_surface(cr, surface, 0, 0);
    cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
    cairo_paint(cr);
    cairo_destroy(cr);
    return newsurface;
}
static inline cairo_surface_t * copySurface ( cairo_surface_t * surface ) { cairo_format_t format = cairo_image_surface_get_format ( surface ) ; int width = cairo_image_surface_get_width ( surface ) ; int height = cairo_image_surface_get_height ( surface ) ; cairo_surface_t * newsurface = cairo_image_surface_create ( format , width , height ) ; cairo_t * cr = cairo_create ( newsurface ) ; cairo_set_source_surface ( cr , surface , 0 , 0 ) ; cairo_set_operator ( cr , CAIRO_OPERATOR_SOURCE ) ; cairo_paint ( cr ) ; cairo_destroy ( cr ) ; return newsurface ; }
Cairo doesn't provide a way to copy a cairo_surface_t.
Cairo doesn ' t provide a way to copy a cairo_surface_t .