RESOLVED FIXED 13320
rounded corners with drop shadows are really slow
https://bugs.webkit.org/show_bug.cgi?id=13320
Summary rounded corners with drop shadows are really slow
Jonathan del Strother
Reported 2007-04-10 09:27:58 PDT
-webkit-box-shadow and -webkit-border-radius are fine, on their own. When combined together, they kill redraw speeds. The page above informally demonstrates this - resizing the window is noticably slower when drop shadows & rounded corners are combined. If necessary, I could probably come up with some sort of animating benchmark thing...
Attachments
[WIP] use a single rounded rect path (14.45 KB, patch)
2007-05-19 06:53 PDT, mitz
no flags
Use a single rounded rect path (33.42 KB, patch)
2007-05-19 08:21 PDT, mitz
no flags
Use single rounded rect path (33.42 KB, patch)
2007-05-19 10:18 PDT, mitz
mrowe: review+
Antti Koivisto
Comment 1 2007-04-10 09:44:05 PDT
Yeah, it is pretty slow even with relatively small number of boxes. Shark shows that time is mostly spent doing fills in GraphicsContext:: fillRoundedRect() (called from RenderObject::paintBoxShadow()).
Dave Hyatt
Comment 2 2007-04-10 13:33:12 PDT
There is a bug filed in Radar about this already. Upgrading to P1 to reflect the internal bug's status. We'll need to change the clipping to stroke a single path instead of using the multiple ellipse approach.
Darin Adler
Comment 3 2007-04-11 01:03:34 PDT
<rdar://problem/4994191> The internal bug isn't marked P1.
mitz
Comment 4 2007-05-19 05:29:31 PDT
(In reply to comment #2) > We'll need to change the clipping to stroke a single path instead of using the > multiple ellipse approach. I'm trying to do this now.
mitz
Comment 5 2007-05-19 06:53:48 PDT
Created attachment 14625 [details] [WIP] use a single rounded rect path Probably breaks non-Mac platforms. Fixes an existing box-shadow+border-radius bug when the radii cannot be satisfied (the box reverts to having straight corners, but the shadow goes all crazy). Didn't touch addInnerRoundedRectClip(), although it would be nice to get rid of it.
mitz
Comment 6 2007-05-19 08:21:12 PDT
Created attachment 14626 [details] Use a single rounded rect path
Darin Adler
Comment 7 2007-05-19 09:58:38 PDT
Comment on attachment 14626 [details] Use a single rounded rect path In Path::createRoundedRectangle I would expect you to use float insted of double. FloatRect, etc. are actually "float" not double, and converting back and forth can be costly. Otherwise looks great. r=me
mitz
Comment 8 2007-05-19 10:14:11 PDT
Comment on attachment 14626 [details] Use a single rounded rect path (In reply to comment #7) > (From update of attachment 14626 [details] [edit]) > In Path::createRoundedRectangle I would expect you to use float insted of > double. Copy&paste accident. I'm going to correct it.
mitz
Comment 9 2007-05-19 10:18:47 PDT
Created attachment 14628 [details] Use single rounded rect path s/double/float/
Mark Rowe (bdash)
Comment 10 2007-05-19 16:17:48 PDT
Landed in r21601.
Note You need to log in before you can comment on or make changes to this bug.