Bug 107547 - [Qt] Box shadows on a transparency layer is very slow
Summary: [Qt] Box shadows on a transparency layer is very slow
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Allan Sandfeld Jensen
Depends on: 107549
Blocks: QtWebkit23 103747
  Show dependency treegraph
Reported: 2013-01-22 03:59 PST by Allan Sandfeld Jensen
Modified: 2013-01-31 06:09 PST (History)
3 users (show)

See Also:

Patch (1.51 KB, patch)
2013-01-22 04:01 PST, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff
Patch (1.71 KB, patch)
2013-01-22 05:54 PST, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Sandfeld Jensen 2013-01-22 03:59:12 PST
If box shadows are applied on top of a transparency layer, the result is very slow painting. An example is the page http://paste.chakra-project.org/3755/.

The issue is that the ShadowBlur layer ends up being the entire size of box element, instead of just the size of the transparency layer. This happens because the clipping set on QPainter is much larger than the area QPainter is painting to. One way to avoid it, is to set an initial clipping to the area QPainter is painting to, so that later clipping (set by intersection), can not end up larger than the layer.
Comment 1 Allan Sandfeld Jensen 2013-01-22 04:01:36 PST
Created attachment 183958 [details]
Comment 2 David Rosca 2013-01-22 04:23:56 PST
I can confirm that the patch helps the issue. Unfortunately, it's not ideal.
Rendering the page provided changed from unusably slow to slow on my machine (i5).
Comment 3 Allan Sandfeld Jensen 2013-01-22 04:40:18 PST
Committed r140412: <http://trac.webkit.org/changeset/140412>
Comment 4 Allan Sandfeld Jensen 2013-01-22 05:54:49 PST
Created attachment 183976 [details]

Do not change clips used by QPainter, instead ensure clipBounds return a clip intersected with the window bounds
Comment 5 WebKit Review Bot 2013-01-31 06:09:33 PST
Comment on attachment 183976 [details]

Clearing flags on attachment: 183976

Committed r141413: <http://trac.webkit.org/changeset/141413>
Comment 6 WebKit Review Bot 2013-01-31 06:09:37 PST
All reviewed patches have been landed.  Closing bug.