Bug 99332 - [WK2][CAIRO] Use cairo_format_stride_for_width() in ShareableBitmap
Summary: [WK2][CAIRO] Use cairo_format_stride_for_width() in ShareableBitmap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: http://cairographics.org/manual/cairo...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 08:36 PDT by Chris Dumez
Modified: 2012-10-15 14:00 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.24 KB, patch)
2012-10-15 08:45 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2012-10-15 08:36:09 PDT
Cairo implementation of ShareableBitmap calls cairo_image_surface_create_for_data(data, format, width, height, stride) to create an image surface for the provided pixel data.

The Cairo documentation states:
"Note that the stride may be larger than width*bytes_per_pixel to provide proper alignment for each pixel and row. This alignment is required to allow high-performance rendering within cairo. The correct way to obtain a legal stride value is to call cairo_format_stride_for_width() with the desired format and maximum image width value, and then use the resulting stride value to allocate the data and to create the image surface."

However, the current implementation always uses "m_size.width() * 4" for stride argument, instead of calling cairo_format_stride_for_width(). This may affect rendering performance in cairo.
Comment 1 Kenneth Rohde Christiansen 2012-10-15 08:38:03 PDT
Sounds sane to fix this
Comment 2 Chris Dumez 2012-10-15 08:45:00 PDT
Created attachment 168722 [details]
Patch
Comment 3 WebKit Review Bot 2012-10-15 14:00:50 PDT
Comment on attachment 168722 [details]
Patch

Clearing flags on attachment: 168722

Committed r131354: <http://trac.webkit.org/changeset/131354>
Comment 4 WebKit Review Bot 2012-10-15 14:00:55 PDT
All reviewed patches have been landed.  Closing bug.