| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. 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 Loading... |
| 33 // Phase one built the layout information from the SVG DOM stored in the RenderS
VGInlineText objects (SVGTextLayoutAttributes). | 33 // Phase one built the layout information from the SVG DOM stored in the RenderS
VGInlineText objects (SVGTextLayoutAttributes). |
| 34 // Phase two performed the actual per-character layout, computing the final posi
tions for each character, stored in the SVGInlineTextBox objects (SVGTextFragmen
t). | 34 // Phase two performed the actual per-character layout, computing the final posi
tions for each character, stored in the SVGInlineTextBox objects (SVGTextFragmen
t). |
| 35 // Phase three performs all modifications that have to be applied to each indivi
dual text chunk (text-anchor & textLength). | 35 // Phase three performs all modifications that have to be applied to each indivi
dual text chunk (text-anchor & textLength). |
| 36 | 36 |
| 37 class SVGTextChunkBuilder { | 37 class SVGTextChunkBuilder { |
| 38 WTF_MAKE_NONCOPYABLE(SVGTextChunkBuilder); | 38 WTF_MAKE_NONCOPYABLE(SVGTextChunkBuilder); |
| 39 public: | 39 public: |
| 40 SVGTextChunkBuilder(); | 40 SVGTextChunkBuilder(); |
| 41 | 41 |
| 42 const Vector<SVGTextChunk>& textChunks() const { return m_textChunks; } | 42 const Vector<SVGTextChunk>& textChunks() const { return m_textChunks; } |
| 43 void transformationForTextBox(SVGInlineTextBox*, AffineTransform&) const; | 43 AffineTransform transformationForTextBox(SVGInlineTextBox*) const; |
| 44 | 44 |
| 45 void buildTextChunks(Vector<SVGInlineTextBox*>& lineLayoutBoxes); | 45 void buildTextChunks(Vector<SVGInlineTextBox*>& lineLayoutBoxes); |
| 46 void layoutTextChunks(Vector<SVGInlineTextBox*>& lineLayoutBoxes); | 46 void layoutTextChunks(Vector<SVGInlineTextBox*>& lineLayoutBoxes); |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 void addTextChunk(Vector<SVGInlineTextBox*>& lineLayoutBoxes, unsigned boxPo
sition, unsigned boxCount); | 49 void addTextChunk(Vector<SVGInlineTextBox*>& lineLayoutBoxes, unsigned boxPo
sition, unsigned boxCount); |
| 50 void processTextChunk(const SVGTextChunk&); | 50 void processTextChunk(const SVGTextChunk&); |
| 51 | 51 |
| 52 void processTextLengthSpacingCorrection(bool isVerticalText, float textLengt
hShift, Vector<SVGTextFragment>&, unsigned& atCharacter); | 52 void processTextLengthSpacingCorrection(bool isVerticalText, float textLengt
hShift, Vector<SVGTextFragment>&, unsigned& atCharacter); |
| 53 void processTextAnchorCorrection(bool isVerticalText, float textAnchorShift,
Vector<SVGTextFragment>&); | 53 void processTextAnchorCorrection(bool isVerticalText, float textAnchorShift,
Vector<SVGTextFragment>&); |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 Vector<SVGTextChunk> m_textChunks; | 56 Vector<SVGTextChunk> m_textChunks; |
| 57 HashMap<SVGInlineTextBox*, AffineTransform> m_textBoxTransformations; | 57 HashMap<SVGInlineTextBox*, AffineTransform> m_textBoxTransformations; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace WebCore | 60 } // namespace WebCore |
| 61 | 61 |
| 62 #endif | 62 #endif |
| OLD | NEW |