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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 m_canShapeWordByWord = b; | 118 m_canShapeWordByWord = b; |
119 m_shapeWordByWordComputed = true; | 119 m_shapeWordByWordComputed = true; |
120 } | 120 } |
121 | 121 |
122 private: | 122 private: |
123 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; | 123 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; |
124 | 124 |
125 // Returns the total advance. | 125 // Returns the total advance. |
126 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, const GlyphDat
a* emphasisData = nullptr) const; | 126 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, const GlyphDat
a* emphasisData = nullptr) const; |
127 PassTextBlobPtr buildTextBlob(const GlyphBuffer&) const; | 127 PassTextBlobPtr buildTextBlob(const GlyphBuffer&) const; |
128 void paintGlyphs(SkCanvas*, const SkPaint&, const SimpleFontData*, const Gly
ph glyphs[], unsigned numGlyphs, | 128 void drawGlyphs(SkCanvas*, const SkPaint&, const SimpleFontData*, const Glyp
hBuffer&, |
129 const SkPoint pos[], const FloatRect& textRect, float deviceScaleFactor)
const; | 129 unsigned from, unsigned numGlyphs, const FloatPoint&, float deviceScaleF
actor) const; |
130 void paintGlyphsHorizontal(SkCanvas*, const SkPaint&, const SimpleFontData*,
const Glyph glyphs[], unsigned numGlyphs, | |
131 const SkScalar xpos[], SkScalar constY, const FloatRect& textRect, float
deviceScaleFactor) const; | |
132 void drawGlyphs(SkCanvas*, const SkPaint&, const SimpleFontData*, const Glyp
hBuffer&, unsigned from, unsigned numGlyphs, | |
133 const FloatPoint&, const FloatRect& textRect, float deviceScaleFactor) c
onst; | |
134 void drawTextBlob(SkCanvas*, const SkPaint&, const SkTextBlob*, const SkPoin
t& origin) const; | 130 void drawTextBlob(SkCanvas*, const SkPaint&, const SkTextBlob*, const SkPoin
t& origin) const; |
135 void drawGlyphBuffer(SkCanvas*, const SkPaint&, const TextRunPaintInfo&, con
st GlyphBuffer&, const FloatPoint&, float deviceScaleFactor) const; | 131 void drawGlyphBuffer(SkCanvas*, const SkPaint&, const TextRunPaintInfo&, con
st GlyphBuffer&, const FloatPoint&, float deviceScaleFactor) const; |
136 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>
* fallbackFonts = 0, FloatRect* glyphBounds = 0) const; | 132 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>
* fallbackFonts = 0, FloatRect* glyphBounds = 0) const; |
137 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl
udePartialGlyphs) const; | 133 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl
udePartialGlyphs) const; |
138 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int
h, int from, int to, bool accountForGlyphBounds) const; | 134 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int
h, int from, int to, bool accountForGlyphBounds) const; |
139 | 135 |
140 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; | 136 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; |
141 | 137 |
142 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*
>* fallbackFonts, FloatRect* glyphBounds) const; | 138 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*
>* fallbackFonts, FloatRect* glyphBounds) const; |
143 int offsetForPositionForComplexText(const TextRun&, float position, bool inc
ludePartialGlyphs) const; | 139 int offsetForPositionForComplexText(const TextRun&, float position, bool inc
ludePartialGlyphs) const; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // if the distance to the next tab stop is less than that, advance an additi
onal tab stop. | 199 // if the distance to the next tab stop is less than that, advance an additi
onal tab stop. |
204 if (distanceToTabStop < std::max(fontDescription().letterSpacing(), LayoutUn
it::epsilon())) | 200 if (distanceToTabStop < std::max(fontDescription().letterSpacing(), LayoutUn
it::epsilon())) |
205 distanceToTabStop += baseTabWidth; | 201 distanceToTabStop += baseTabWidth; |
206 | 202 |
207 return distanceToTabStop; | 203 return distanceToTabStop; |
208 } | 204 } |
209 | 205 |
210 } // namespace blink | 206 } // namespace blink |
211 | 207 |
212 #endif | 208 #endif |
OLD | NEW |