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 a482a3c393165ae55ee2a9c2374182fc6bb15e9c..fd194049e0accf6b5d783fc62e546cc0e79fae06 100644 |
--- a/third_party/WebKit/Source/platform/text/TextRun.h |
+++ b/third_party/WebKit/Source/platform/text/TextRun.h |
@@ -32,7 +32,6 @@ |
#include "platform/text/TextDirection.h" |
#include "platform/text/TextPath.h" |
#include "wtf/Allocator.h" |
-#include "wtf/text/StringView.h" |
#include "wtf/text/WTFString.h" |
class SkTextBlob; |
@@ -100,6 +99,33 @@ |
, m_tabSize(0) |
{ |
m_data.characters16 = c; |
+ } |
+ |
+ TextRun(const String& string, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false) |
+ : m_charactersLength(string.length()) |
+ , m_len(string.length()) |
+ , m_xpos(xpos) |
+ , m_horizontalGlyphStretch(1) |
+ , m_expansion(expansion) |
+ , m_expansionBehavior(expansionBehavior) |
+ , m_allowTabs(false) |
+ , m_direction(direction) |
+ , m_directionalOverride(directionalOverride) |
+ , m_disableSpacing(false) |
+ , m_textJustify(TextJustifyAuto) |
+ , m_normalizeSpace(false) |
+ , m_tabSize(0) |
+ { |
+ if (!m_charactersLength) { |
+ m_is8Bit = true; |
+ m_data.characters8 = 0; |
+ } else if (string.is8Bit()) { |
+ m_data.characters8 = string.characters8(); |
+ m_is8Bit = true; |
+ } else { |
+ m_data.characters16 = string.characters16(); |
+ m_is8Bit = false; |
+ } |
} |
TextRun(const StringView& string, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false) |