Chromium Code Reviews
DescriptionRenderTextMac: Cache the SkTypeface on the TextRun
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.
BUG=605131, 605136
Committed: https://crrev.com/758d2baa307aa32b9de708e97655663726b8fa9c
Cr-Commit-Position: refs/heads/master@{#389042}
Patch Set 1 #Patch Set 2 : neater #Patch Set 3 : Rebase to pull in new presubmit in r388275 for sk_sp BYPASS_HOOKS #Patch Set 4 : skia::RefPtr<>(Adopt(..)) -> sk_sp<>(..) #
Messages
Total messages: 23 (13 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||