Chromium Code Reviews
DescriptionRenderTextMac: Cache the SkTypeface on the TextRun [reland]
SkiaTextRenderer::SetFontWithStyle() uses gfx::Font::Derive() which is
slow. SetFontWithStyle is only used on Mac but, also, there was actually
never anything to derive on Mac, since RenderTextMac does (on every
*paint*):
CTFontRef = <get font from CTRun>
gfx::Font = <wrap CTFontRef>
CFFontRef = <unwrap from gfx:Font> # cheap
style = <extract style from CTFontRef>
gfx::Font_2 = Derive(apply <style> to gfx::Font) # A "no-op", but expensive
So remove SkiaTextRenderer::SetFontWithStyle() since nothing needs it.
Then store the SkTypeface on the RenderTextMac TextRun. This saves a
lookup on each paint and is consistent with RenderTextHarfbuzz.
[reland: prior CL regressed RenderTextTest.Multiline_ZeroWidthChars]
BUG=605131, 605136
Committed: https://crrev.com/59fe54df8c0de55f03c8fb5e1860279d2993b473
Cr-Commit-Position: refs/heads/master@{#389924}
Patch Set 1 : baseline from crrev/1907833002 patchset 4 #Patch Set 2 : Fixes, and a test, but somewhat orthogonal #
Messages
Total messages: 9 (4 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||