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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 { | 71 { |
72 if (runIndex < m_harfBuzzRuns.size()) { | 72 if (runIndex < m_harfBuzzRuns.size()) { |
73 startIndex = m_harfBuzzRuns[runIndex]->startIndex(); | 73 startIndex = m_harfBuzzRuns[runIndex]->startIndex(); |
74 numGlyphs = m_harfBuzzRuns[runIndex]->numGlyphs(); | 74 numGlyphs = m_harfBuzzRuns[runIndex]->numGlyphs(); |
75 script = m_harfBuzzRuns[runIndex]->script(); | 75 script = m_harfBuzzRuns[runIndex]->script(); |
76 return true; | 76 return true; |
77 } | 77 } |
78 return false; | 78 return false; |
79 } | 79 } |
80 | 80 |
81 uint16_t glyphForTesting(unsigned runIndex, size_t glyphIndex) | |
82 { | |
83 return m_harfBuzzRuns[runIndex]->glyphData(glyphIndex).glyph; | |
84 } | |
85 | |
86 float advanceForTesting(unsigned runIndex, size_t glyphIndex) | |
87 { | |
88 return m_harfBuzzRuns[runIndex]->glyphData(glyphIndex).advance; | |
89 } | |
90 | |
91 private: | 81 private: |
92 struct HarfBuzzRunGlyphData { | 82 struct HarfBuzzRunGlyphData { |
93 uint16_t glyph; | 83 uint16_t glyph; |
94 uint16_t characterIndex; | 84 uint16_t characterIndex; |
95 float advance; | 85 float advance; |
96 FloatSize offset; | 86 FloatSize offset; |
97 }; | 87 }; |
98 | 88 |
99 class PLATFORM_EXPORT HarfBuzzRun { | 89 class PLATFORM_EXPORT HarfBuzzRun { |
100 public: | 90 public: |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 int m_toIndex; | 160 int m_toIndex; |
171 | 161 |
172 float m_totalWidth; | 162 float m_totalWidth; |
173 | 163 |
174 friend struct CachedShapingResults; | 164 friend struct CachedShapingResults; |
175 }; | 165 }; |
176 | 166 |
177 } // namespace blink | 167 } // namespace blink |
178 | 168 |
179 #endif // HarfBuzzShaper_h | 169 #endif // HarfBuzzShaper_h |
OLD | NEW |