| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 class SVGTextChunkBuilder { | 38 class SVGTextChunkBuilder { |
| 39 WTF_MAKE_NONCOPYABLE(SVGTextChunkBuilder); | 39 WTF_MAKE_NONCOPYABLE(SVGTextChunkBuilder); |
| 40 public: | 40 public: |
| 41 SVGTextChunkBuilder(); | 41 SVGTextChunkBuilder(); |
| 42 | 42 |
| 43 void processTextChunks(const Vector<SVGInlineTextBox*>&); | 43 void processTextChunks(const Vector<SVGInlineTextBox*>&); |
| 44 void finalizeTransformMatrices(const Vector<SVGInlineTextBox*>&) const; | 44 void finalizeTransformMatrices(const Vector<SVGInlineTextBox*>&) const; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 virtual void handleTextChunk(const Vector<SVGInlineTextBox*>&, unsigned boxS
tart, unsigned boxEnd); | 47 typedef Vector<SVGInlineTextBox*>::const_iterator BoxListConstIterator; |
| 48 |
| 49 virtual void handleTextChunk(BoxListConstIterator boxStart, BoxListConstIter
ator boxEnd); |
| 48 | 50 |
| 49 private: | 51 private: |
| 50 void processTextLengthSpacingCorrection(bool isVerticalText, float textLengt
hShift, Vector<SVGTextFragment>&, unsigned& atCharacter); | 52 void processTextLengthSpacingCorrection(bool isVerticalText, float textLengt
hShift, Vector<SVGTextFragment>&, unsigned& atCharacter); |
| 51 void processTextAnchorCorrection(bool isVerticalText, float textAnchorShift,
Vector<SVGTextFragment>&); | 53 void processTextAnchorCorrection(bool isVerticalText, float textAnchorShift,
Vector<SVGTextFragment>&); |
| 52 | 54 |
| 53 HashMap<SVGInlineTextBox*, AffineTransform> m_textBoxTransformations; | 55 HashMap<SVGInlineTextBox*, AffineTransform> m_textBoxTransformations; |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 class SVGTextPathChunkBuilder final : public SVGTextChunkBuilder { | 58 class SVGTextPathChunkBuilder final : public SVGTextChunkBuilder { |
| 57 WTF_MAKE_NONCOPYABLE(SVGTextPathChunkBuilder); | 59 WTF_MAKE_NONCOPYABLE(SVGTextPathChunkBuilder); |
| 58 public: | 60 public: |
| 59 SVGTextPathChunkBuilder(); | 61 SVGTextPathChunkBuilder(); |
| 60 | 62 |
| 61 float totalLength() const { return m_totalLength; } | 63 float totalLength() const { return m_totalLength; } |
| 62 unsigned totalCharacters() const { return m_totalCharacters; } | 64 unsigned totalCharacters() const { return m_totalCharacters; } |
| 63 float totalTextAnchorShift() const { return m_totalTextAnchorShift; } | 65 float totalTextAnchorShift() const { return m_totalTextAnchorShift; } |
| 64 | 66 |
| 65 private: | 67 private: |
| 66 void handleTextChunk(const Vector<SVGInlineTextBox*>&, unsigned boxStart, un
signed boxEnd) override; | 68 void handleTextChunk(BoxListConstIterator boxStart, BoxListConstIterator box
End) override; |
| 67 | 69 |
| 68 float m_totalLength; | 70 float m_totalLength; |
| 69 unsigned m_totalCharacters; | 71 unsigned m_totalCharacters; |
| 70 float m_totalTextAnchorShift; | 72 float m_totalTextAnchorShift; |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace blink | 75 } // namespace blink |
| 74 | 76 |
| 75 #endif | 77 #endif |
| OLD | NEW |