1 | /* |
2 | * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 | * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 | * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
5 | * Copyright (C) 2006 Apple Inc. |
6 | * Copyright (C) 2009 Google, Inc. |
7 | * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
8 | * Copyright (C) 2011 University of Szeged |
9 | * |
10 | * This library is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU Library General Public |
12 | * License as published by the Free Software Foundation; either |
13 | * version 2 of the License, or (at your option) any later version. |
14 | * |
15 | * This library is distributed in the hope that it will be useful, |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 | * Library General Public License for more details. |
19 | * |
20 | * You should have received a copy of the GNU Library General Public License |
21 | * along with this library; see the file COPYING.LIB. If not, write to |
22 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 | * Boston, MA 02110-1301, USA. |
24 | */ |
25 | |
26 | #pragma once |
27 | |
28 | #include "RenderSVGShape.h" |
29 | |
30 | namespace WebCore { |
31 | |
32 | class RenderSVGPath final : public RenderSVGShape { |
33 | WTF_MAKE_ISO_ALLOCATED(RenderSVGPath); |
34 | public: |
35 | RenderSVGPath(SVGGraphicsElement&, RenderStyle&&); |
36 | virtual ~RenderSVGPath(); |
37 | |
38 | private: |
39 | bool isSVGPath() const override { return true; } |
40 | const char* renderName() const override { return "RenderSVGPath" ; } |
41 | |
42 | void updateShapeFromElement() override; |
43 | FloatRect calculateUpdatedStrokeBoundingBox() const; |
44 | |
45 | void strokeShape(GraphicsContext&) const override; |
46 | bool shapeDependentStrokeContains(const FloatPoint&, PointCoordinateSpace = GlobalCoordinateSpace) override; |
47 | |
48 | bool shouldStrokeZeroLengthSubpath() const; |
49 | Path* zeroLengthLinecapPath(const FloatPoint&) const; |
50 | FloatRect zeroLengthSubpathRect(const FloatPoint&, float) const; |
51 | void updateZeroLengthSubpaths(); |
52 | |
53 | bool isRenderingDisabled() const override; |
54 | |
55 | Vector<FloatPoint> m_zeroLengthLinecapLocations; |
56 | }; |
57 | |
58 | } // namespace WebCore |
59 | |
60 | SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGPath, isSVGPath()) |
61 | |