OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 unsigned numCharacters() const { return m_numCharacters; } | 68 unsigned numCharacters() const { return m_numCharacters; } |
69 void fallbackFonts(HashSet<const SimpleFontData*>*) const; | 69 void fallbackFonts(HashSet<const SimpleFontData*>*) const; |
70 bool rtl() const { | 70 bool rtl() const { |
71 return static_cast<TextDirection>(m_direction) == TextDirection::kRtl; | 71 return static_cast<TextDirection>(m_direction) == TextDirection::kRtl; |
72 } | 72 } |
73 bool hasVerticalOffsets() const { return m_hasVerticalOffsets; } | 73 bool hasVerticalOffsets() const { return m_hasVerticalOffsets; } |
74 | 74 |
75 // For memory reporting. | 75 // For memory reporting. |
76 size_t byteSize() const; | 76 size_t byteSize() const; |
77 | 77 |
78 int offsetForPosition(float targetX, bool includePartialGlyphs) const; | 78 unsigned offsetForPosition(float targetX, bool includePartialGlyphs) const; |
| 79 float positionForOffset(unsigned offset) const; |
79 | 80 |
80 PassRefPtr<ShapeResult> applySpacingToCopy(ShapeResultSpacing&, | 81 PassRefPtr<ShapeResult> applySpacingToCopy(ShapeResultSpacing&, |
81 const TextRun&) const; | 82 const TextRun&) const; |
82 | 83 |
83 protected: | 84 protected: |
84 struct RunInfo; | 85 struct RunInfo; |
85 | 86 |
86 ShapeResult(const Font*, unsigned numCharacters, TextDirection); | 87 ShapeResult(const Font*, unsigned numCharacters, TextDirection); |
87 ShapeResult(const ShapeResult&); | 88 ShapeResult(const ShapeResult&); |
88 | 89 |
(...skipping 23 matching lines...) Expand all Loading... |
112 // Tracks whether any runs contain glyphs with a y-offset != 0. | 113 // Tracks whether any runs contain glyphs with a y-offset != 0. |
113 unsigned m_hasVerticalOffsets : 1; | 114 unsigned m_hasVerticalOffsets : 1; |
114 | 115 |
115 friend class HarfBuzzShaper; | 116 friend class HarfBuzzShaper; |
116 friend class ShapeResultBuffer; | 117 friend class ShapeResultBuffer; |
117 }; | 118 }; |
118 | 119 |
119 } // namespace blink | 120 } // namespace blink |
120 | 121 |
121 #endif // ShapeResult_h | 122 #endif // ShapeResult_h |
OLD | NEW |