OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2009-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 |
(...skipping 25 matching lines...) Expand all Loading... |
36 const char* name() const override { return "LayoutSVGResourceMarker"; } | 36 const char* name() const override { return "LayoutSVGResourceMarker"; } |
37 | 37 |
38 void removeAllClientsFromCache(bool markForInvalidation = true) override; | 38 void removeAllClientsFromCache(bool markForInvalidation = true) override; |
39 void removeClientFromCache(LayoutObject*, bool markForInvalidation = true) o
verride; | 39 void removeClientFromCache(LayoutObject*, bool markForInvalidation = true) o
verride; |
40 | 40 |
41 // Calculates marker boundaries, mapped to the target element's coordinate s
pace | 41 // Calculates marker boundaries, mapped to the target element's coordinate s
pace |
42 FloatRect markerBoundaries(const AffineTransform& markerTransformation) cons
t; | 42 FloatRect markerBoundaries(const AffineTransform& markerTransformation) cons
t; |
43 | 43 |
44 const AffineTransform& localToSVGParentTransform() const override; | 44 const AffineTransform& localToSVGParentTransform() const override; |
45 AffineTransform markerTransformation(const FloatPoint& origin, float angle,
float strokeWidth) const; | 45 AffineTransform markerTransformation(const FloatPoint& origin, float angle,
float strokeWidth) const; |
| 46 bool shouldPaint() const; |
46 | 47 |
47 FloatPoint referencePoint() const; | 48 FloatPoint referencePoint() const; |
48 float angle() const; | 49 float angle() const; |
49 SVGMarkerUnitsType markerUnits() const; | 50 SVGMarkerUnitsType markerUnits() const; |
50 SVGMarkerOrientType orientType() const; | 51 SVGMarkerOrientType orientType() const; |
51 | 52 |
52 const FloatRect& viewport() const { return m_viewport; } | 53 const FloatRect& viewport() const { return m_viewport; } |
53 | 54 |
54 static const LayoutSVGResourceType s_resourceType = MarkerResourceType; | 55 static const LayoutSVGResourceType s_resourceType = MarkerResourceType; |
55 LayoutSVGResourceType resourceType() const override { return s_resourceType;
} | 56 LayoutSVGResourceType resourceType() const override { return s_resourceType;
} |
56 | 57 |
57 private: | 58 private: |
58 void layout() override; | 59 void layout() override; |
59 void calcViewport() override; | 60 void calcViewport() override; |
60 bool calculateLocalTransform() override; | 61 bool calculateLocalTransform() override; |
61 | 62 |
62 // Generates a transformation matrix usable to layout marker content. Handle
s scaling the marker content | |
63 // acording to SVGs markerUnits="strokeWidth" concept, when a strokeWidth va
lue != -1 is passed in. | |
64 AffineTransform markerContentTransformation(const AffineTransform& contentTr
ansformation, const FloatPoint& origin, float strokeWidth = -1) const; | |
65 | |
66 AffineTransform viewportTransform() const; | 63 AffineTransform viewportTransform() const; |
67 | 64 |
68 mutable AffineTransform m_localToParentTransform; | 65 mutable AffineTransform m_localToParentTransform; |
69 FloatRect m_viewport; | 66 FloatRect m_viewport; |
70 }; | 67 }; |
71 | 68 |
72 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceMarker, MarkerResourceTyp
e); | 69 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceMarker, MarkerResourceTyp
e); |
73 | 70 |
74 } // namespace blink | 71 } // namespace blink |
75 | 72 |
76 #endif | 73 #endif |
OLD | NEW |