DescriptionAdd per-fragment early-out for getCharNumAtPosition
Since this is a spatial query, and a SVGTextFragment already contain an
approximation of it's own bounds, we can use those to perform a reasonably
efficient early-rejection test.
As an example: A TC using the textPath-data from issue 267504 [1] and a
mouse-move handler that uses getCharNumAtPosition to check which
"character" (glyph) is under the pointer consumes 0.005-0.2ms, compared to
0.2-0.5ms without this patch (before the CL in [2], this was 5-10ms!).
The TC mentioned in [2] now also weighs in at a few thousand us at worst.
[1] http://jsbin.com/imajow/1/quiet
[2] https://codereview.chromium.org/353003002
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177230
Patch Set 1 #
Total comments: 1
Messages
Total messages: 5 (0 generated)
|