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

Unified Diff: third_party/WebKit/Source/platform/text/TextRun.h

Issue 2263083002: Refactor CachingWordShapeIterator::nextWordEndIndex (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment editorial Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/text/TextRun.h
diff --git a/third_party/WebKit/Source/platform/text/TextRun.h b/third_party/WebKit/Source/platform/text/TextRun.h
index bcf4105c2dce30259ff664fe8ec347c2d56817a8..9da5d7474495bebb5b4dc5f6d4ad438c09f857c5 100644
--- a/third_party/WebKit/Source/platform/text/TextRun.h
+++ b/third_party/WebKit/Source/platform/text/TextRun.h
@@ -35,6 +35,8 @@
#include "wtf/text/StringView.h"
#include "wtf/text/WTFString.h"
+#include <unicode/utf16.h>
+
class SkTextBlob;
namespace blink {
@@ -150,6 +152,16 @@ public:
const LChar* characters8() const { ASSERT(is8Bit()); return m_data.characters8; }
const UChar* characters16() const { ASSERT(!is8Bit()); return m_data.characters16; }
+ UChar32 codepointAtAndNext(unsigned& i) const
+ {
+ if (is8Bit())
+ return (*this)[i++];
+ UChar32 codepoint;
+ SECURITY_DCHECK(i < m_len);
+ U16_NEXT(characters16(), i, m_len, codepoint);
+ return codepoint;
+ }
+
bool is8Bit() const { return m_is8Bit; }
unsigned length() const { return m_len; }
unsigned charactersLength() const { return m_charactersLength; }
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698