add helper to create fancy underlines
authorcaryclark <caryclark@google.com>
Tue, 9 Feb 2016 21:25:45 +0000 (13:25 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 9 Feb 2016 21:25:45 +0000 (13:25 -0800)
commit0449bcfb2fa1dd33cb3a4c0c8b17960d17edf01a
tree8c9e8f7e7b02e5a337636a5f41e981ba4e363d59
parent3cb954245cecf262d740a83913681b9fe4b41555
add helper to create fancy underlines

Add a couple of utility functions to SkPaint that return the bounds
of glyphs between a pair of lines.

The common use case envisioned generates the edges of descenders
between the top and bottom bounds of an underline to allow computing
a stroke that skips those descenders.

The implementation stores a linked list in each glyph containing
the bounds of the lines parallel to the advance and the outermost
intersections within those bounds.

When the glyph cache is constructed, the glyph path is intersected
with the bounds and the extreme min and max values within the bounds
is added to an intercept.

Share the text to path iter to construct the data.

Make a half-hearted attempt to support vertical text; while the
vertical implementation is complete; surrounding code (e.g. paint
align) has short-comings with vertical.

R=fmalita@chromium.org, reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1654883003

Review URL: https://codereview.chromium.org/1654883003
gm/texteffects.cpp
include/core/SkPaint.h
src/core/SkGlyph.h
src/core/SkGlyphCache.cpp
src/core/SkGlyphCache.h
src/core/SkPaint.cpp
src/core/SkTextToPathIter.h
src/pathops/SkDQuadLineIntersection.cpp
src/pathops/SkPathOpsQuad.h