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

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

Issue 1318713003: Make classes and structures in core/layout fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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. 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
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 SVGMarkerData_h 20 #ifndef SVGMarkerData_h
21 #define SVGMarkerData_h 21 #define SVGMarkerData_h
22 22
23 #include "platform/FloatConversion.h" 23 #include "platform/FloatConversion.h"
24 #include "platform/graphics/Path.h" 24 #include "platform/graphics/Path.h"
25 #include "wtf/Allocator.h"
25 #include "wtf/MathExtras.h" 26 #include "wtf/MathExtras.h"
26 27
27 namespace blink { 28 namespace blink {
28 29
29 enum SVGMarkerType { 30 enum SVGMarkerType {
30 StartMarker, 31 StartMarker,
31 MidMarker, 32 MidMarker,
32 EndMarker 33 EndMarker
33 }; 34 };
34 35
35 struct MarkerPosition { 36 struct MarkerPosition {
37 ALLOW_ONLY_INLINE_ALLOCATION();
36 MarkerPosition(SVGMarkerType useType, const FloatPoint& useOrigin, float use Angle) 38 MarkerPosition(SVGMarkerType useType, const FloatPoint& useOrigin, float use Angle)
37 : type(useType) 39 : type(useType)
38 , origin(useOrigin) 40 , origin(useOrigin)
39 , angle(useAngle) 41 , angle(useAngle)
40 { 42 {
41 } 43 }
42 44
43 SVGMarkerType type; 45 SVGMarkerType type;
44 FloatPoint origin; 46 FloatPoint origin;
45 float angle; 47 float angle;
46 }; 48 };
47 49
48 class LayoutSVGResourceMarker; 50 class LayoutSVGResourceMarker;
49 51
50 class SVGMarkerData { 52 class SVGMarkerData {
53 STACK_ALLOCATED();
51 public: 54 public:
52 SVGMarkerData(Vector<MarkerPosition>& positions, bool autoStartReverse) 55 SVGMarkerData(Vector<MarkerPosition>& positions, bool autoStartReverse)
53 : m_positions(positions) 56 : m_positions(positions)
54 , m_elementIndex(0) 57 , m_elementIndex(0)
55 , m_autoStartReverse(autoStartReverse) 58 , m_autoStartReverse(autoStartReverse)
56 { 59 {
57 } 60 }
58 61
59 static void updateFromPathElement(void* info, const PathElement* element) 62 static void updateFromPathElement(void* info, const PathElement* element)
60 { 63 {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 FloatPoint m_origin; 169 FloatPoint m_origin;
167 FloatPoint m_subpathStart; 170 FloatPoint m_subpathStart;
168 FloatPoint m_inslopePoints[2]; 171 FloatPoint m_inslopePoints[2];
169 FloatPoint m_outslopePoints[2]; 172 FloatPoint m_outslopePoints[2];
170 bool m_autoStartReverse; 173 bool m_autoStartReverse;
171 }; 174 };
172 175
173 } 176 }
174 177
175 #endif // SVGMarkerData_h 178 #endif // SVGMarkerData_h
OLDNEW
« no previous file with comments | « Source/core/layout/svg/SVGLayoutSupport.h ('k') | Source/core/layout/svg/SVGResourcesCycleSolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698