RenderSVGResourcePattern should deal in RenderElement&.
[WebKit-https.git] / Source / WebCore / rendering / svg / SVGTextLayoutEngine.h
index 0e32101..4b8793a 100644 (file)
 #ifndef SVGTextLayoutEngine_h
 #define SVGTextLayoutEngine_h
 
-#if ENABLE(SVG)
 #include "Path.h"
 #include "SVGTextChunkBuilder.h"
 #include "SVGTextFragment.h"
 #include "SVGTextLayoutAttributes.h"
-#include "SVGTextMetrics.h"
-#include <wtf/Vector.h>
 
 namespace WebCore {
 
@@ -48,7 +45,9 @@ class SVGRenderStyle;
 class SVGTextLayoutEngine {
     WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngine);
 public:
-    SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes>&);
+    SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes*>&);
+
+    Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttributes; }
     SVGTextChunkBuilder& chunkLayoutBuilder() { return m_chunkLayoutBuilder; }
 
     void beginTextPathLayout(RenderObject*, SVGTextLayoutEngine& lineLayout);
@@ -57,33 +56,33 @@ public:
     void layoutInlineTextBox(SVGInlineTextBox*);
     void finishLayout();
 
-    Vector<SVGTextLayoutAttributes>& layoutAttributes() { return m_layoutAttributes; }
-
 private:
     void updateCharacerPositionIfNeeded(float& x, float& y);
     void updateCurrentTextPosition(float x, float y, float glyphAdvance);
     void updateRelativePositionAdjustmentsIfNeeded(float dx, float dy);
 
-    void recordTextFragment(SVGInlineTextBox*, Vector<SVGTextMetrics>& textMetricValues);
+    void recordTextFragment(SVGInlineTextBox*, Vector<SVGTextMetrics>&);
     bool parentDefinesTextLength(RenderObject*) const;
 
     void layoutTextOnLineOrPath(SVGInlineTextBox*, RenderSVGInlineText*, const RenderStyle*);
     void finalizeTransformMatrices(Vector<SVGInlineTextBox*>&);
 
-    bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes&);
-    bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes&, SVGTextMetrics&);
-    bool currentVisualCharacterMetrics(SVGInlineTextBox*, RenderSVGInlineText*, SVGTextMetrics&);
+    bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&);
+    bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&, SVGTextMetrics&);
+    bool currentVisualCharacterMetrics(SVGInlineTextBox*, Vector<SVGTextMetrics>&, SVGTextMetrics&);
 
     void advanceToNextLogicalCharacter(const SVGTextMetrics&);
     void advanceToNextVisualCharacter(const SVGTextMetrics&);
 
 private:
-    Vector<SVGTextLayoutAttributes> m_layoutAttributes;
+    Vector<SVGTextLayoutAttributes*>& m_layoutAttributes;
+
     Vector<SVGInlineTextBox*> m_lineLayoutBoxes;
     Vector<SVGInlineTextBox*> m_pathLayoutBoxes;
     SVGTextChunkBuilder m_chunkLayoutBuilder;
 
     SVGTextFragment m_currentTextFragment;
+    unsigned m_layoutAttributesPosition;
     unsigned m_logicalCharacterOffset;
     unsigned m_logicalMetricsListOffset;
     unsigned m_visualCharacterOffset;
@@ -106,5 +105,4 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(SVG)
 #endif