| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ShapingLineBreaker.h" | 5 #include "platform/fonts/shaping/ShapingLineBreaker.h" |
| 6 | 6 |
| 7 #include <unicode/uscript.h> | 7 #include <unicode/uscript.h> |
| 8 #include "platform/fonts/Font.h" | 8 #include "platform/fonts/Font.h" |
| 9 #include "platform/fonts/FontCache.h" | 9 #include "platform/fonts/FontCache.h" |
| 10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" | 10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 TextDirection direction = TextDirection::kLtr; | 236 TextDirection direction = TextDirection::kLtr; |
| 237 | 237 |
| 238 HarfBuzzShaper shaper(string.Characters16(), string.length()); | 238 HarfBuzzShaper shaper(string.Characters16(), string.length()); |
| 239 RefPtr<ShapeResult> result = shaper.Shape(&font, direction, 0, 2); | 239 RefPtr<ShapeResult> result = shaper.Shape(&font, direction, 0, 2); |
| 240 | 240 |
| 241 ShapingLineBreaker breaker(&shaper, &font, result.Get(), &break_iterator); | 241 ShapingLineBreaker breaker(&shaper, &font, result.Get(), &break_iterator); |
| 242 RefPtr<ShapeResult> line; | 242 RefPtr<ShapeResult> line; |
| 243 unsigned break_offset = 0; | 243 unsigned break_offset = 0; |
| 244 | 244 |
| 245 line = breaker.ShapeLine(0, LayoutUnit::Max(), &break_offset); | 245 line = breaker.ShapeLine(0, LayoutUnit::Max(), &break_offset); |
| 246 EXPECT_EQ(3u, break_offset); | 246 EXPECT_EQ(2u, break_offset); |
| 247 EXPECT_EQ(result->Width(), line->Width()); | 247 EXPECT_EQ(result->Width(), line->Width()); |
| 248 } | 248 } |
| 249 } // namespace blink | 249 } // namespace blink |
| OLD | NEW |