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 SVGTextLayoutAttributesBuilder_h | 20 #ifndef SVGTextLayoutAttributesBuilder_h |
21 #define SVGTextLayoutAttributesBuilder_h | 21 #define SVGTextLayoutAttributesBuilder_h |
22 | 22 |
23 #include "core/layout/svg/SVGTextLayoutAttributes.h" | 23 #include "core/layout/svg/SVGTextLayoutAttributes.h" |
24 #include "platform/heap/Handle.h" | 24 #include "platform/heap/Handle.h" |
| 25 #include "wtf/Allocator.h" |
25 #include "wtf/Vector.h" | 26 #include "wtf/Vector.h" |
26 #include "wtf/text/Unicode.h" | 27 #include "wtf/text/Unicode.h" |
27 | 28 |
28 namespace blink { | 29 namespace blink { |
29 | 30 |
30 class LayoutBoxModelObject; | 31 class LayoutBoxModelObject; |
31 class LayoutSVGInlineText; | 32 class LayoutSVGInlineText; |
32 class LayoutSVGText; | 33 class LayoutSVGText; |
33 class SVGTextPositioningElement; | 34 class SVGTextPositioningElement; |
34 | 35 |
35 // SVGTextLayoutAttributesBuilder performs the first layout phase for SVG text. | 36 // SVGTextLayoutAttributesBuilder performs the first layout phase for SVG text. |
36 // | 37 // |
37 // It extracts the x/y/dx/dy/rotate values from the SVGTextPositioningElements i
n the DOM. | 38 // It extracts the x/y/dx/dy/rotate values from the SVGTextPositioningElements i
n the DOM. |
38 // These values are propagated to the corresponding LayoutSVGInlineText layoutOb
jects. | 39 // These values are propagated to the corresponding LayoutSVGInlineText layoutOb
jects. |
39 // The first layout phase only extracts the relevant information needed in Layou
tBlockFlowLine | 40 // The first layout phase only extracts the relevant information needed in Layou
tBlockFlowLine |
40 // to create the InlineBox tree based on text chunk boundaries & BiDi informatio
n. | 41 // to create the InlineBox tree based on text chunk boundaries & BiDi informatio
n. |
41 // The second layout phase is carried out by SVGTextLayoutEngine. | 42 // The second layout phase is carried out by SVGTextLayoutEngine. |
42 | 43 |
43 class SVGTextLayoutAttributesBuilder { | 44 class SVGTextLayoutAttributesBuilder { |
| 45 DISALLOW_ALLOCATION(); |
44 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributesBuilder); | 46 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributesBuilder); |
45 public: | 47 public: |
46 SVGTextLayoutAttributesBuilder(); | 48 SVGTextLayoutAttributesBuilder(); |
47 bool buildLayoutAttributesForForSubtree(LayoutSVGText&); | 49 bool buildLayoutAttributesForForSubtree(LayoutSVGText&); |
48 void buildLayoutAttributesForText(LayoutSVGInlineText*); | 50 void buildLayoutAttributesForText(LayoutSVGInlineText*); |
49 | 51 |
50 void rebuildMetricsForTextLayoutObject(LayoutSVGInlineText*); | 52 void rebuildMetricsForTextLayoutObject(LayoutSVGInlineText*); |
51 | 53 |
52 // Invoked whenever the underlying DOM tree changes, so that m_textPositions
is rebuild. | 54 // Invoked whenever the underlying DOM tree changes, so that m_textPositions
is rebuild. |
53 void clearTextPositioningElements() { m_textPositions.clear(); } | 55 void clearTextPositioningElements() { m_textPositions.clear(); } |
(...skipping 25 matching lines...) Expand all Loading... |
79 unsigned m_textLength; | 81 unsigned m_textLength; |
80 WillBePersistentHeapVector<TextPosition> m_textPositions; | 82 WillBePersistentHeapVector<TextPosition> m_textPositions; |
81 SVGCharacterDataMap m_characterDataMap; | 83 SVGCharacterDataMap m_characterDataMap; |
82 }; | 84 }; |
83 | 85 |
84 } // namespace blink | 86 } // namespace blink |
85 | 87 |
86 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder
::TextPosition); | 88 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder
::TextPosition); |
87 | 89 |
88 #endif | 90 #endif |
OLD | NEW |