OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 const LChar* characters8() const { | 176 const LChar* characters8() const { |
177 ASSERT(is8Bit()); | 177 ASSERT(is8Bit()); |
178 return m_data.characters8; | 178 return m_data.characters8; |
179 } | 179 } |
180 const UChar* characters16() const { | 180 const UChar* characters16() const { |
181 ASSERT(!is8Bit()); | 181 ASSERT(!is8Bit()); |
182 return m_data.characters16; | 182 return m_data.characters16; |
183 } | 183 } |
184 | 184 |
| 185 UChar32 codepointAt(unsigned i) const { |
| 186 if (is8Bit()) |
| 187 return (*this)[i]; |
| 188 UChar32 codepoint; |
| 189 SECURITY_DCHECK(i < m_len); |
| 190 U16_GET(characters16(), 0, i, m_len, codepoint); |
| 191 return codepoint; |
| 192 } |
| 193 |
185 UChar32 codepointAtAndNext(unsigned& i) const { | 194 UChar32 codepointAtAndNext(unsigned& i) const { |
186 if (is8Bit()) | 195 if (is8Bit()) |
187 return (*this)[i++]; | 196 return (*this)[i++]; |
188 UChar32 codepoint; | 197 UChar32 codepoint; |
189 SECURITY_DCHECK(i < m_len); | 198 SECURITY_DCHECK(i < m_len); |
190 U16_NEXT(characters16(), i, m_len, codepoint); | 199 U16_NEXT(characters16(), i, m_len, codepoint); |
191 return codepoint; | 200 return codepoint; |
192 } | 201 } |
193 | 202 |
194 bool is8Bit() const { return m_is8Bit; } | 203 bool is8Bit() const { return m_is8Bit; } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 318 |
310 const TextRun& run; | 319 const TextRun& run; |
311 unsigned from; | 320 unsigned from; |
312 unsigned to; | 321 unsigned to; |
313 FloatRect bounds; | 322 FloatRect bounds; |
314 sk_sp<SkTextBlob>* cachedTextBlob; | 323 sk_sp<SkTextBlob>* cachedTextBlob; |
315 }; | 324 }; |
316 | 325 |
317 } // namespace blink | 326 } // namespace blink |
318 #endif | 327 #endif |
OLD | NEW |