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 #include "platform/fonts/shaping/ShapeResultBuffer.h" | 5 #include "platform/fonts/shaping/ShapeResultBuffer.h" |
6 | 6 |
7 #include "platform/fonts/CharacterRange.h" | 7 #include "platform/fonts/CharacterRange.h" |
8 #include "platform/fonts/GlyphBuffer.h" | 8 #include "platform/fonts/GlyphBuffer.h" |
9 #include "platform/fonts/SimpleFontData.h" | 9 #include "platform/fonts/SimpleFontData.h" |
10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" | 10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 ASSERT(offsetForWord >= 0); | 481 ASSERT(offsetForWord >= 0); |
482 totalOffset += offsetForWord; | 482 totalOffset += offsetForWord; |
483 if (targetX >= 0 && targetX <= wordResult->width()) | 483 if (targetX >= 0 && targetX <= wordResult->width()) |
484 return totalOffset; | 484 return totalOffset; |
485 targetX -= wordResult->width(); | 485 targetX -= wordResult->width(); |
486 } | 486 } |
487 } | 487 } |
488 return totalOffset; | 488 return totalOffset; |
489 } | 489 } |
490 | 490 |
| 491 Vector<std::tuple<SimpleFontData*, size_t>> |
| 492 ShapeResultBuffer::getRunFontData() const { |
| 493 Vector<std::tuple<SimpleFontData*, size_t>> fontData; |
| 494 |
| 495 for (const auto& result : m_results) { |
| 496 for (const auto& run : result->m_runs) { |
| 497 fontData.push_back(std::make_tuple(run->m_fontData.get(), |
| 498 run->m_glyphData.size())); |
| 499 } |
| 500 } |
| 501 return fontData; |
| 502 } |
| 503 |
491 } // namespace blink | 504 } // namespace blink |
OLD | NEW |