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

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

Issue 2025503002: Revert of Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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)

Powered by Google App Engine
This is Rietveld 408576698