Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/UTF16TextIterator.cpp

Issue 1479003002: Remove Simple Text Path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Holger Hans Peter Freyther 4 * Copyright (C) 2008 Holger Hans Peter Freyther
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. 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 14 matching lines...) Expand all
25 25
26 using namespace WTF; 26 using namespace WTF;
27 using namespace Unicode; 27 using namespace Unicode;
28 28
29 namespace blink { 29 namespace blink {
30 30
31 UTF16TextIterator::UTF16TextIterator(const UChar* characters, int length) 31 UTF16TextIterator::UTF16TextIterator(const UChar* characters, int length)
32 : m_characters(characters), 32 : m_characters(characters),
33 m_charactersEnd(characters + length), 33 m_charactersEnd(characters + length),
34 m_offset(0), 34 m_offset(0),
35 m_endOffset(length), 35 m_length(length),
36 m_currentGlyphLength(0) {}
37
38 UTF16TextIterator::UTF16TextIterator(const UChar* characters,
39 int currentCharacter,
40 int endOffset,
41 int endCharacter)
42 : m_characters(characters),
43 m_charactersEnd(characters + (endCharacter - currentCharacter)),
44 m_offset(currentCharacter),
45 m_endOffset(endOffset),
46 m_currentGlyphLength(0) {} 36 m_currentGlyphLength(0) {}
47 37
48 bool UTF16TextIterator::isValidSurrogatePair(UChar32& character) { 38 bool UTF16TextIterator::isValidSurrogatePair(UChar32& character) {
49 // If we have a surrogate pair, make sure it starts with the high part. 39 // If we have a surrogate pair, make sure it starts with the high part.
50 if (!U16_IS_SURROGATE_LEAD(character)) 40 if (!U16_IS_SURROGATE_LEAD(character))
51 return false; 41 return false;
52 42
53 // Do we have a surrogate pair? If so, determine the full Unicode (32 bit) 43 // Do we have a surrogate pair? If so, determine the full Unicode (32 bit)
54 // code point before glyph lookup. 44 // code point before glyph lookup.
55 // Make sure we have another character and it's a low surrogate. 45 // Make sure we have another character and it's a low surrogate.
(...skipping 14 matching lines...) Expand all
70 return true; 60 return true;
71 } 61 }
72 62
73 UChar low = m_characters[1]; 63 UChar low = m_characters[1];
74 character = U16_GET_SUPPLEMENTARY(character, low); 64 character = U16_GET_SUPPLEMENTARY(character, low);
75 m_currentGlyphLength = 2; 65 m_currentGlyphLength = 2;
76 return true; 66 return true;
77 } 67 }
78 68
79 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698