OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return constructTextRunInternal(font, string.characters16(), length, style, | 122 return constructTextRunInternal(font, string.characters16(), length, style, |
123 direction, flags); | 123 direction, flags); |
124 } | 124 } |
125 | 125 |
126 TextRun constructTextRun(const Font& font, | 126 TextRun constructTextRun(const Font& font, |
127 const String& string, | 127 const String& string, |
128 const ComputedStyle& style, | 128 const ComputedStyle& style, |
129 TextRunFlags flags) { | 129 TextRunFlags flags) { |
130 return constructTextRun(font, string, style, | 130 return constructTextRun(font, string, style, |
131 string.isEmpty() || string.is8Bit() | 131 string.isEmpty() || string.is8Bit() |
132 ? TextDirection::Ltr | 132 ? TextDirection::kLtr |
133 : determineDirectionality(string), | 133 : determineDirectionality(string), |
134 flags); | 134 flags); |
135 } | 135 } |
136 | 136 |
137 TextRun constructTextRun(const Font& font, | 137 TextRun constructTextRun(const Font& font, |
138 const LineLayoutText text, | 138 const LineLayoutText text, |
139 unsigned offset, | 139 unsigned offset, |
140 unsigned length, | 140 unsigned length, |
141 const ComputedStyle& style) { | 141 const ComputedStyle& style) { |
142 ASSERT(offset + length <= text.textLength()); | 142 ASSERT(offset + length <= text.textLength()); |
143 if (text.hasEmptyText()) { | 143 if (text.hasEmptyText()) { |
144 return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0, | 144 return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0, |
145 style, TextDirection::Ltr); | 145 style, TextDirection::kLtr); |
146 } | 146 } |
147 if (text.is8Bit()) { | 147 if (text.is8Bit()) { |
148 return constructTextRunInternal(font, text.characters8() + offset, length, | 148 return constructTextRunInternal(font, text.characters8() + offset, length, |
149 style, TextDirection::Ltr); | 149 style, TextDirection::kLtr); |
150 } | 150 } |
151 | 151 |
152 TextRun run = constructTextRunInternal(font, text.characters16() + offset, | 152 TextRun run = constructTextRunInternal(font, text.characters16() + offset, |
153 length, style, TextDirection::Ltr); | 153 length, style, TextDirection::kLtr); |
154 run.setDirection(directionForRun(run)); | 154 run.setDirection(directionForRun(run)); |
155 return run; | 155 return run; |
156 } | 156 } |
157 | 157 |
158 } // namespace blink | 158 } // namespace blink |
OLD | NEW |