[Webkit-unassigned] [Bug 89248] [cairo] simplify copyCairoImageSurface

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 21 10:52:01 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89248





--- Comment #3 from Martin Robinson <mrobinson at webkit.org>  2012-06-21 10:52:00 PST ---
(From update of attachment 147905)
View in context: https://bugs.webkit.org/attachment.cgi?id=147905&action=review

> Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp:185
> +    cairo_format_t format = cairo_image_surface_get_format(originalSurface);
> +    int stride = cairo_image_surface_get_stride(originalSurface);
> +    int width = cairo_image_surface_get_width(originalSurface);
> +    int height = cairo_image_surface_get_height(originalSurface);
> +    unsigned char* data = cairo_image_surface_get_data(originalSurface);
> +
> +    unsigned char* copiedData = static_cast<unsigned char*>(malloc(stride * height));
> +    if (!copiedData)
> +        return 0;
> +
> +    memcpy(copiedData, data, stride * height);
> +
> +    RefPtr<cairo_surface_t> newSurface = adoptRef(cairo_image_surface_create_for_data(copiedData, format, width, height, stride));

Does this change show a measurable performance improvement?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list