| 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 17 matching lines...) Expand all Loading... |
| 28 #include "platform/fonts/Glyph.h" | 28 #include "platform/fonts/Glyph.h" |
| 29 #include "platform/geometry/FloatRect.h" | 29 #include "platform/geometry/FloatRect.h" |
| 30 #include "platform/heap/Heap.h" | 30 #include "platform/heap/Heap.h" |
| 31 #include "platform/text/TabSize.h" | 31 #include "platform/text/TabSize.h" |
| 32 #include "platform/text/TextDirection.h" | 32 #include "platform/text/TextDirection.h" |
| 33 #include "platform/text/TextPath.h" | 33 #include "platform/text/TextPath.h" |
| 34 #include "wtf/Allocator.h" | 34 #include "wtf/Allocator.h" |
| 35 #include "wtf/text/StringView.h" | 35 #include "wtf/text/StringView.h" |
| 36 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 37 | 37 |
| 38 #include <unicode/utf16.h> |
| 39 |
| 38 class SkTextBlob; | 40 class SkTextBlob; |
| 39 | 41 |
| 40 namespace blink { | 42 namespace blink { |
| 41 | 43 |
| 42 enum TextJustify { | 44 enum TextJustify { |
| 43 TextJustifyAuto = 0x0, | 45 TextJustifyAuto = 0x0, |
| 44 TextJustifyNone = 0x1, | 46 TextJustifyNone = 0x1, |
| 45 TextJustifyInterWord = 0x2, | 47 TextJustifyInterWord = 0x2, |
| 46 TextJustifyDistribute = 0x3 | 48 TextJustifyDistribute = 0x3 |
| 47 }; | 49 }; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return result; | 145 return result; |
| 144 } | 146 } |
| 145 | 147 |
| 146 UChar operator[](unsigned i) const { ASSERT_WITH_SECURITY_IMPLICATION(i < m_
len); return is8Bit() ? m_data.characters8[i] :m_data.characters16[i]; } | 148 UChar operator[](unsigned i) const { ASSERT_WITH_SECURITY_IMPLICATION(i < m_
len); return is8Bit() ? m_data.characters8[i] :m_data.characters16[i]; } |
| 147 const LChar* data8(unsigned i) const { ASSERT_WITH_SECURITY_IMPLICATION(i <
m_len); ASSERT(is8Bit()); return &m_data.characters8[i]; } | 149 const LChar* data8(unsigned i) const { ASSERT_WITH_SECURITY_IMPLICATION(i <
m_len); ASSERT(is8Bit()); return &m_data.characters8[i]; } |
| 148 const UChar* data16(unsigned i) const { ASSERT_WITH_SECURITY_IMPLICATION(i <
m_len); ASSERT(!is8Bit()); return &m_data.characters16[i]; } | 150 const UChar* data16(unsigned i) const { ASSERT_WITH_SECURITY_IMPLICATION(i <
m_len); ASSERT(!is8Bit()); return &m_data.characters16[i]; } |
| 149 | 151 |
| 150 const LChar* characters8() const { ASSERT(is8Bit()); return m_data.character
s8; } | 152 const LChar* characters8() const { ASSERT(is8Bit()); return m_data.character
s8; } |
| 151 const UChar* characters16() const { ASSERT(!is8Bit()); return m_data.charact
ers16; } | 153 const UChar* characters16() const { ASSERT(!is8Bit()); return m_data.charact
ers16; } |
| 152 | 154 |
| 155 UChar32 codepointAtAndNext(unsigned& i) const |
| 156 { |
| 157 if (is8Bit()) |
| 158 return (*this)[i++]; |
| 159 UChar32 codepoint; |
| 160 SECURITY_DCHECK(i < m_len); |
| 161 U16_NEXT(characters16(), i, m_len, codepoint); |
| 162 return codepoint; |
| 163 } |
| 164 |
| 153 bool is8Bit() const { return m_is8Bit; } | 165 bool is8Bit() const { return m_is8Bit; } |
| 154 unsigned length() const { return m_len; } | 166 unsigned length() const { return m_len; } |
| 155 unsigned charactersLength() const { return m_charactersLength; } | 167 unsigned charactersLength() const { return m_charactersLength; } |
| 156 | 168 |
| 157 bool normalizeSpace() const { return m_normalizeSpace; } | 169 bool normalizeSpace() const { return m_normalizeSpace; } |
| 158 void setNormalizeSpace(bool normalizeSpace) { m_normalizeSpace = normalizeSp
ace; } | 170 void setNormalizeSpace(bool normalizeSpace) { m_normalizeSpace = normalizeSp
ace; } |
| 159 | 171 |
| 160 void setText(const LChar* c, unsigned len) { m_data.characters8 = c; m_len =
len; m_is8Bit = true;} | 172 void setText(const LChar* c, unsigned len) { m_data.characters8 = c; m_len =
len; m_is8Bit = true;} |
| 161 void setText(const UChar* c, unsigned len) { m_data.characters16 = c; m_len
= len; m_is8Bit = false;} | 173 void setText(const UChar* c, unsigned len) { m_data.characters16 = c; m_len
= len; m_is8Bit = false;} |
| 162 void setText(const String&); | 174 void setText(const String&); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 247 |
| 236 const TextRun& run; | 248 const TextRun& run; |
| 237 unsigned from; | 249 unsigned from; |
| 238 unsigned to; | 250 unsigned to; |
| 239 FloatRect bounds; | 251 FloatRect bounds; |
| 240 RefPtr<const SkTextBlob>* cachedTextBlob; | 252 RefPtr<const SkTextBlob>* cachedTextBlob; |
| 241 }; | 253 }; |
| 242 | 254 |
| 243 } // namespace blink | 255 } // namespace blink |
| 244 #endif | 256 #endif |
| OLD | NEW |