Bug 91075 - [Qt] Increase the drawing performance by merging dirty rects.
Summary: [Qt] Increase the drawing performance by merging dirty rects.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 90375
  Show dependency treegraph
 
Reported: 2012-07-12 05:12 PDT by Dongseong Hwang
Modified: 2012-07-12 14:39 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.46 KB, patch)
2012-07-12 05:14 PDT, Dongseong Hwang
noam: review+
noam: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dongseong Hwang 2012-07-12 05:12:36 PDT
QWebFramePrivate calls FrameView::paintContents as many as the number of dirty
rects, so it causes too many redundant render tree traversals.
I changed it to merge dirty rects and call FrameView::paintContents only once.

The algorithm to merge rects is copied from GTK.
Comment 1 Dongseong Hwang 2012-07-12 05:14:35 PDT
Created attachment 151917 [details]
Patch
Comment 2 Dongseong Hwang 2012-07-12 05:15:53 PDT
Martin did on GTK port at Bug 70213.
Comment 3 Kwang Yul Seo 2012-07-12 05:22:51 PDT
When parallel image decoders are in use, each image is independently repainted when decoding is finished. This creates a lot by repaint requests. So by merging these repaint requests appropriately, we can improve rendering performance.
Comment 4 Dongseong Hwang 2012-07-12 05:25:07 PDT
(In reply to comment #3)
> When parallel image decoders are in use, each image is independently repainted when decoding is finished. This creates a lot by repaint requests. So by merging these repaint requests appropriately, we can improve rendering performance.

I tested parallel image decoders on http://www.dorothybrowser.com/test/webkitTest/imgdecode/Pinterest.html .
QWebFramePrivate called FrameView::paintContents 165 times after parallel image decoders decoded all the images. It took about 120ms.

This patch decreases painting time from 120ms to 30ms.
Comment 5 Zoltan Horvath 2012-07-12 08:32:09 PDT
Nice improvement! I'd also include the improvement numbers into the changelog, otherwise looks cool!
Comment 6 Noam Rosenthal 2012-07-12 09:08:43 PDT
Comment on attachment 151917 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=151917&action=review

Awesome!

> Source/WebKit/qt/Api/qwebframe.cpp:363
> +    const unsigned int cRectThreshold = 10;
> +    const float cWastedSpaceThreshold = 0.75f;

We can do without the c prefix.
Comment 7 Kwang Yul Seo 2012-07-12 14:37:44 PDT
Committed r122507: <http://trac.webkit.org/changeset/122507>
Comment 8 Kwang Yul Seo 2012-07-12 14:39:25 PDT
Thanks. I landed the patch after updating the ChangeLog and removing c prefix from constant names.