Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Issue 1919123002: RenderTextMac: Cache the SkTypeface on the TextRun [reland] (Closed)

Created:
4 years, 8 months ago by tapted
Modified:
4 years, 8 months ago
CC:
chromium-reviews, derat+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

RenderTextMac: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -71 lines) Patch
M ui/gfx/render_text.h View 1 2 chunks +2 lines, -3 lines 0 comments Download
M ui/gfx/render_text.cc View 3 chunks +0 lines, -30 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/render_text_harfbuzz.cc View 1 2 chunks +14 lines, -3 lines 0 comments Download
M ui/gfx/render_text_mac.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/render_text_mac.mm View 1 3 chunks +9 lines, -10 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 chunks +96 lines, -24 lines 0 comments Download

Messages

Total messages: 9 (4 generated)
tapted
Hi Alexei, PTAL. This was reverted because of a subtle problem - the implementation of ...
4 years, 8 months ago (2016-04-26 11:46:20 UTC) #3
Alexei Svitkine (slow)
lgtm
4 years, 8 months ago (2016-04-26 14:45:59 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1919123002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1919123002/40001
4 years, 8 months ago (2016-04-26 22:31:49 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:40001)
4 years, 8 months ago (2016-04-26 22:38:21 UTC) #7
commit-bot: I haz the power
4 years, 8 months ago (2016-04-26 22:39:30 UTC) #9
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/59fe54df8c0de55f03c8fb5e1860279d2993b473
Cr-Commit-Position: refs/heads/master@{#389924}

Powered by Google App Engine
This is Rietveld 408576698