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

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

Issue 567543002: Avoid re-parsing of string in fillText and measureText in Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating test expectation file Created 6 years, 3 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 | « Source/platform/fonts/mac/FontComplexTextMac.cpp ('k') | Source/platform/text/TextRun.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/text/TextRun.h
diff --git a/Source/platform/text/TextRun.h b/Source/platform/text/TextRun.h
index d5f6be43cf44bf269d5c09084f216684d87fb4bd..7eee89c1201811875d23a18cfd7d6766c767931d 100644
--- a/Source/platform/text/TextRun.h
+++ b/Source/platform/text/TextRun.h
@@ -68,6 +68,7 @@ public:
, m_characterScanForCodePath(characterScanForCodePath)
, m_disableSpacing(false)
, m_tabSize(0)
+ , m_normalizeSpace(false)
{
m_data.characters8 = c;
}
@@ -86,11 +87,12 @@ public:
, m_characterScanForCodePath(characterScanForCodePath)
, m_disableSpacing(false)
, m_tabSize(0)
+ , m_normalizeSpace(false)
{
m_data.characters16 = c;
}
- TextRun(const String& string, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true)
+ TextRun(const String& string, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, bool normalizeSpace = false)
: m_charactersLength(string.length())
, m_len(string.length())
, m_xpos(xpos)
@@ -103,6 +105,7 @@ public:
, m_characterScanForCodePath(characterScanForCodePath)
, m_disableSpacing(false)
, m_tabSize(0)
+ , m_normalizeSpace(normalizeSpace)
{
if (!m_charactersLength) {
m_is8Bit = true;
@@ -116,7 +119,7 @@ public:
}
}
- TextRun(const StringView& string, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true)
+ TextRun(const StringView& string, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, bool normalizeSpace = false)
: m_charactersLength(string.length())
, m_len(string.length())
, m_xpos(xpos)
@@ -129,6 +132,7 @@ public:
, m_characterScanForCodePath(characterScanForCodePath)
, m_disableSpacing(false)
, m_tabSize(0)
+ , m_normalizeSpace(normalizeSpace)
{
if (!m_charactersLength) {
m_is8Bit = true;
@@ -167,6 +171,9 @@ public:
int length() const { return m_len; }
int charactersLength() const { return m_charactersLength; }
+ bool normalizeSpace() const { return m_normalizeSpace; }
+ void setNormalizeSpace(bool normalizeSpace) { m_normalizeSpace = normalizeSpace; }
+
void setText(const LChar* c, unsigned len) { m_data.characters8 = c; m_len = len; m_is8Bit = true;}
void setText(const UChar* c, unsigned len) { m_data.characters16 = c; m_len = len; m_is8Bit = false;}
void setText(const String&);
@@ -231,6 +238,7 @@ private:
unsigned m_characterScanForCodePath : 1;
unsigned m_disableSpacing : 1;
unsigned m_tabSize;
+ bool m_normalizeSpace;
RefPtr<RenderingContext> m_renderingContext;
};
« no previous file with comments | « Source/platform/fonts/mac/FontComplexTextMac.cpp ('k') | Source/platform/text/TextRun.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698