Chromium Code Reviews| Index: src/core/SkGlyph.h |
| diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h |
| index 92f974bc2cf456f8ed367c5f8d0c676baa8a2f26..280e5bc5f1d918a4c8f01e4ff687817e647967f9 100644 |
| --- a/src/core/SkGlyph.h |
| +++ b/src/core/SkGlyph.h |
| @@ -34,12 +34,24 @@ class SkGlyph { |
| kSubShiftY = 0 |
| }; |
| - public: |
| +public: |
| + // Support horizontal and vertical skipping strike-through / underlines. |
| + // The caller walks the linked list looking for a match. For a horizontal underline, |
| + // the fBounds contains the top and bottom of the underline. The fInterval pair contains the |
| + // beginning and end of of the intersection of the bounds and the glyph's path. |
| + // If interval[0] >= interval[1], no intesection was found. |
| + struct Intercept { |
| + Intercept* fNext; |
| + SkScalar fBounds[2]; // for horz underlines, the boundaries in Y |
| + SkScalar fInterval[2]; // the outside intersections of the axis and the glyph |
| + }; |
| + |
| static const SkFixed kSubpixelRound = SK_FixedHalf >> SkGlyph::kSubBits; |
| // A value that can never be generated by MakeID. |
| static const uint32_t kImpossibleID = ~0; |
| void* fImage; |
| SkPath* fPath; |
| + Intercept* fIntercept; |
|
reed1
2016/02/05 18:56:59
Hmmm, we already have too much stored in Glyphs, s
caryclark
2016/02/05 19:43:36
I can imagine something that looks like
struct Gl
|
| SkFixed fAdvanceX, fAdvanceY; |
| uint16_t fWidth, fHeight; |
| @@ -133,6 +145,7 @@ class SkGlyph { |
| void initCommon(uint32_t id) { |
| fID = id; |
| fImage = nullptr; |
| + fIntercept = nullptr; |
| fPath = nullptr; |
| fMaskFormat = MASK_FORMAT_UNKNOWN; |
| fForceBW = 0; |