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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 TextDirection direction) { | 89 TextDirection direction) { |
90 return constructTextRunInternal(font, characters, length, style, direction); | 90 return constructTextRunInternal(font, characters, length, style, direction); |
91 } | 91 } |
92 | 92 |
93 TextRun constructTextRun(const Font& font, | 93 TextRun constructTextRun(const Font& font, |
94 const LayoutText* text, | 94 const LayoutText* text, |
95 unsigned offset, | 95 unsigned offset, |
96 unsigned length, | 96 unsigned length, |
97 const ComputedStyle& style, | 97 const ComputedStyle& style, |
98 TextDirection direction) { | 98 TextDirection direction) { |
99 ASSERT(offset + length <= text->textLength()); | 99 DCHECK_LE(offset + length, text->textLength()); |
100 if (text->hasEmptyText()) | 100 if (text->hasEmptyText()) |
101 return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0, | 101 return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0, |
102 style, direction); | 102 style, direction); |
103 if (text->is8Bit()) | 103 if (text->is8Bit()) |
104 return constructTextRunInternal(font, text->characters8() + offset, length, | 104 return constructTextRunInternal(font, text->characters8() + offset, length, |
105 style, direction); | 105 style, direction); |
106 return constructTextRunInternal(font, text->characters16() + offset, length, | 106 return constructTextRunInternal(font, text->characters16() + offset, length, |
107 style, direction); | 107 style, direction); |
108 } | 108 } |
109 | 109 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 style, TextDirection::kLtr); | 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::kLtr); | 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 |