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 "CaseMappingHarfBuzzBufferFiller.h" | 5 #include "CaseMappingHarfBuzzBufferFiller.h" |
6 | 6 |
7 #include "platform/wtf/text/WTFString.h" | 7 #include "platform/wtf/text/WTFString.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 } else { | 36 } else { |
37 case_mapped_text = String(buffer, buffer_length).LowerUnicode(locale); | 37 case_mapped_text = String(buffer, buffer_length).LowerUnicode(locale); |
38 } | 38 } |
39 | 39 |
40 if (case_mapped_text.length() != buffer_length) { | 40 if (case_mapped_text.length() != buffer_length) { |
41 FillSlowCase(case_map_intend, locale, buffer, buffer_length, start_index, | 41 FillSlowCase(case_map_intend, locale, buffer, buffer_length, start_index, |
42 num_characters); | 42 num_characters); |
43 return; | 43 return; |
44 } | 44 } |
45 | 45 |
46 ASSERT(case_mapped_text.length() == buffer_length); | 46 DCHECK_EQ(case_mapped_text.length(), buffer_length); |
47 ASSERT(!case_mapped_text.Is8Bit()); | 47 DCHECK(!case_mapped_text.Is8Bit()); |
48 hb_buffer_add_utf16(harf_buzz_buffer_, | 48 hb_buffer_add_utf16(harf_buzz_buffer_, |
49 ToUint16(case_mapped_text.Characters16()), | 49 ToUint16(case_mapped_text.Characters16()), |
50 buffer_length, start_index, num_characters); | 50 buffer_length, start_index, num_characters); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 // TODO(drott): crbug.com/623940 Fix lack of context sensitive case mapping | 54 // TODO(drott): crbug.com/623940 Fix lack of context sensitive case mapping |
55 // here. | 55 // here. |
56 void CaseMappingHarfBuzzBufferFiller::FillSlowCase( | 56 void CaseMappingHarfBuzzBufferFiller::FillSlowCase( |
57 CaseMapIntend case_map_intend, | 57 CaseMapIntend case_map_intend, |
(...skipping 27 matching lines...) Expand all Loading... |
85 } | 85 } |
86 char_index = new_char_index; | 86 char_index = new_char_index; |
87 } | 87 } |
88 | 88 |
89 // Record post-context | 89 // Record post-context |
90 hb_buffer_add_utf16(harf_buzz_buffer_, ToUint16(buffer), buffer_length, | 90 hb_buffer_add_utf16(harf_buzz_buffer_, ToUint16(buffer), buffer_length, |
91 start_index + num_characters, 0); | 91 start_index + num_characters, 0); |
92 } | 92 } |
93 | 93 |
94 } // namespace blink | 94 } // namespace blink |
OLD | NEW |