Closed Bug 758984 Opened 12 years ago Closed 12 years ago

Cache nsSMILKeySplines in a central manager.

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dzbarsky, Assigned: dzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
I need this for async css animations, so that the compositor thread can calculate spline values when it only has the Bezier coefficients.
Attachment #627588 - Flags: review?(dholbert)
If we need to, we could also special case the built in timing functions to avoid any hashing or synchronization on them.
What is the point of caching these in a hash table?

Why not just copy all the data around to where you need it?
Even if we had the data, we would need to reimplement the code in nsSMILKeySpline.cpp that uses the samples to actually calculate the spline value.
I think we should move nsSMILKeySpline to gfx/thebes, rename it a bit, and use it from there in both layers and layout.
Comment on attachment 627588 [details] [diff] [review]
Patch

I'm going to do this without using nsIHashKey.
Attachment #627588 - Attachment is obsolete: true
Attachment #627588 - Flags: review?(dholbert)
Attached patch PatchSplinter Review
Attachment #627820 - Flags: review?(dholbert)
Can you explain why we should use a cache here? I don't understand why at all.
cjones had concerns about serializing nsSMILKeySplines across threads.  Maybe he can explain.
I was under the impression that these pre-calculated tables stored a lot of data, but dz tells me they're 11 floats.  If they're very expensive to calculate we might win a bit from caching, but we can measure later.

My suggestion was
 - don't try to serialize the layout/style objects, but rather define the animation API in PLayers.ipdl as a conceptually separate interface, a "lowered" representation of what layout/ uses.
 - in the *implementation* of the compositor-driven animations, re-use as much of the layout/ code as possible

Sharing this code seems to make sense.  If we need to move/rename to make sharing more convenient, fine.
We don't need to serialize mSampleValues. We can just recompute it on the other side as needed. In fact it probably makes sense to make CalcSampleValues() lazy.
Ok, we don't need this.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
Attachment #627820 - Flags: review?(dholbert)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: