Chromium Code Reviews| Index: Source/platform/fonts/Font.h |
| diff --git a/Source/platform/fonts/Font.h b/Source/platform/fonts/Font.h |
| index 22afbdd82df688d2836cac42b3fa8eab8cf4c430..5460b6a0d2c0370a1f65f2531bc62b47f8c834e5 100644 |
| --- a/Source/platform/fonts/Font.h |
| +++ b/Source/platform/fonts/Font.h |
| @@ -61,32 +61,6 @@ struct TextRunPaintInfo; |
| struct GlyphData; |
| -struct GlyphOverflow { |
| - GlyphOverflow() |
| - : left(0) |
| - , right(0) |
| - , top(0) |
| - , bottom(0) |
| - , computeBounds(false) |
| - { |
| - } |
| - |
| - bool isZero() const |
| - { |
| - return !left && !right && !top && !bottom; |
| - } |
| - |
| - // If computeBounds, top and bottom are the maximum heights of the glyphs above and below the baseline, respectively. |
| - // Otherwise they are the amounts of glyph overflows exceeding the font metrics' ascent and descent, respectively. |
| - // Left and right are the amounts of glyph overflows exceeding the left and right edge of normal layout boundary, respectively. |
| - // All fields are in absolute number of pixels rounded up to the nearest integer. |
| - int left; |
| - int right; |
| - int top; |
| - int bottom; |
| - bool computeBounds; |
| -}; |
| - |
|
Xianzhu
2015/06/11 18:22:48
Moved to Source/core/layout/line/GlyphOverflow.h b
|
| class PLATFORM_EXPORT Font { |
| public: |
| Font(); |
| @@ -108,7 +82,9 @@ public: |
| void drawBidiText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, CustomFontNotReadyAction, float deviceScaleFactor, const SkPaint&) const; |
| void drawEmphasisMarks(SkCanvas*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&, float deviceScaleFactor, const SkPaint&) const; |
| - float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; |
| + // Glyph bounds will be the minimum rect containing all glyph strokes, in coordinates using |
| + // (<text run x position>, <baseline position>) as the origin. |
| + float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* glyphBounds = nullptr) const; |
| int offsetForPosition(const TextRun&, float position, bool includePartialGlyphs) const; |
| FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1, bool accountForGlyphBounds = false) const; |
| @@ -143,13 +119,13 @@ private: |
| const FloatPoint&, const FloatRect& textRect, float deviceScaleFactor) const; |
| void drawTextBlob(SkCanvas*, const SkPaint&, const SkTextBlob*, const SkPoint& origin) const; |
| void drawGlyphBuffer(SkCanvas*, const SkPaint&, const TextRunPaintInfo&, const GlyphBuffer&, const FloatPoint&, float deviceScaleFactor) const; |
| - float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, FloatRectOutsets* glyphBounds = 0) const; |
| + float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, FloatRect* glyphBounds = 0) const; |
| int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const; |
| FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to, bool accountForGlyphBounds) const; |
| bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; |
| - float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts, FloatRectOutsets* glyphBounds) const; |
| + float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* glyphBounds) const; |
| int offsetForPositionForComplexText(const TextRun&, float position, bool includePartialGlyphs) const; |
| FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const; |