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

Unified Diff: Source/platform/fonts/Font.cpp

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 code and adding Layout test case 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
Index: Source/platform/fonts/Font.cpp
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp
index 6131fb8db99034c5646e5442e974072b97daeee9..9cfc4d3b057cf9a9dfc25672668dc125984a37fd 100644
--- a/Source/platform/fonts/Font.cpp
+++ b/Source/platform/fonts/Font.cpp
@@ -391,7 +391,7 @@ static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForNonCJKCharacte
return std::make_pair(data, page);
}
-std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const
+std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32& c, bool mirror, bool spaceNormalize, FontDataVariant variant) const
{
ASSERT(isMainThread());
@@ -409,6 +409,9 @@ std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, b
}
}
+ if (spaceNormalize && Character::isNormalizedCanvasSpaceCharacter(c))
+ c = space;
+
if (mirror)
c = mirroredChar(c);
@@ -566,7 +569,7 @@ bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphDa
character = U16_GET_SUPPLEMENTARY(character, low);
}
- glyphData = glyphDataForCharacter(character, false, EmphasisMarkVariant);
+ glyphData = glyphDataForCharacter(character, false, false, EmphasisMarkVariant);
eae 2014/09/16 00:46:33 bool normalizeSpace = false; glyphData = glyphDat
h.joshi 2014/09/16 05:48:11 Done.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698