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

Issue 2718043003: Refactor InspectorCSSAgent to avoid an intermediate GlyphBuffer (Closed)

Created:
3 years, 9 months ago by f(malita)
Modified:
3 years, 9 months ago
Reviewers:
drott, dgozman, eae
CC:
jbroman, ajuma+watch_chromium.org, apavlov+blink_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, caseq+blink_chromium.org, chromium-reviews, danakj+watch_chromium.org, devtools-reviews_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, fmalita+watch_chromium.org, Justin Novosad, kinuko+watch, kozyatinskiy+blink_chromium.org, lushnikov+blink_chromium.org, pdr+graphicswatchlist_chromium.org, pfeldman+blink_chromium.org, reed1, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -82 lines) Patch
M third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp View 1 2 3 2 chunks +6 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/Font.h View 1 chunk +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/Font.cpp View 5 chunks +13 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h View 1 2 3 4 2 chunks +16 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.cpp View 1 2 3 4 4 chunks +21 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp View 1 2 3 4 chunks +23 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.h View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.cpp View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (24 generated)
f(malita)
One less GlyphBuffer user.
3 years, 9 months ago (2017-02-27 21:40:56 UTC) #10
jbroman
one drive-by comment, if you don't mind https://codereview.chromium.org/2718043003/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/2718043003/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp#newcode1141 third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp:1141: const auto ...
3 years, 9 months ago (2017-02-27 22:00:57 UTC) #11
f(malita)
https://codereview.chromium.org/2718043003/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/2718043003/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp#newcode1141 third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp:1141: const auto simpleFontData = std::get<0>(runFontData); On 2017/02/27 22:00:57, jbroman ...
3 years, 9 months ago (2017-02-27 22:10:04 UTC) #14
eae
Thanks for working on this. https://codereview.chromium.org/2718043003/diff/40001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/2718043003/diff/40001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp#newcode1140 third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp:1140: for (const auto& runFontData ...
3 years, 9 months ago (2017-02-27 23:24:59 UTC) #15
f(malita)
https://codereview.chromium.org/2718043003/diff/40001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/2718043003/diff/40001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp#newcode1140 third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp:1140: for (const auto& runFontData : shaper.getRunFontData(run)) { On 2017/02/27 ...
3 years, 9 months ago (2017-02-28 03:27:47 UTC) #24
eae
LGTM! Thanks for making the suggested changes, this makes it so much easier to read. ...
3 years, 9 months ago (2017-02-28 03:31:19 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2718043003/80001
3 years, 9 months ago (2017-02-28 12:56:14 UTC) #29
commit-bot: I haz the power
3 years, 9 months ago (2017-02-28 13:01:34 UTC) #32
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/7164a2cd55c9d685288fc5489306...

Powered by Google App Engine
This is Rietveld 408576698