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

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

Issue 1844723003: Move metrics list storage to LayoutSVGInlineText (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-2011. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2011. 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #ifndef SVGTextLayoutAttributes_h 20 #ifndef SVGTextLayoutAttributes_h
21 #define SVGTextLayoutAttributes_h 21 #define SVGTextLayoutAttributes_h
22 22
23 #include "core/layout/svg/SVGTextMetrics.h"
24 #include "wtf/Allocator.h" 23 #include "wtf/Allocator.h"
25 #include "wtf/HashMap.h" 24 #include "wtf/HashMap.h"
26 #include "wtf/MathExtras.h" 25 #include "wtf/MathExtras.h"
27 #include "wtf/Noncopyable.h" 26 #include "wtf/Noncopyable.h"
28 #include "wtf/Vector.h"
29 27
30 namespace blink { 28 namespace blink {
31 29
32 class LayoutSVGInlineText; 30 class LayoutSVGInlineText;
33 31
34 struct SVGCharacterData { 32 struct SVGCharacterData {
35 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 33 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
36 SVGCharacterData(); 34 SVGCharacterData();
37 35
38 float x; 36 float x;
(...skipping 13 matching lines...) Expand all
52 50
53 void clear(); 51 void clear();
54 static float emptyValue() { return std::numeric_limits<float>::quiet_NaN(); } 52 static float emptyValue() { return std::numeric_limits<float>::quiet_NaN(); }
55 static bool isEmptyValue(float value) { return std::isnan(value); } 53 static bool isEmptyValue(float value) { return std::isnan(value); }
56 54
57 LayoutSVGInlineText* context() const { return m_context; } 55 LayoutSVGInlineText* context() const { return m_context; }
58 56
59 SVGCharacterDataMap& characterDataMap() { return m_characterDataMap; } 57 SVGCharacterDataMap& characterDataMap() { return m_characterDataMap; }
60 const SVGCharacterDataMap& characterDataMap() const { return m_characterData Map; } 58 const SVGCharacterDataMap& characterDataMap() const { return m_characterData Map; }
61 59
62 Vector<SVGTextMetrics>& textMetricsValues() { return m_textMetricsValues; }
63 const Vector<SVGTextMetrics>& textMetricsValues() const { return m_textMetri csValues; }
64
65 private: 60 private:
66 LayoutSVGInlineText* m_context; 61 LayoutSVGInlineText* m_context;
67 SVGCharacterDataMap m_characterDataMap; 62 SVGCharacterDataMap m_characterDataMap;
68 Vector<SVGTextMetrics> m_textMetricsValues;
69 }; 63 };
70 64
71 inline SVGCharacterData::SVGCharacterData() 65 inline SVGCharacterData::SVGCharacterData()
72 : x(SVGTextLayoutAttributes::emptyValue()) 66 : x(SVGTextLayoutAttributes::emptyValue())
73 , y(SVGTextLayoutAttributes::emptyValue()) 67 , y(SVGTextLayoutAttributes::emptyValue())
74 , dx(SVGTextLayoutAttributes::emptyValue()) 68 , dx(SVGTextLayoutAttributes::emptyValue())
75 , dy(SVGTextLayoutAttributes::emptyValue()) 69 , dy(SVGTextLayoutAttributes::emptyValue())
76 , rotate(SVGTextLayoutAttributes::emptyValue()) 70 , rotate(SVGTextLayoutAttributes::emptyValue())
77 { 71 {
78 } 72 }
79 73
80 } // namespace blink 74 } // namespace blink
81 75
82 #endif 76 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698