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

Issue 183203003: Reduce state kept in MeasureTextData by SVGTextMetricsBuilder (Closed)

Created:
6 years, 9 months ago by fs
Modified:
6 years, 9 months ago
CC:
blink-reviews, krit, bemjb+rendering_chromium.org, dsinclair, zoltan1, eae+blinkwatch, leviw+renderwatch, ed+blinkwatch_opera.com, f(malita), gyuyoung.kim_webkit.org, jchaffraix+rendering, pdr., Stephen Chennney, rwlbuis
Visibility:
Public.

Description

Reduce state kept in MeasureTextData by SVGTextMetricsBuilder MeasureTextData::processRenderer is only used within SVGTextMetricsBuilder::measureTextRenderer, and is always set before a call to that method. This makes a good candidate for removal from the traversal state struct (MeasureTextData) and being passed as an argument to measureTextRenderer instead. There's no need to track both the last character and whether there was a previous character. It's sufficient to track if the the last character was a whitespace or not. (The initial case which previously had hasLastCharacter == false can be represented as having a been a whitespace character.) This allows replacing the two fields hasLastCharacter and lastCharacter with a single field lastCharacterWasWhiteSpace. MeasureTextData::skippedCharacters is reset to zero (0) at the end of SVGTextMetricsBuilder::measureTextRenderer, and is only read or written if MeasureTextData::allCharactersMap is non-null. This means it can be kept on the stack of measureTextRenderer instead. Also change the type of surrogatePairCharacters from int to unsigned, since it's a simple counter, that should never be negative (and is used in arithmetic with unsigned typed variables.) Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168342

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -24 lines) Patch
M Source/core/rendering/svg/SVGTextMetricsBuilder.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/SVGTextMetricsBuilder.cpp View 4 chunks +15 lines, -23 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
fs
6 years, 9 months ago (2014-02-27 17:23:23 UTC) #1
fs
On 2014/02/27 17:23:23, fs wrote: Ping!
6 years, 9 months ago (2014-03-03 15:43:35 UTC) #2
Stephen Chennney
lgtm
6 years, 9 months ago (2014-03-03 15:55:30 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/183203003/1
6 years, 9 months ago (2014-03-03 15:55:40 UTC) #4
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-03 20:03:43 UTC) #5
commit-bot: I haz the power
Retried try job too often on win_layout for step(s) webkit_lint http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout&number=24787
6 years, 9 months ago (2014-03-03 20:03:44 UTC) #6
pdr.
The CQ bit was checked by pdr@chromium.org
6 years, 9 months ago (2014-03-03 20:04:57 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/183203003/1
6 years, 9 months ago (2014-03-03 20:05:10 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/183203003/1
6 years, 9 months ago (2014-03-03 23:19:57 UTC) #9
commit-bot: I haz the power
6 years, 9 months ago (2014-03-03 23:51:17 UTC) #10
Message was sent while issue was closed.
Change committed as 168342

Powered by Google App Engine
This is Rietveld 408576698