| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #ifndef SVGTextLayoutEngine_h | 20 #ifndef SVGTextLayoutEngine_h |
| 21 #define SVGTextLayoutEngine_h | 21 #define SVGTextLayoutEngine_h |
| 22 | 22 |
| 23 #include "core/layout/svg/LayoutSVGInlineText.h" | 23 #include "core/layout/svg/LayoutSVGInlineText.h" |
| 24 #include "core/layout/svg/SVGTextFragment.h" | 24 #include "core/layout/svg/SVGTextFragment.h" |
| 25 #include "core/layout/svg/SVGTextLayoutAttributes.h" | 25 #include "core/layout/svg/SVGTextLayoutAttributes.h" |
| 26 #include "core/layout/svg/SVGTextMetrics.h" | 26 #include "core/layout/svg/SVGTextMetrics.h" |
| 27 #include "platform/graphics/Path.h" | 27 #include "platform/graphics/Path.h" |
| 28 #include "wtf/Allocator.h" |
| 28 #include "wtf/Vector.h" | 29 #include "wtf/Vector.h" |
| 29 | 30 |
| 30 namespace blink { | 31 namespace blink { |
| 31 | 32 |
| 32 class ComputedStyle; | 33 class ComputedStyle; |
| 33 class InlineFlowBox; | 34 class InlineFlowBox; |
| 34 class LayoutObject; | 35 class LayoutObject; |
| 35 class SVGInlineFlowBox; | 36 class SVGInlineFlowBox; |
| 36 class SVGInlineTextBox; | 37 class SVGInlineTextBox; |
| 37 | 38 |
| 38 // SVGTextLayoutEngine performs the second layout phase for SVG text. | 39 // SVGTextLayoutEngine performs the second layout phase for SVG text. |
| 39 // | 40 // |
| 40 // The InlineBox tree was created, containing the text chunk information, necess
ary to apply | 41 // The InlineBox tree was created, containing the text chunk information, necess
ary to apply |
| 41 // certain SVG specific text layout properties (text-length adjustments and text
-anchor). | 42 // certain SVG specific text layout properties (text-length adjustments and text
-anchor). |
| 42 // The second layout phase uses the SVGTextLayoutAttributes stored in the indivi
dual | 43 // The second layout phase uses the SVGTextLayoutAttributes stored in the indivi
dual |
| 43 // LayoutSVGInlineText layoutObjects to compute the final positions for each cha
racter | 44 // LayoutSVGInlineText layoutObjects to compute the final positions for each cha
racter |
| 44 // which are stored in the SVGInlineTextBox objects. | 45 // which are stored in the SVGInlineTextBox objects. |
| 45 | 46 |
| 46 class SVGTextLayoutEngine { | 47 class SVGTextLayoutEngine { |
| 48 STACK_ALLOCATED(); |
| 47 WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngine); | 49 WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngine); |
| 48 public: | 50 public: |
| 49 SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes*>&); | 51 SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes*>&); |
| 50 | 52 |
| 51 Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttrib
utes; } | 53 Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttrib
utes; } |
| 52 | 54 |
| 53 void layoutCharactersInTextBoxes(InlineFlowBox* start); | 55 void layoutCharactersInTextBoxes(InlineFlowBox* start); |
| 54 void finishLayout(); | 56 void finishLayout(); |
| 55 | 57 |
| 56 private: | 58 private: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 float m_textPathLength; | 95 float m_textPathLength; |
| 94 float m_textPathStartOffset; | 96 float m_textPathStartOffset; |
| 95 float m_textPathCurrentOffset; | 97 float m_textPathCurrentOffset; |
| 96 float m_textPathSpacing; | 98 float m_textPathSpacing; |
| 97 float m_textPathScaling; | 99 float m_textPathScaling; |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 } // namespace blink | 102 } // namespace blink |
| 101 | 103 |
| 102 #endif | 104 #endif |
| OLD | NEW |