Index: src/core/SkGlyph.h |
diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h |
index 92f974bc2cf456f8ed367c5f8d0c676baa8a2f26..f9b94a0268f9c9de869f04d09a9cba370c3e42d3 100644 |
--- a/src/core/SkGlyph.h |
+++ b/src/core/SkGlyph.h |
@@ -34,12 +34,28 @@ 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 |
+ }; |
+ |
+ struct PathData { |
+ Intercept* fIntercept; |
+ SkPath* fPath; |
+ }; |
+ |
+public: |
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; |
+ PathData* fPathData; |
SkFixed fAdvanceX, fAdvanceY; |
uint16_t fWidth, fHeight; |
@@ -133,7 +149,7 @@ class SkGlyph { |
void initCommon(uint32_t id) { |
fID = id; |
fImage = nullptr; |
- fPath = nullptr; |
+ fPathData = nullptr; |
fMaskFormat = MASK_FORMAT_UNKNOWN; |
fForceBW = 0; |
} |
@@ -176,7 +192,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: |