| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008 Holger Hans Peter Freyther | 6 * Copyright (C) 2008 Holger Hans Peter Freyther |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 , bottom(0) | 69 , bottom(0) |
| 70 , computeBounds(false) | 70 , computeBounds(false) |
| 71 { | 71 { |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool isZero() const | 74 bool isZero() const |
| 75 { | 75 { |
| 76 return !left && !right && !top && !bottom; | 76 return !left && !right && !top && !bottom; |
| 77 } | 77 } |
| 78 | 78 |
| 79 // If computeBounds, top and bottom are the maximum heights of the glyphs ab
ove and below the baseline, respectively. |
| 80 // Otherwise they are the amounts of glyph overflows exceeding the font metr
ics' ascent and descent, respectively. |
| 81 // Left and right are the amounts of glyph overflows exceeding the left and
right edge of normal layout boundary, respectively. |
| 82 // All fields are in absolute number of pixels rounded up to the nearest int
eger. |
| 79 int left; | 83 int left; |
| 80 int right; | 84 int right; |
| 81 int top; | 85 int top; |
| 82 int bottom; | 86 int bottom; |
| 83 bool computeBounds; | 87 bool computeBounds; |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 class PLATFORM_EXPORT Font { | 90 class PLATFORM_EXPORT Font { |
| 87 public: | 91 public: |
| 88 Font(); | 92 Font(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, const GlyphDat
a* emphasisData = nullptr) const; | 136 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, const GlyphDat
a* emphasisData = nullptr) const; |
| 133 PassTextBlobPtr buildTextBlob(const GlyphBuffer&) const; | 137 PassTextBlobPtr buildTextBlob(const GlyphBuffer&) const; |
| 134 void paintGlyphs(SkCanvas*, const SkPaint&, const SimpleFontData*, const Gly
ph glyphs[], unsigned numGlyphs, | 138 void paintGlyphs(SkCanvas*, const SkPaint&, const SimpleFontData*, const Gly
ph glyphs[], unsigned numGlyphs, |
| 135 const SkPoint pos[], const FloatRect& textRect, float deviceScaleFactor)
const; | 139 const SkPoint pos[], const FloatRect& textRect, float deviceScaleFactor)
const; |
| 136 void paintGlyphsHorizontal(SkCanvas*, const SkPaint&, const SimpleFontData*,
const Glyph glyphs[], unsigned numGlyphs, | 140 void paintGlyphsHorizontal(SkCanvas*, const SkPaint&, const SimpleFontData*,
const Glyph glyphs[], unsigned numGlyphs, |
| 137 const SkScalar xpos[], SkScalar constY, const FloatRect& textRect, float
deviceScaleFactor) const; | 141 const SkScalar xpos[], SkScalar constY, const FloatRect& textRect, float
deviceScaleFactor) const; |
| 138 void drawGlyphs(SkCanvas*, const SkPaint&, const SimpleFontData*, const Glyp
hBuffer&, unsigned from, unsigned numGlyphs, | 142 void drawGlyphs(SkCanvas*, const SkPaint&, const SimpleFontData*, const Glyp
hBuffer&, unsigned from, unsigned numGlyphs, |
| 139 const FloatPoint&, const FloatRect& textRect, float deviceScaleFactor) c
onst; | 143 const FloatPoint&, const FloatRect& textRect, float deviceScaleFactor) c
onst; |
| 140 void drawTextBlob(SkCanvas*, const SkPaint&, const SkTextBlob*, const SkPoin
t& origin) const; | 144 void drawTextBlob(SkCanvas*, const SkPaint&, const SkTextBlob*, const SkPoin
t& origin) const; |
| 141 void drawGlyphBuffer(SkCanvas*, const SkPaint&, const TextRunPaintInfo&, con
st GlyphBuffer&, const FloatPoint&, float deviceScaleFactor) const; | 145 void drawGlyphBuffer(SkCanvas*, const SkPaint&, const TextRunPaintInfo&, con
st GlyphBuffer&, const FloatPoint&, float deviceScaleFactor) const; |
| 142 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>
* fallbackFonts = 0, IntRectOutsets* glyphBounds = 0) const; | 146 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>
* fallbackFonts = 0, FloatRectOutsets* glyphBounds = 0) const; |
| 143 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl
udePartialGlyphs) const; | 147 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl
udePartialGlyphs) const; |
| 144 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int
h, int from, int to, bool accountForGlyphBounds) const; | 148 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int
h, int from, int to, bool accountForGlyphBounds) const; |
| 145 | 149 |
| 146 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; | 150 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; |
| 147 | 151 |
| 148 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*
>* fallbackFonts, IntRectOutsets* glyphBounds) const; | 152 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*
>* fallbackFonts, FloatRectOutsets* glyphBounds) const; |
| 149 int offsetForPositionForComplexText(const TextRun&, float position, bool inc
ludePartialGlyphs) const; | 153 int offsetForPositionForComplexText(const TextRun&, float position, bool inc
ludePartialGlyphs) const; |
| 150 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int
h, int from, int to) const; | 154 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int
h, int from, int to) const; |
| 151 | 155 |
| 152 friend struct SimpleShaper; | 156 friend struct SimpleShaper; |
| 153 | 157 |
| 154 public: | 158 public: |
| 155 FontSelector* fontSelector() const; | 159 FontSelector* fontSelector() const; |
| 156 | 160 |
| 157 void willUseFontData(UChar32) const; | 161 void willUseFontData(UChar32) const; |
| 158 | 162 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // to the next tab stop is less than that, advance an additional tab stop. | 205 // to the next tab stop is less than that, advance an additional tab stop. |
| 202 if (distanceToTabStop < fontDescription().letterSpacing()) | 206 if (distanceToTabStop < fontDescription().letterSpacing()) |
| 203 distanceToTabStop += baseTabWidth; | 207 distanceToTabStop += baseTabWidth; |
| 204 | 208 |
| 205 return distanceToTabStop; | 209 return distanceToTabStop; |
| 206 } | 210 } |
| 207 | 211 |
| 208 } // namespace blink | 212 } // namespace blink |
| 209 | 213 |
| 210 #endif | 214 #endif |
| OLD | NEW |