Bug 42463

Summary: [Qt] Avoid QImage::pixel() in getImageData()
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore Misc.Assignee: QtWebKit Unassigned <webkit-qt-unassigned>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Performance, Qt, QtTriaged
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed patch
none
Proposed patch v2 none

Description Andreas Kling 2010-07-16 09:36:18 PDT
From the QImage documentation:
Warning: This function is expensive when used for massive pixel manipulations.

We should use scanLine() (or even better in Qt 4.7, constScanLine()) instead.
Comment 1 Andreas Kling 2010-07-16 09:38:02 PDT
Created attachment 61817 [details]
Proposed patch
Comment 2 Andreas Kling 2010-07-16 09:38:53 PDT
This change yields a 1% speedup on http://mrdoob.com/lab/javascript/effects/plane_deformations/
Comment 3 Andreas Kling 2010-07-16 13:01:48 PDT
Created attachment 61840 [details]
Proposed patch v2

Oops, don't use QRgb* to traverse the scan lines, since QRgb might be 64-bit. Use quint32* instead.
Comment 4 Andreas Kling 2010-07-19 05:45:58 PDT
Comment on attachment 61840 [details]
Proposed patch v2

Clearing flags on attachment: 61840

Committed r63652: <http://trac.webkit.org/changeset/63652>
Comment 5 Andreas Kling 2010-07-19 05:46:08 PDT
All reviewed patches have been landed.  Closing bug.