2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
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
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef SVGMarkerLayoutInfo_h
21 #define SVGMarkerLayoutInfo_h
24 #include "AffineTransform.h"
25 #include "RenderObject.h"
26 #include "SVGMarkerData.h"
27 #include <wtf/Noncopyable.h>
32 class RenderSVGResourceMarker;
35 MarkerLayout(RenderSVGResourceMarker* markerObj = 0, AffineTransform matrixObj = AffineTransform())
42 RenderSVGResourceMarker* marker;
43 AffineTransform matrix;
46 class SVGMarkerLayoutInfo {
47 WTF_MAKE_NONCOPYABLE(SVGMarkerLayoutInfo);
49 SVGMarkerLayoutInfo();
50 ~SVGMarkerLayoutInfo();
52 FloatRect calculateBoundaries(RenderSVGResourceMarker* startMarker, RenderSVGResourceMarker* midMarker, RenderSVGResourceMarker* endMarker, float strokeWidth, const Path&);
53 void drawMarkers(PaintInfo&);
55 // Used by static inline helper functions in SVGMarkerLayoutInfo.cpp
56 SVGMarkerData& markerData() { return m_markerData; }
57 RenderSVGResourceMarker* midMarker() const { return m_midMarker; }
58 int& elementIndex() { return m_elementIndex; }
59 void addLayoutedMarker(RenderSVGResourceMarker*, const FloatPoint& origin, float angle);
63 RenderSVGResourceMarker* m_midMarker;
65 // Used while layouting markers
67 SVGMarkerData m_markerData;
70 // Holds the final computed result
71 Vector<MarkerLayout> m_layout;