Bug 44402
Summary: | Path should be RefCounted | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | kbr, krit, oliver, zimmermann |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 | ||
Bug Depends on: | 44374, 44375 | ||
Bug Blocks: |
Eric Seidel (no email)
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Nikolas Zimmermann
(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