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

Issue 1907833002: RenderTextMac: Cache the SkTypeface on the TextRun (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 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<>(..) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -57 lines) Patch
M ui/gfx/render_text.h View 2 chunks +0 lines, -5 lines 0 comments Download
M ui/gfx/render_text.cc View 1 3 chunks +0 lines, -30 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/render_text_harfbuzz.cc View 1 2 3 2 chunks +9 lines, -2 lines 0 comments Download
M ui/gfx/render_text_mac.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/render_text_mac.mm View 1 2 3 3 chunks +4 lines, -19 lines 0 comments Download

Messages

Total messages: 23 (13 generated)
tapted
Hi Alexei, please take a look
4 years, 8 months ago (2016-04-21 12:07:14 UTC) #8
Alexei Svitkine (slow)
lgtm
4 years, 8 months ago (2016-04-21 14:48:30 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907833002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907833002/40001
4 years, 8 months ago (2016-04-21 23:25:41 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/171730)
4 years, 8 months ago (2016-04-21 23:35:09 UTC) #13
tapted
ugh, shortly after uploading this r388275 added a new presubmit that banned new/changed/moved code from ...
4 years, 8 months ago (2016-04-22 06:13:57 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907833002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907833002/80001
4 years, 8 months ago (2016-04-22 06:14:15 UTC) #17
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years, 8 months ago (2016-04-22 06:19:18 UTC) #19
kjellander_chromium
A revert of this CL (patchset #4 id:80001) has been created in https://codereview.chromium.org/1914443002/ by kjellander@chromium.org. ...
4 years, 8 months ago (2016-04-22 11:23:31 UTC) #20
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/758d2baa307aa32b9de708e97655663726b8fa9c Cr-Commit-Position: refs/heads/master@{#389042}
4 years, 8 months ago (2016-04-22 19:44:54 UTC) #22
tapted
4 years, 8 months ago (2016-04-26 23:59:27 UTC) #23
Message was sent while issue was closed.
In case anyone comes spelunking here, this was continued in
https://codereview.chromium.org/1919123002 and landed in r389924 as
https://crrev.com/59fe54df8c0de55f03c8fb5e1860279d2993b473

Details about the regression: http://crrev.com/1919123002#msg3

Powered by Google App Engine
This is Rietveld 408576698