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

Issue 1654883003: add helper to create fancy underlines (Closed)

Created:
4 years, 10 months ago by caryclark
Modified:
4 years, 10 months ago
Reviewers:
herb_g, f(malita), mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

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 Committed: https://skia.googlesource.com/skia/+/0449bcfb2fa1dd33cb3a4c0c8b17960d17edf01a

Patch Set 1 #

Patch Set 2 : flesh out underline code #

Patch Set 3 : wip; sorta works #

Patch Set 4 : wip; full underline example #

Patch Set 5 : fix uninitialized #

Patch Set 6 : add postext variant #

Patch Set 7 : add pos text example #

Patch Set 8 : wip; clean up code so far #

Patch Set 9 : wip; revert some arbitrary changes #

Patch Set 10 : wip; move intercept struct to avoid padding #

Patch Set 11 : wip; half-way through the dreaded fully-contains case #

Patch Set 12 : wip; switch to scalars instead of rects #

Patch Set 13 : wip; end of experiment #

Patch Set 14 : wip; college try #2 incomplete #

Patch Set 15 : wip; fix 2nd try #

Patch Set 16 : half-hearted attempt to support vertical #

Patch Set 17 : fix uninitialized var #

Total comments: 7

Patch Set 18 : fix gold bounds #

Patch Set 19 : make bounds const #

Total comments: 2

Patch Set 20 : make intercept struct private #

Patch Set 21 : try again to get dense #

Patch Set 22 : try again to get denser #

Patch Set 23 : less dense again (me, not the code) #

Total comments: 4

Patch Set 24 : address cl feedback #

Patch Set 25 : correct comment to multiply by two #

Unified diffs Side-by-side diffs Delta from patch set Stats (+581 lines, -35 lines) Patch
M gm/texteffects.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +160 lines, -0 lines 0 comments Download
M include/core/SkPaint.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +56 lines, -4 lines 0 comments Download
M src/core/SkGlyph.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +20 lines, -4 lines 0 comments Download
M src/core/SkGlyphCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +20 lines, -0 lines 0 comments Download
M src/core/SkGlyphCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +181 lines, -7 lines 0 comments Download
M src/core/SkPaint.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 5 chunks +49 lines, -2 lines 0 comments Download
M src/core/SkTextToPathIter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +72 lines, -18 lines 0 comments Download
M src/pathops/SkDQuadLineIntersection.cpp View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M src/pathops/SkPathOpsQuad.h View 1 2 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 62 (28 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/60001
4 years, 10 months ago (2016-02-02 20:51:57 UTC) #3
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Ubuntu-GCC-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Release-Trybot/builds/5807)
4 years, 10 months ago (2016-02-02 20:53:42 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/80001
4 years, 10 months ago (2016-02-02 21:30:21 UTC) #7
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-02 22:02:02 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/160001
4 years, 10 months ago (2016-02-03 17:09:27 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Mac10.8-Clang-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Mac10.8-Clang-x86_64-Release-Trybot/builds/8200) Build-Ubuntu-Clang-x86_64-Debug-Trybot on ...
4 years, 10 months ago (2016-02-03 17:10:42 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/180001
4 years, 10 months ago (2016-02-03 17:24:18 UTC) #15
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-03 17:52:25 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/300001
4 years, 10 months ago (2016-02-05 16:09:05 UTC) #19
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Ubuntu-GCC-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Release-Trybot/builds/5910)
4 years, 10 months ago (2016-02-05 16:10:19 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/320001
4 years, 10 months ago (2016-02-05 16:25:43 UTC) #23
caryclark
4 years, 10 months ago (2016-02-05 16:42:27 UTC) #26
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-05 16:56:40 UTC) #28
reed1
herb, mike, are we sensitive to the size/density of SkGlyph? https://codereview.chromium.org/1654883003/diff/320001/include/core/SkPaint.h File include/core/SkPaint.h (right): https://codereview.chromium.org/1654883003/diff/320001/include/core/SkPaint.h#newcode922 ...
4 years, 10 months ago (2016-02-05 18:56:59 UTC) #30
caryclark
https://codereview.chromium.org/1654883003/diff/320001/include/core/SkPaint.h File include/core/SkPaint.h (right): https://codereview.chromium.org/1654883003/diff/320001/include/core/SkPaint.h#newcode922 include/core/SkPaint.h:922: int getTextIntercepts(const void* text, size_t length, SkScalar x, SkScalar ...
4 years, 10 months ago (2016-02-05 19:43:36 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/360001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/360001
4 years, 10 months ago (2016-02-05 20:11:29 UTC) #33
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-05 20:43:54 UTC) #35
herb_g
https://codereview.chromium.org/1654883003/diff/360001/src/core/SkGlyph.h File src/core/SkGlyph.h (right): https://codereview.chromium.org/1654883003/diff/360001/src/core/SkGlyph.h#newcode47 src/core/SkGlyph.h:47: }; Can this struct and fIntercept go in the ...
4 years, 10 months ago (2016-02-05 21:09:37 UTC) #36
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/380001
4 years, 10 months ago (2016-02-05 21:25:44 UTC) #38
caryclark
https://codereview.chromium.org/1654883003/diff/360001/src/core/SkGlyph.h File src/core/SkGlyph.h (right): https://codereview.chromium.org/1654883003/diff/360001/src/core/SkGlyph.h#newcode47 src/core/SkGlyph.h:47: }; On 2016/02/05 21:09:37, herb_g wrote: > Can this ...
4 years, 10 months ago (2016-02-05 21:26:00 UTC) #39
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Mac-Clang-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Mac-Clang-x86_64-Release-Trybot/builds/20)
4 years, 10 months ago (2016-02-05 21:27:21 UTC) #41
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/400001
4 years, 10 months ago (2016-02-05 21:34:11 UTC) #43
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/440001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/440001
4 years, 10 months ago (2016-02-05 21:43:48 UTC) #45
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-05 22:47:29 UTC) #47
caryclark
Any other issues I can address? By the way, you can see the output by ...
4 years, 10 months ago (2016-02-06 13:19:49 UTC) #48
reed1
Questions about API - can the returned count be zero? - can the returned count ...
4 years, 10 months ago (2016-02-08 14:03:12 UTC) #49
f(malita)
https://codereview.chromium.org/1654883003/diff/440001/include/core/SkPaint.h File include/core/SkPaint.h (right): https://codereview.chromium.org/1654883003/diff/440001/include/core/SkPaint.h#newcode923 include/core/SkPaint.h:923: const SkScalar bounds[2], SkScalar* array) const; It's a bit ...
4 years, 10 months ago (2016-02-08 14:20:28 UTC) #50
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/460001
4 years, 10 months ago (2016-02-09 19:07:56 UTC) #52
caryclark
On 2016/02/08 14:03:12, reed1 wrote: > Questions about API > > - can the returned ...
4 years, 10 months ago (2016-02-09 19:10:45 UTC) #53
caryclark
https://codereview.chromium.org/1654883003/diff/440001/include/core/SkPaint.h File include/core/SkPaint.h (right): https://codereview.chromium.org/1654883003/diff/440001/include/core/SkPaint.h#newcode923 include/core/SkPaint.h:923: const SkScalar bounds[2], SkScalar* array) const; On 2016/02/08 14:20:27, ...
4 years, 10 months ago (2016-02-09 19:10:57 UTC) #54
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-09 19:32:42 UTC) #56
reed1
lgtm w/ clarification in dox: max intervals will be 2 * number of characters/glyphs.
4 years, 10 months ago (2016-02-09 20:31:55 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654883003/480001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654883003/480001
4 years, 10 months ago (2016-02-09 20:47:51 UTC) #60
commit-bot: I haz the power
4 years, 10 months ago (2016-02-09 21:25:49 UTC) #62
Message was sent while issue was closed.
Committed patchset #25 (id:480001) as
https://skia.googlesource.com/skia/+/0449bcfb2fa1dd33cb3a4c0c8b17960d17edf01a

Powered by Google App Engine
This is Rietveld 408576698