Bug 42463 - [Qt] Avoid QImage::pixel() in getImageData()
Summary: [Qt] Avoid QImage::pixel() in getImageData()
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: QtWebKit Unassigned
Keywords: Performance, Qt, QtTriaged
Depends on:
Reported: 2010-07-16 09:36 PDT by Andreas Kling
Modified: 2010-07-19 05:46 PDT (History)
0 users

See Also:

Proposed patch (1.56 KB, patch)
2010-07-16 09:38 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Proposed patch v2 (1.54 KB, patch)
2010-07-16 13:01 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.