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

Issue 645363003: Consolidate most simple vs. complex Font methods (Closed)

Created:
6 years, 2 months ago by f(malita)
Modified:
6 years, 2 months ago
CC:
blink-reviews, krit, blink-reviews-rendering, Rik, jbroman, zoltan1, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, mkwst+moarreviews_chromium.org, danakj, pdr+graphicswatchlist_chromium.org, jchaffraix+rendering, Stephen Chennney, rwlbuis, rune+blink, reed1, bungeman-skia
Project:
blink
Visibility:
Public.

Description

Consolidate most simple vs. complex Font methods This CL encapsulates the simple/complex logic in a low level glyphBuffer builder function, and removes all paint-related codepath-specific methods. Everything above buildGlyphBuffer() now operates on a codepath-agnostic data structure (glyphBuffer). To pull this off, the CL unifies GlyphBuffer & GlyphBufferWithOffsets by adding offset support to the former. The approach has no downside beyond a slightly increased stack frame size for the simple path, and is aligned with plans to eventually store offsets for simple text also (and possibly drop advances altogether). Also, most text blob caching logic is relocated down into Font drawText() - which allows us to trivially add support for complex text blobs (currently still off due to the lack of offsets support in buildTextBlob). The advance return value (which doesn't play well with blob caching) is dropped, and the only existing client for it is converted to use a new dedicated, blob-cache-bypassing drawUncachedText() method. R=jbroman@chromium.org,eae@chromium.org,dominik.rottsches@intel.com,leviw@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183620

Patch Set 1 #

Patch Set 2 : GlyphBufferTest fix #

Patch Set 3 : minor drawText refactor #

Patch Set 4 : minor cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -228 lines) Patch
M Source/core/rendering/TextPainter.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/TextPainter.cpp View 1 chunk +9 lines, -19 lines 0 comments Download
M Source/platform/fonts/Font.h View 3 chunks +7 lines, -14 lines 0 comments Download
M Source/platform/fonts/Font.cpp View 1 2 3 9 chunks +96 lines, -138 lines 0 comments Download
M Source/platform/fonts/GlyphBuffer.h View 3 chunks +21 lines, -35 lines 0 comments Download
M Source/platform/fonts/GlyphBufferTest.cpp View 1 2 chunks +3 lines, -5 lines 0 comments Download
M Source/platform/fonts/shaping/HarfBuzzShaper.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/fonts/shaping/HarfBuzzShaper.cpp View 3 chunks +4 lines, -9 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.cpp View 2 chunks +2 lines, -5 lines 0 comments Download
M Source/platform/text/TextRun.h View 3 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
f(malita)
At -71 net LoC I think this is not a bad cleanup, but to sweeten ...
6 years, 2 months ago (2014-10-13 17:49:55 UTC) #3
eae
Very nice! LGTM
6 years, 2 months ago (2014-10-13 17:57:09 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/645363003/340001
6 years, 2 months ago (2014-10-13 18:03:27 UTC) #6
commit-bot: I haz the power
Committed patchset #4 (id:340001) as 183620
6 years, 2 months ago (2014-10-13 18:23:56 UTC) #7
Dominik Röttsches
6 years, 2 months ago (2014-10-14 06:43:30 UTC) #8
Message was sent while issue was closed.
Thanks! - that makes it again more readable.

One comment - From your description: "...and possibly drop advances altogether"
- I don't think we want to do that. We basically just refactored the GlyphBuffer
to keep advances + offsets, since it avoids issues with baseline shifts when
having Runs with mixed FontData, and also makes placing the initial glyph more
sane. It's also closer to the data we have in the font files itself. This change
allows us to get rid of the initialAdance value which basically belongs into
GlyphBuffer and not as a separate passed-around value. I think we can remove the
initialAdvance return that's still in Font.cpp in a separate patch.

Powered by Google App Engine
This is Rietveld 408576698