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

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

Issue 1883553004: Refactor the current text position update in SVGTextLayoutEngine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 public: 51 public:
52 SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes*>&); 52 SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes*>&);
53 ~SVGTextLayoutEngine(); 53 ~SVGTextLayoutEngine();
54 54
55 Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttrib utes; } 55 Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttrib utes; }
56 56
57 void layoutCharactersInTextBoxes(InlineFlowBox* start); 57 void layoutCharactersInTextBoxes(InlineFlowBox* start);
58 void finishLayout(); 58 void finishLayout();
59 59
60 private: 60 private:
61 void updateCharacterPositionIfNeeded(float& x, float& y); 61 bool setCurrentTextPositionIfNeeded(const SVGCharacterData&);
pdr. 2016/04/14 01:05:52 Optional bikeshed: -isNeeded seems to have fallen
fs 2016/04/14 08:56:42 Dropped suffix.
62 void updateCurrentTextPosition(float x, float y, float glyphAdvance); 62 void advanceCurrentTextPosition(float glyphAdvance);
63 void updateRelativePositionAdjustmentsIfNeeded(float dx, float dy); 63 bool applyRelativePositionAdjustmentsIfNeeded(const SVGCharacterData&);
64 64
65 void computeCurrentFragmentMetrics(SVGInlineTextBox*); 65 void computeCurrentFragmentMetrics(SVGInlineTextBox*);
66 void recordTextFragment(SVGInlineTextBox*); 66 void recordTextFragment(SVGInlineTextBox*);
67 67
68 void beginTextPathLayout(SVGInlineFlowBox*); 68 void beginTextPathLayout(SVGInlineFlowBox*);
69 void endTextPathLayout(); 69 void endTextPathLayout();
70 70
71 void layoutInlineTextBox(SVGInlineTextBox*); 71 void layoutInlineTextBox(SVGInlineTextBox*);
72 void layoutTextOnLineOrPath(SVGInlineTextBox*, LineLayoutSVGInlineText, cons t ComputedStyle&); 72 void layoutTextOnLineOrPath(SVGInlineTextBox*, LineLayoutSVGInlineText, cons t ComputedStyle&);
73 73
74 bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&); 74 bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&);
75 bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&, SVGTextMetric s&); 75 bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&, SVGTextMetric s&);
76 void advanceToNextLogicalCharacter(const SVGTextMetrics&); 76 void advanceToNextLogicalCharacter(const SVGTextMetrics&);
77 77
78 private: 78 private:
79 Vector<SVGTextLayoutAttributes*>& m_layoutAttributes; 79 Vector<SVGTextLayoutAttributes*>& m_layoutAttributes;
80 80
81 Vector<SVGInlineTextBox*> m_lineLayoutBoxes; 81 Vector<SVGInlineTextBox*> m_lineLayoutBoxes;
82 82
83 SVGTextFragment m_currentTextFragment; 83 SVGTextFragment m_currentTextFragment;
84 unsigned m_layoutAttributesPosition; 84 unsigned m_layoutAttributesPosition;
85 unsigned m_logicalCharacterOffset; 85 unsigned m_logicalCharacterOffset;
86 unsigned m_logicalMetricsListOffset; 86 unsigned m_logicalMetricsListOffset;
87 SVGInlineTextMetricsIterator m_visualMetricsIterator; 87 SVGInlineTextMetricsIterator m_visualMetricsIterator;
88 float m_x; 88 FloatPoint m_ctp;
pdr. 2016/04/14 01:05:52 +1 to merging these into a FloatPoint, but ctp isn
fs 2016/04/14 08:56:42 For me it's a very common acronym =D [1]. I guess
89 float m_y;
90 float m_dx;
91 float m_dy;
92 bool m_isVerticalText; 89 bool m_isVerticalText;
93 bool m_inPathLayout; 90 bool m_inPathLayout;
94 bool m_textLengthSpacingInEffect; 91 bool m_textLengthSpacingInEffect;
95 92
96 // Text on path layout 93 // Text on path layout
97 OwnPtr<PathPositionMapper> m_textPath; 94 OwnPtr<PathPositionMapper> m_textPath;
98 float m_textPathStartOffset; 95 float m_textPathStartOffset;
99 float m_textPathCurrentOffset; 96 float m_textPathCurrentOffset;
97 float m_textPathDisplacement;
100 float m_textPathSpacing; 98 float m_textPathSpacing;
101 float m_textPathScaling; 99 float m_textPathScaling;
102 }; 100 };
103 101
104 } // namespace blink 102 } // namespace blink
105 103
106 #endif 104 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698