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