| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 float m_totalWidth; | 67 float m_totalWidth; |
| 68 TextDirection m_textDirection; | 68 TextDirection m_textDirection; |
| 69 | 69 |
| 70 // Simple text only. | 70 // Simple text only. |
| 71 OwnPtr<SimpleShaper> m_simpleShaper; | 71 OwnPtr<SimpleShaper> m_simpleShaper; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 SVGTextMetricsCalculator::SVGTextMetricsCalculator(LayoutSVGInlineText* text) | 74 SVGTextMetricsCalculator::SVGTextMetricsCalculator(LayoutSVGInlineText* text) |
| 75 : m_text(text) | 75 : m_text(text) |
| 76 , m_bidiRun(0) | 76 , m_bidiRun(0) |
| 77 , m_run(SVGTextMetrics::constructTextRun(text, 0, text->textLength())) | 77 , m_run(SVGTextMetrics::constructTextRun(text, 0, text->textLength(), text->
styleRef().direction())) |
| 78 , m_isComplexText(false) | 78 , m_isComplexText(false) |
| 79 , m_totalWidth(0) | 79 , m_totalWidth(0) |
| 80 { | 80 { |
| 81 const Font& scaledFont = text->scaledFont(); | 81 const Font& scaledFont = text->scaledFont(); |
| 82 CodePath codePath = scaledFont.codePath(TextRunPaintInfo(m_run)); | 82 CodePath codePath = scaledFont.codePath(TextRunPaintInfo(m_run)); |
| 83 m_isComplexText = codePath == ComplexPath; | 83 m_isComplexText = codePath == ComplexPath; |
| 84 m_run.setCodePath(m_isComplexText ? TextRun::ForceComplex : TextRun::ForceSi
mple); | 84 m_run.setCodePath(m_isComplexText ? TextRun::ForceComplex : TextRun::ForceSi
mple); |
| 85 | 85 |
| 86 if (!m_isComplexText) | 86 if (!m_isComplexText) |
| 87 m_simpleShaper = adoptPtr(new SimpleShaper(&scaledFont, m_run)); | 87 m_simpleShaper = adoptPtr(new SimpleShaper(&scaledFont, m_run)); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 268 } |
| 269 | 269 |
| 270 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(LayoutSVGText* textR
oot, LayoutSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) | 270 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(LayoutSVGText* textR
oot, LayoutSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) |
| 271 { | 271 { |
| 272 ASSERT(textRoot); | 272 ASSERT(textRoot); |
| 273 MeasureTextData data(&allCharactersMap); | 273 MeasureTextData data(&allCharactersMap); |
| 274 walkTree(textRoot, stopAtLeaf, &data); | 274 walkTree(textRoot, stopAtLeaf, &data); |
| 275 } | 275 } |
| 276 | 276 |
| 277 } | 277 } |
| OLD | NEW |