Index: src/core/SkGlyph.h |
diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h |
index 92f974bc2cf456f8ed367c5f8d0c676baa8a2f26..87ce6f903e7a1594f4df4e85621c8afd3d738e56 100644 |
--- a/src/core/SkGlyph.h |
+++ b/src/core/SkGlyph.h |
@@ -34,7 +34,19 @@ class SkGlyph { |
kSubShiftY = 0 |
}; |
- 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 |
+ }; |
+ |
+ Intercept* fIntercept; |
f(malita)
2016/02/08 14:20:27
Caching this is nice, but may be overkill at this
caryclark
2016/02/09 19:10:57
If the same glyphs are underlined widely by the ca
|
+public: |
static const SkFixed kSubpixelRound = SK_FixedHalf >> SkGlyph::kSubBits; |
// A value that can never be generated by MakeID. |
static const uint32_t kImpossibleID = ~0; |
@@ -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; |
@@ -176,7 +189,7 @@ class SkGlyph { |
return ID; |
} |
- // FIXME - This is needed because the Android frame work directly |
+ // FIXME - This is needed because the Android frame work directly |
// accesses fID. Remove when fID accesses are cleaned up. |
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
public: |