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

Side by Side Diff: Source/core/rendering/svg/SVGTextMetricsBuilder.cpp

Issue 421463002: Have BidiRunList destructor delete runs (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderText.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 22 matching lines...) Expand all
33 #include "platform/text/TextPath.h" 33 #include "platform/text/TextPath.h"
34 #include "platform/text/TextRun.h" 34 #include "platform/text/TextRun.h"
35 #include "platform/text/TextRunIterator.h" 35 #include "platform/text/TextRunIterator.h"
36 #include "wtf/Vector.h" 36 #include "wtf/Vector.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 class SVGTextMetricsCalculator { 40 class SVGTextMetricsCalculator {
41 public: 41 public:
42 SVGTextMetricsCalculator(RenderSVGInlineText*); 42 SVGTextMetricsCalculator(RenderSVGInlineText*);
43 ~SVGTextMetricsCalculator(); 43 ~SVGTextMetricsCalculator() { }
leviw_travelin_and_unemployed 2014/07/28 20:34:17 Can this just be removed?
44 44
45 SVGTextMetrics computeMetricsForCharacter(unsigned textPosition); 45 SVGTextMetrics computeMetricsForCharacter(unsigned textPosition);
46 unsigned textLength() const { return static_cast<unsigned>(m_run.charactersL ength()); } 46 unsigned textLength() const { return static_cast<unsigned>(m_run.charactersL ength()); }
47 47
48 bool characterStartsSurrogatePair(unsigned textPosition) const 48 bool characterStartsSurrogatePair(unsigned textPosition) const
49 { 49 {
50 return U16_IS_LEAD(m_run[textPosition]) && textPosition + 1 < textLength () && U16_IS_TRAIL(m_run[textPosition + 1]); 50 return U16_IS_LEAD(m_run[textPosition]) && textPosition + 1 < textLength () && U16_IS_TRAIL(m_run[textPosition + 1]);
51 } 51 }
52 bool characterIsWhiteSpace(unsigned textPosition) const 52 bool characterIsWhiteSpace(unsigned textPosition) const
53 { 53 {
(...skipping 29 matching lines...) Expand all
83 CodePath codePath = scaledFont.codePath(m_run); 83 CodePath codePath = scaledFont.codePath(m_run);
84 m_isComplexText = codePath == ComplexPath; 84 m_isComplexText = codePath == ComplexPath;
85 m_run.setCharacterScanForCodePath(!m_isComplexText); 85 m_run.setCharacterScanForCodePath(!m_isComplexText);
86 86
87 if (!m_isComplexText) 87 if (!m_isComplexText)
88 m_simpleWidthIterator = adoptPtr(new WidthIterator(&scaledFont, m_run)); 88 m_simpleWidthIterator = adoptPtr(new WidthIterator(&scaledFont, m_run));
89 else 89 else
90 setupBidiRuns(); 90 setupBidiRuns();
91 } 91 }
92 92
93 SVGTextMetricsCalculator::~SVGTextMetricsCalculator()
94 {
95 m_bidiRuns.deleteRuns();
96 }
97
98 void SVGTextMetricsCalculator::setupBidiRuns() 93 void SVGTextMetricsCalculator::setupBidiRuns()
99 { 94 {
100 RenderStyle* style = m_text->style(); 95 RenderStyle* style = m_text->style();
101 m_textDirection = style->direction(); 96 m_textDirection = style->direction();
102 if (isOverride(style->unicodeBidi())) 97 if (isOverride(style->unicodeBidi()))
103 return; 98 return;
104 99
105 BidiStatus status(LTR, false); 100 BidiStatus status(LTR, false);
106 status.last = status.lastStrong = WTF::Unicode::OtherNeutral; 101 status.last = status.lastStrong = WTF::Unicode::OtherNeutral;
107 m_bidiResolver.setStatus(status); 102 m_bidiResolver.setStatus(status);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 263 }
269 264
270 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) 265 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap)
271 { 266 {
272 ASSERT(textRoot); 267 ASSERT(textRoot);
273 MeasureTextData data(&allCharactersMap); 268 MeasureTextData data(&allCharactersMap);
274 walkTree(textRoot, stopAtLeaf, &data); 269 walkTree(textRoot, stopAtLeaf, &data);
275 } 270 }
276 271
277 } 272 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderText.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698