DescriptionRefactor InspectorCSSAgent to avoid intermediate GlyphBuffers
InspectorCSSAgent::collectPlatformFontsForLayoutObject() builds a temporary
GlyphBuffer, and then iterates over all glyphs to collect SimpleFontData family
names.
A more efficient approach is to skip the GlyphBuffer and only iterate over the
ShapeResultBuffer runs (as all glyphs in a run share the same font data).
Add a helper method to CachingWordShaper and ShapeResultBuffer (runFontData)
to collect <runFontData, runGlyphCount> tuples, and refactor
collectPlatformFontsForLayoutObject() to use it instead.
Also refactor CachingWordShaper:
* instead of passing a Font arg to all methods, pass it to the ctor
* in practice we always use the Font's shape cache, so derive it internally
instead of explicit ctor arg (but keep the explicit shape cache ctor flavor
for tests)
* the fallbackFonts param is only ever used for width(), so we can drop it
from fillGlyphBuffer() and shapeResultsForRun()
BUG=574136
Review-Url: https://codereview.chromium.org/2718043003
Cr-Commit-Position: refs/heads/master@{#453581}
Committed: https://chromium.googlesource.com/chromium/src/+/7164a2cd55c9d685288fc548930608cd641a0b42
Patch Set 1 #Patch Set 2 : track glyph count/runs also #
Total comments: 2
Patch Set 3 : review #
Total comments: 11
Patch Set 4 : review #Patch Set 5 : cleanup #Messages
Total messages: 32 (24 generated)
|