Bug 44402 - Path should be RefCounted
Summary: Path should be RefCounted
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 44374 44375
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-22 18:39 PDT by Eric Seidel (no email)
Modified: 2010-08-23 05:50 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2010-08-22 18:39:01 PDT
Path should be RefCounted

I've been investigating why http://themaninblue.com/experiment/AnimationBenchmark/svg/ is so slow in WebKit.  We spend at least 8% of our time generating or copying paths (see bug 44374 and bug 44375).

Because we generate a new path (and copy it!) every time one of those circles changes, WebCore makes it impossible for the platform layer to cache any information off of the platform path object (for example a triangle mesh on the gpu).  I believe the best solution around this is to make Path RefCounted, and start making our current code careful to not copy (and possibly share) paths when possible.

Having a RefCounted Path object would also allow us to use unit-shapes for all of the basic SVG shapes and share path objects between shapes, hopefully resulting in faster platform drawing.

I'm very interested in commentary from those of you who know more about graphics than I do. :)  But it seems to me that sharing paths could make platform drawing faster. (I would suspect for example that CG would be faster at drawing the same circle 100 times, than 100 different CGPath objects all representing the same circle shape.
Comment 1 Nikolas Zimmermann 2010-08-23 05:50:10 PDT
(In reply to comment #0)
> Path should be RefCounted

Hi Eric,

I've discussed this with Dirk some weeks ago and I think this is the way to go. This would also avoid having to pass Path references to toPathData() in the SVG code.

I'd like to hear Olivers opinion as well.

Cheers,
Niko