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

Unified Diff: Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp

Issue 19520011: Remove the last SVG callers of bloatedCharacters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
diff --git a/Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp b/Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
index 9ea128143b5193c112dd9c3b363f91f14455ee2d..e7bb42b6c33cf14666b52bf4d71e096306662f5c 100644
--- a/Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -44,7 +44,7 @@ void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer(Render
m_characterDataMap.clear();
m_textLength = 0;
- const UChar* lastCharacter = 0;
+ UChar lastCharacter = ' ';
collectTextPositioningElements(textRoot, lastCharacter);
if (!m_textLength)
@@ -64,7 +64,7 @@ bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree(RenderSV
if (m_textPositions.isEmpty()) {
m_textLength = 0;
- const UChar* lastCharacter = 0;
+ UChar lastCharacter = ' ';
collectTextPositioningElements(textRoot, lastCharacter);
}
@@ -82,18 +82,17 @@ void SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer(RenderSVGInli
m_metricsBuilder.measureTextRenderer(text);
}
-static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigned& atCharacter, const UChar*& lastCharacter)
+static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigned& atCharacter, UChar& lastCharacter)
{
if (text->style()->whiteSpace() == PRE) {
atCharacter += text->textLength();
return;
}
- const UChar* characters = text->bloatedCharacters();
unsigned textLength = text->textLength();
for (unsigned textPosition = 0; textPosition < textLength; ++textPosition) {
- const UChar* currentCharacter = characters + textPosition;
- if (*currentCharacter == ' ' && (!lastCharacter || *lastCharacter == ' '))
+ UChar currentCharacter = text->characterAt(textPosition);
+ if (currentCharacter == ' ' && lastCharacter == ' ')
continue;
lastCharacter = currentCharacter;
@@ -101,7 +100,7 @@ static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigne
}
}
-void SVGTextLayoutAttributesBuilder::collectTextPositioningElements(RenderObject* start, const UChar*& lastCharacter)
+void SVGTextLayoutAttributesBuilder::collectTextPositioningElements(RenderObject* start, UChar& lastCharacter)
{
ASSERT(!start->isSVGText() || m_textPositions.isEmpty());
« no previous file with comments | « Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.h ('k') | Source/core/rendering/svg/SVGTextLayoutEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698