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

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

Issue 2007103003: Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove bad assert. 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 03061771718e5aa5ae888cf779b5635b679d82b4..d6821c8a9af1d76af297134ef62705fe55590dd1 100644
--- a/third_party/WebKit/Source/platform/text/TextRun.h
+++ b/third_party/WebKit/Source/platform/text/TextRun.h
@@ -32,6 +32,7 @@
#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;
@@ -101,33 +102,6 @@ public:
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)
: m_charactersLength(string.length())
, m_len(string.length())

Powered by Google App Engine
This is Rietveld 408576698