| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 130 } |
| 131 | 131 |
| 132 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32&, bool
mirror, bool normalizeSpace = false, FontDataVariant = AutoVariant) const; | 132 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32&, bool
mirror, bool normalizeSpace = false, FontDataVariant = AutoVariant) const; |
| 133 bool primaryFontHasGlyphForCharacter(UChar32) const; | 133 bool primaryFontHasGlyphForCharacter(UChar32) const; |
| 134 | 134 |
| 135 CodePath codePath(const TextRunPaintInfo&) const; | 135 CodePath codePath(const TextRunPaintInfo&) const; |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; | 138 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; |
| 139 | 139 |
| 140 // Returns the initial in-stream advance. | 140 // Returns the total advance. |
| 141 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, ForTextEmphasi
sOrNot = NotForTextEmphasis) const; | 141 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, ForTextEmphasi
sOrNot = NotForTextEmphasis) const; |
| 142 PassTextBlobPtr buildTextBlob(const GlyphBuffer&, float initialAdvance, cons
t FloatRect& bounds, | 142 PassTextBlobPtr buildTextBlob(const GlyphBuffer&, const FloatRect& bounds, b
ool couldUseLCD) const; |
| 143 bool couldUseLCD) const; | |
| 144 | |
| 145 SkPaint textFillPaint(GraphicsContext*, const SimpleFontData*) const; | 143 SkPaint textFillPaint(GraphicsContext*, const SimpleFontData*) const; |
| 146 SkPaint textStrokePaint(GraphicsContext*, const SimpleFontData*, bool isFill
ing) const; | 144 SkPaint textStrokePaint(GraphicsContext*, const SimpleFontData*, bool isFill
ing) const; |
| 147 void paintGlyphs(GraphicsContext*, const SimpleFontData*, const Glyph glyphs
[], unsigned numGlyphs, | 145 void paintGlyphs(GraphicsContext*, const SimpleFontData*, const Glyph glyphs
[], unsigned numGlyphs, |
| 148 const SkPoint pos[], const FloatRect& textRect) const; | 146 const SkPoint pos[], const FloatRect& textRect) const; |
| 149 void paintGlyphsHorizontal(GraphicsContext*, const SimpleFontData*, const Gl
yph glyphs[], unsigned numGlyphs, | 147 void paintGlyphsHorizontal(GraphicsContext*, const SimpleFontData*, const Gl
yph glyphs[], unsigned numGlyphs, |
| 150 const SkScalar xpos[], SkScalar constY, const FloatRect& textRect) const
; | 148 const SkScalar xpos[], SkScalar constY, const FloatRect& textRect) const
; |
| 149 void paintGlyphsVertical(GraphicsContext*, const SimpleFontData*, const Glyp
hBuffer&, |
| 150 unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect&)
const; |
| 151 void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&,
unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect& textRect
) const; | 151 void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&,
unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect& textRect
) const; |
| 152 void drawTextBlob(GraphicsContext*, const SkTextBlob*, const SkPoint& origin
) const; | 152 void drawTextBlob(GraphicsContext*, const SkTextBlob*, const SkPoint& origin
) const; |
| 153 float drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const Glyph
Buffer&, const FloatPoint&) const; | 153 void drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const GlyphB
uffer&, const FloatPoint&) const; |
| 154 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Glyp
hBuffer&, const AtomicString&, const FloatPoint&) const; | 154 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Glyp
hBuffer&, const AtomicString&, const FloatPoint&) const; |
| 155 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>
* fallbackFonts = 0, IntRectExtent* glyphBounds = 0) const; | 155 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>
* fallbackFonts = 0, IntRectExtent* glyphBounds = 0) const; |
| 156 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl
udePartialGlyphs) const; | 156 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl
udePartialGlyphs) const; |
| 157 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int
h, int from, int to, bool accountForGlyphBounds) const; | 157 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int
h, int from, int to, bool accountForGlyphBounds) const; |
| 158 | 158 |
| 159 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; | 159 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; |
| 160 | 160 |
| 161 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*
>* fallbackFonts, IntRectExtent* glyphBounds) const; | 161 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*
>* fallbackFonts, IntRectExtent* glyphBounds) const; |
| 162 int offsetForPositionForComplexText(const TextRun&, float position, bool inc
ludePartialGlyphs) const; | 162 int offsetForPositionForComplexText(const TextRun&, float position, bool inc
ludePartialGlyphs) const; |
| 163 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int
h, int from, int to) const; | 163 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int
h, int from, int to) const; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 { | 217 { |
| 218 if (!tabSize) | 218 if (!tabSize) |
| 219 return fontDescription().letterSpacing(); | 219 return fontDescription().letterSpacing(); |
| 220 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS
pacing(); | 220 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS
pacing(); |
| 221 return tabWidth - fmodf(position, tabWidth); | 221 return tabWidth - fmodf(position, tabWidth); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace blink | 224 } // namespace blink |
| 225 | 225 |
| 226 #endif | 226 #endif |
| OLD | NEW |