| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ShapeResultBuffer_h | 5 #ifndef ShapeResultBuffer_h |
| 6 #define ShapeResultBuffer_h | 6 #define ShapeResultBuffer_h |
| 7 | 7 |
| 8 #include "platform/fonts/shaping/ShapeResult.h" | 8 #include "platform/fonts/shaping/ShapeResult.h" |
| 9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 10 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 float targetX, | 44 float targetX, |
| 45 bool includePartialGlyphs) const; | 45 bool includePartialGlyphs) const; |
| 46 CharacterRange getCharacterRange(TextDirection, | 46 CharacterRange getCharacterRange(TextDirection, |
| 47 float totalWidth, | 47 float totalWidth, |
| 48 unsigned from, | 48 unsigned from, |
| 49 unsigned to) const; | 49 unsigned to) const; |
| 50 Vector<CharacterRange> individualCharacterRanges(TextDirection, | 50 Vector<CharacterRange> individualCharacterRanges(TextDirection, |
| 51 float totalWidth) const; | 51 float totalWidth) const; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 float fillFastHorizontalGlyphBuffer(GlyphBuffer*, TextDirection) const; | 54 float fillFastHorizontalGlyphBuffer(GlyphBuffer*, const TextRun&) const; |
| 55 | 55 |
| 56 template <TextDirection> | 56 template <TextDirection> |
| 57 static float fillGlyphBufferForRun(GlyphBuffer*, | 57 static float fillGlyphBufferForRun(GlyphBuffer*, |
| 58 const ShapeResult::RunInfo*, | 58 const ShapeResult::RunInfo*, |
| 59 const TextRun&, |
| 59 float initialAdvance, | 60 float initialAdvance, |
| 60 unsigned from, | 61 unsigned from, |
| 61 unsigned to, | 62 unsigned to, |
| 62 unsigned runOffset); | 63 unsigned runOffset); |
| 63 static float fillGlyphBufferForTextEmphasisRun(GlyphBuffer*, | 64 static float fillGlyphBufferForTextEmphasisRun(GlyphBuffer*, |
| 64 const ShapeResult::RunInfo*, | 65 const ShapeResult::RunInfo*, |
| 65 const TextRun&, | 66 const TextRun&, |
| 66 const GlyphData*, | 67 const GlyphData*, |
| 67 float initialAdvance, | 68 float initialAdvance, |
| 68 unsigned from, | 69 unsigned from, |
| 69 unsigned to, | 70 unsigned to, |
| 70 unsigned runOffset); | 71 unsigned runOffset); |
| 71 | 72 |
| 72 static void addRunInfoRanges(const ShapeResult::RunInfo&, | 73 static void addRunInfoRanges(const ShapeResult::RunInfo&, |
| 73 float offset, | 74 float offset, |
| 74 Vector<CharacterRange>&); | 75 Vector<CharacterRange>&); |
| 75 | 76 |
| 76 // Empirically, cases where we get more than 50 ShapeResults are extremely | 77 // Empirically, cases where we get more than 50 ShapeResults are extremely |
| 77 // rare. | 78 // rare. |
| 78 Vector<RefPtr<const ShapeResult>, 64> m_results; | 79 Vector<RefPtr<const ShapeResult>, 64> m_results; |
| 79 bool m_hasVerticalOffsets; | 80 bool m_hasVerticalOffsets; |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace blink | 83 } // namespace blink |
| 83 | 84 |
| 84 #endif // ShapeResultBuffer_h | 85 #endif // ShapeResultBuffer_h |
| OLD | NEW |