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

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

Issue 433923003: Revert BidiResolver::createBidiRunsForLine changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « Source/core/rendering/line/LineBreaker.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGTextMetricsBuilder.cpp
diff --git a/Source/core/rendering/svg/SVGTextMetricsBuilder.cpp b/Source/core/rendering/svg/SVGTextMetricsBuilder.cpp
index 2889c76c0de26e7b2c56491f19964c5463dbf574..be2daef7f40bff4faf3881d27355e95c94fa4dd2 100644
--- a/Source/core/rendering/svg/SVGTextMetricsBuilder.cpp
+++ b/Source/core/rendering/svg/SVGTextMetricsBuilder.cpp
@@ -40,6 +40,7 @@ namespace blink {
class SVGTextMetricsCalculator {
public:
SVGTextMetricsCalculator(RenderSVGInlineText*);
+ ~SVGTextMetricsCalculator();
SVGTextMetrics computeMetricsForCharacter(unsigned textPosition);
unsigned textLength() const { return static_cast<unsigned>(m_run.charactersLength()); }
@@ -62,7 +63,6 @@ private:
BidiCharacterRun* m_bidiRun;
TextRun m_run;
BidiResolver<TextRunIterator, BidiCharacterRun> m_bidiResolver;
- BidiRunList<BidiCharacterRun> m_bidiRuns;
bool m_isComplexText;
float m_totalWidth;
TextDirection m_textDirection;
@@ -89,6 +89,12 @@ SVGTextMetricsCalculator::SVGTextMetricsCalculator(RenderSVGInlineText* text)
setupBidiRuns();
}
+SVGTextMetricsCalculator::~SVGTextMetricsCalculator()
+{
+ if (m_bidiRun)
+ m_bidiResolver.runs().deleteRuns();
+}
+
void SVGTextMetricsCalculator::setupBidiRuns()
{
RenderStyle* style = m_text->style();
@@ -102,8 +108,9 @@ void SVGTextMetricsCalculator::setupBidiRuns()
m_bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&m_run, 0));
const bool hardLineBreak = false;
const bool reorderRuns = false;
- m_bidiResolver.createBidiRunsForLine(TextRunIterator(&m_run, m_run.length()), m_bidiRuns, NoVisualOverride, hardLineBreak, reorderRuns);
- m_bidiRun = m_bidiRuns.firstRun();
+ m_bidiResolver.createBidiRunsForLine(TextRunIterator(&m_run, m_run.length()), NoVisualOverride, hardLineBreak, reorderRuns);
+ BidiRunList<BidiCharacterRun>& bidiRuns = m_bidiResolver.runs();
+ m_bidiRun = bidiRuns.firstRun();
}
SVGTextMetrics SVGTextMetricsCalculator::computeMetricsForCharacterSimple(unsigned textPosition)
« no previous file with comments | « Source/core/rendering/line/LineBreaker.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698