Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: Source/core/layout/svg/SVGTextLayoutEngine.h

Issue 1160623002: Avoid resetting the metrics-list/character offset for each text box (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void endTextPathLayout(); 53 void endTextPathLayout();
54 54
55 void layoutInlineTextBox(SVGInlineTextBox*); 55 void layoutInlineTextBox(SVGInlineTextBox*);
56 void finishLayout(); 56 void finishLayout();
57 57
58 private: 58 private:
59 void updateCharacterPositionIfNeeded(float& x, float& y); 59 void updateCharacterPositionIfNeeded(float& x, float& y);
60 void updateCurrentTextPosition(float x, float y, float glyphAdvance); 60 void updateCurrentTextPosition(float x, float y, float glyphAdvance);
61 void updateRelativePositionAdjustmentsIfNeeded(float dx, float dy); 61 void updateRelativePositionAdjustmentsIfNeeded(float dx, float dy);
62 62
63 void recordTextFragment(SVGInlineTextBox*, const Vector<SVGTextMetrics>&); 63 void recordTextFragment(SVGInlineTextBox*);
64 bool parentDefinesTextLength(LayoutObject*) const; 64 bool parentDefinesTextLength(LayoutObject*) const;
65 65
66 void layoutTextOnLineOrPath(SVGInlineTextBox*, const LayoutSVGInlineText&, c onst ComputedStyle&); 66 void layoutTextOnLineOrPath(SVGInlineTextBox*, const LayoutSVGInlineText&, c onst ComputedStyle&);
67 void finalizeTransformMatrices(Vector<SVGInlineTextBox*>&); 67 void finalizeTransformMatrices(Vector<SVGInlineTextBox*>&);
68 68
69 void updateMetricsIterator(const LayoutSVGInlineText&, unsigned characterOff set);
pdr. 2015/05/27 03:11:18 Can you move this to the iterator? It seems to be
fs 2015/05/27 12:53:13 Done.
70
69 bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&); 71 bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&);
70 bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&, SVGTextMetric s&); 72 bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&, SVGTextMetric s&);
71 bool currentVisualCharacterMetrics(SVGInlineTextBox*, const Vector<SVGTextMe trics>&, SVGTextMetrics&);
72
73 void advanceToNextLogicalCharacter(const SVGTextMetrics&); 73 void advanceToNextLogicalCharacter(const SVGTextMetrics&);
74 void advanceToNextVisualCharacter(const SVGTextMetrics&);
75 74
76 private: 75 private:
77 Vector<SVGTextLayoutAttributes*>& m_layoutAttributes; 76 Vector<SVGTextLayoutAttributes*>& m_layoutAttributes;
78 77
79 Vector<SVGInlineTextBox*> m_lineLayoutBoxes; 78 Vector<SVGInlineTextBox*> m_lineLayoutBoxes;
80 Vector<SVGInlineTextBox*> m_pathLayoutBoxes; 79 Vector<SVGInlineTextBox*> m_pathLayoutBoxes;
81 SVGTextChunkBuilder m_chunkLayoutBuilder; 80 SVGTextChunkBuilder m_chunkLayoutBuilder;
82 81
83 SVGTextFragment m_currentTextFragment; 82 SVGTextFragment m_currentTextFragment;
84 unsigned m_layoutAttributesPosition; 83 unsigned m_layoutAttributesPosition;
85 unsigned m_logicalCharacterOffset; 84 unsigned m_logicalCharacterOffset;
86 unsigned m_logicalMetricsListOffset; 85 unsigned m_logicalMetricsListOffset;
87 unsigned m_visualCharacterOffset; 86 SVGTextMetricsIterator m_visualMetricsIterator;
88 unsigned m_visualMetricsListOffset;
89 float m_x; 87 float m_x;
90 float m_y; 88 float m_y;
91 float m_dx; 89 float m_dx;
92 float m_dy; 90 float m_dy;
93 bool m_isVerticalText; 91 bool m_isVerticalText;
94 bool m_inPathLayout; 92 bool m_inPathLayout;
95 93
96 // Text on path layout 94 // Text on path layout
97 Path::PositionCalculator* m_textPathCalculator; 95 Path::PositionCalculator* m_textPathCalculator;
98 float m_textPathLength; 96 float m_textPathLength;
99 float m_textPathStartOffset; 97 float m_textPathStartOffset;
100 float m_textPathCurrentOffset; 98 float m_textPathCurrentOffset;
101 float m_textPathSpacing; 99 float m_textPathSpacing;
102 float m_textPathScaling; 100 float m_textPathScaling;
103 }; 101 };
104 102
105 } // namespace blink 103 } // namespace blink
106 104
107 #endif 105 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/svg/SVGTextLayoutEngine.cpp » ('j') | Source/core/layout/svg/SVGTextLayoutEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698